Skip to content

Commit

Permalink
chore: eslintTS -> tslint (#7)
Browse files Browse the repository at this point in the history
* chore: eslintTS -> eslint

* chore: eslintTS -> tslint

* 0.1.6
  • Loading branch information
imsobear authored Aug 19, 2019
1 parent 97912eb commit da2aa1e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ npm i --save-dev @ice/spec eslint stylelint

## Usage

### eslint [rules](/lib/eslint.js)
### eslint [rules](/lib/eslint.js)

Create a `.eslintrc.js`

Expand All @@ -27,17 +27,17 @@ const { eslint } = require('@ice/spec');
module.exports = eslint;
```

### eslint support TypeScript [rules](/lib/eslintTS.js)
### eslint support TypeScript [rules](/lib/tslint.js)

Create a `.eslintrc.js`

```js
const { eslintTS } = require('@ice/spec');
const { tslint } = require('@ice/spec');

module.exports = eslintTS;
module.exports = tslint;
```

### stylelint [rules](/lib/eslint.js)
### stylelint [rules](/lib/eslint.js)

in `.stylelint.js`

Expand Down
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module.exports = {
eslint: require('./eslint'),
eslintTS: require('./eslintTS'),
tslint: require('./tslint'),
stylelint: require('./stylelint'),
prettier: require('./prettier'),
// deprecated, please use tslint
eslintTS: require('./tslint'),

deepmerge: require('deepmerge'),
};
6 changes: 2 additions & 4 deletions lib/eslintTS.js → lib/tslint.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const eslint = require('./eslint');
const deepmerge = require('deepmerge')

const TSConfig = {
module.exports = deepmerge(eslint, {
parser: require.resolve("@typescript-eslint/parser"),
extends: [
"plugin:@typescript-eslint/recommended"
Expand All @@ -24,6 +24,4 @@ const TSConfig = {
}
}]
}
}

module.exports = deepmerge(eslint, TSConfig);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/spec",
"version": "0.1.5",
"version": "0.1.6",
"description": "eslint/stylelint/editorconfig",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit da2aa1e

Please sign in to comment.