diff --git a/README.md b/README.md index d8118d8..a92523d 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,19 @@ # spec -eslint/stylelint/prettier config. +Easy to use eslint/stylelint/prettier. And spec means specification. ## Features - [x] eslint - [x] stylelint -- [ ] prettier - [x] eslint support TypeScript +- [x] commitlint +- [ ] prettier ## Install ```bash -$ npm i --save-dev @ice/spec eslint stylelint +$ npm i --save-dev @ice/spec eslint stylelint @commitlint/cli ``` ## Usage @@ -47,6 +48,16 @@ const { stylelint } = require('@ice/spec'); module.exports = stylelint; ``` +### commitlint [rules](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional) + +in `.commitlintrc.js` + +```js +const { commitlint } = require('@ice/spec'); + +module.exports = commitlint; +``` + ## FAQ ### Custom config diff --git a/lib/commitlint.js b/lib/commitlint.js new file mode 100644 index 0000000..dfd2d74 --- /dev/null +++ b/lib/commitlint.js @@ -0,0 +1,4 @@ +// https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional +const config = require('@commitlint/config-conventional'); + +module.exports = config; diff --git a/lib/index.js b/lib/index.js index da48347..1674afd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,6 +2,7 @@ module.exports = { eslint: require('./eslint'), tslint: require('./tslint'), stylelint: require('./stylelint'), + commitlint: require('./commitlint'), prettier: require('./prettier'), // deprecated, please use tslint eslintTS: require('./tslint'), diff --git a/package.json b/package.json index 9e5d1a9..2112d4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ice/spec", - "version": "0.1.6", + "version": "0.1.7", "description": "eslint/stylelint/editorconfig", "main": "lib/index.js", "scripts": { @@ -24,6 +24,7 @@ "stylelint": "^10.0.0" }, "dependencies": { + "@commitlint/config-conventional": "^8.1.0", "@typescript-eslint/eslint-plugin": "^1.11.0", "@typescript-eslint/parser": "^1.11.0", "babel-eslint": "^10.0.2",