Skip to content

Commit

Permalink
feat: support commitlint (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
imsobear authored Aug 27, 2019
2 parents da2aa1e + b346af9 commit 679d022
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
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 679d022

Please sign in to comment.