Skip to content

Commit 39469d0

Browse files
committed
style: use eslint-config-standard + prettier
1 parent 28bf1e3 commit 39469d0

12 files changed

+42
-44
lines changed

.codeclimate.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Customizable commit-analyzer plugin for [semantic-release](https://github.com/se
66
[![npm](https://img.shields.io/npm/dt/sr-commit-analyzer.svg)](https://www.npmjs.com/package/sr-commit-analyzer)
77
[![Greenkeeper badge](https://badges.greenkeeper.io/vanduynslagerp/sr-commit-analyzer.svg)](https://greenkeeper.io/)
88
[![license](https://img.shields.io/github/license/vanduynslagerp/sr-commit-analyzer.svg)](https://github.com/vanduynslagerp/sr-commit-analyzer/blob/master/LICENSE)
9+
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
910
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
1011
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
1112

1213
[![Travis](https://img.shields.io/travis/vanduynslagerp/sr-commit-analyzer.svg)](https://travis-ci.org/vanduynslagerp/sr-commit-analyzer)
13-
[![Code Climate](https://img.shields.io/codeclimate/github/vanduynslagerp/sr-commit-analyzer.svg)](https://codeclimate.com/github/vanduynslagerp/sr-commit-analyzer)
1414
[![Codecov](https://img.shields.io/codecov/c/github/vanduynslagerp/sr-commit-analyzer.svg)](https://codecov.io/gh/vanduynslagerp/sr-commit-analyzer)
1515

1616
## Install

lib/analyze-commit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const compareReleaseTypes = require('./compare-release-types');
44

55
/**
66
* Find all the rules matching and return the highest release type of the matching rules.
7-
*
7+
*
88
* @param {Array} releaseRules the rules to match the commit against.
99
* @param {Commit} commit a parsed commit.
1010
* @return {string} the highest release type of the matching rules or `undefined` if no rule match the commit.

lib/default/release-rules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Default `releaseRules` rules for common commit formats, following conventions.
3-
*
3+
*
44
* @type {Array}
55
*/
66
module.exports = [

lib/default/release-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Type of release supported by Semver/NPM.
3-
*
3+
*
44
* @type {Array}
55
*/
66
module.exports = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const DEFAULT_RELEASE_RULES = require('./default/release-rules');
1414

1515
/**
1616
* Determine the type of release to create based on a list of commits.
17-
*
17+
*
1818
* @param {Object} pluginConfig semantic-release configuration
1919
* @param {string} pluginConfig.preset conventional-changelog preset ('angular', 'atom', 'codemirror', 'ember', 'eslint', 'express', 'jquery', 'jscs', 'jshint')
2020
* @param {string} pluginConfig.config requierable npm package with a custom conventional-changelog preset

lib/load/parser-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const conventionalChangelogAngular = require('conventional-changelog-angular');
66

77
/**
88
* Load `conventional-changelog-parser` options. Handle presets that return either a `Promise<Array>` or a `Promise<Function>`.
9-
*
9+
*
1010
* @param {Object} preset conventional-changelog preset ('angular', 'atom', 'codemirror', 'ember', 'eslint', 'express', 'jquery', 'jscs', 'jshint')
1111
* @param {string} config requierable npm package with a custom conventional-changelog preset
1212
* @param {Object} parserOpts additionnal `conventional-changelog-parser` options that will overwrite ones loaded by `preset` or `config`.

lib/load/release-rules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const RELEASE_TYPES = require('../default/release-types');
44

55
/**
66
* Load and validate the `releaseRules` rules.
7-
*
7+
*
88
* If `releaseRules` parameter is a `string` then load it as an external module with `require`.
99
* Verifies that the loaded/parameter `releaseRules` is an `Array` and each element has a valid `release` attribute.
10-
*
10+
*
1111
* @param {string|Array} releaseRules a string to load an external module or an `Array` of rules.
1212
* @return {Array} the loaded and validated `releaseRules`.
1313
*/

lib/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const parser = require('conventional-commits-parser').sync;
33

44
/**
55
* Parse a raw commit.
6-
*
6+
*
77
* @method parse
88
* @param {[type]} rawCommit the raw commit message.
99
* @param {[type]} config the parser configuration.

package.json

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"config": {
1010
"commitizen": {
11-
"path": "@metahub/cz-conventional-commit"
11+
"path": "cz-conventional-changelog"
1212
}
1313
},
1414
"dependencies": {
@@ -22,7 +22,6 @@
2222
"devDependencies": {
2323
"@commitlint/cli": "^3.1.3",
2424
"@commitlint/config-angular": "^3.1.1",
25-
"@metahub/cz-conventional-commit": "^2.0.0",
2625
"ava": "^0.22.0",
2726
"codecov": "^2.3.0",
2827
"commitizen": "^2.9.6",
@@ -31,20 +30,15 @@
3130
"conventional-changelog-eslint": "^0.2.0",
3231
"conventional-changelog-express": "^0.2.0",
3332
"conventional-changelog-jshint": "^0.2.0",
33+
"cz-conventional-changelog": "^2.0.0",
3434
"eslint": "^4.5.0",
3535
"eslint-config-prettier": "^2.3.0",
36-
"eslint-config-pretty": "^2.1.1",
37-
"eslint-plugin-ava": "^4.2.1",
38-
"eslint-plugin-babel": "^4.1.2",
39-
"eslint-plugin-eslint-comments": "^1.0.3",
36+
"eslint-config-standard": "^10.2.1",
4037
"eslint-plugin-import": "^2.7.0",
41-
"eslint-plugin-jasmine": "^2.8.4",
42-
"eslint-plugin-json": "^1.2.0",
4338
"eslint-plugin-node": "^5.1.1",
4439
"eslint-plugin-prettier": "^2.2.0",
4540
"eslint-plugin-promise": "^3.5.0",
46-
"eslint-plugin-sort-class-members": "^1.2.0",
47-
"eslint-plugin-unicorn": "^2.1.2",
41+
"eslint-plugin-standard": "^3.0.1",
4842
"husky": "^0.14.3",
4943
"nyc": "^11.1.0",
5044
"prettier": "^1.5.3",
@@ -56,6 +50,26 @@
5650
"engines": {
5751
"node": ">=8"
5852
},
53+
"eslintConfig": {
54+
"extends": [
55+
"standard",
56+
"prettier"
57+
],
58+
"plugins": [
59+
"prettier"
60+
],
61+
"rules": {
62+
"prettier/prettier": [
63+
2,
64+
{
65+
"printWidth": 120,
66+
"singleQuote": true,
67+
"bracketSpacing": false,
68+
"trailingComma": "es5"
69+
}
70+
]
71+
}
72+
},
5973
"files": [
6074
"lib"
6175
],
@@ -89,6 +103,12 @@
89103
"peerDependencies": {
90104
"semantic-release": ">= 4"
91105
},
106+
"prettier": {
107+
"printWidth": 120,
108+
"singleQuote": true,
109+
"bracketSpacing": false,
110+
"trailingComma": "es5"
111+
},
92112
"publishConfig": {
93113
"access": "public"
94114
},
@@ -110,8 +130,7 @@
110130
"codecov": "codecov",
111131
"commitmsg": "commitlint -e",
112132
"coverage": "nyc check-coverage",
113-
"lint": "eslint lib test package.json",
114-
"postcheckout": "yarn install || (rimraf && npm install)",
133+
"lint": "eslint lib test",
115134
"precommit": "npm run lint",
116135
"prepush": "ava -v",
117136
"pretest": "npm run clean && npm run lint",

test/load-parser-config.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import loadParserConfig from './../lib/load/parser-config';
44

55
/**
66
* AVA macro to verify that `loadParserConfig` return a parserOpts object.
7-
*
7+
*
88
* @method loadPreset
99
* @param {Object} t AVA assertion library.
1010
* @param {[type]} preset the `conventional-changelog` preset to test.
@@ -16,7 +16,7 @@ loadPreset.title = (providedTitle, preset) => `${providedTitle} Load "${preset}"
1616

1717
/**
1818
* AVA macro to verify that `loadParserConfig` return a parserOpts object.
19-
*
19+
*
2020
* @method loadPreset
2121
* @param {Object} t AVA assertion library.
2222
* @param {[type]} config the `conventional-changelog` config to test.

0 commit comments

Comments
 (0)