Skip to content

Commit

Permalink
feat: support commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
imsobear committed Aug 27, 2019
1 parent da2aa1e commit 8162340
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ eslint/stylelint/prettier config.

- [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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/commitlint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional
const config = require('@commitlint/config-conventional');

module.exports = config;
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/spec",
"version": "0.1.6",
"version": "0.1.7",
"description": "eslint/stylelint/editorconfig",
"main": "lib/index.js",
"scripts": {
Expand All @@ -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",
Expand Down

0 comments on commit 8162340

Please sign in to comment.