Skip to content

Commit fbefe7b

Browse files
chore(lint): update eslint config and scripts
- Delete `.eslintignore` and use `.gitignore` as ignore-path - Add npm script `lint:fix`
1 parent 4998c8b commit fbefe7b

File tree

3 files changed

+18
-37
lines changed

3 files changed

+18
-37
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,18 @@
11
{
2-
"env": {
3-
"node": true,
4-
"browser": true,
5-
"mocha": true,
6-
"commonjs": true
7-
},
8-
9-
"extends": "eslint:recommended",
10-
11-
"rules": {
12-
"indent": [
13-
"error",
14-
4,
15-
{ "SwitchCase": 1 }
16-
],
17-
"linebreak-style": [
18-
"error",
19-
"unix"
20-
],
21-
"quotes": [
22-
"error",
23-
"single"
24-
],
25-
"semi": [
26-
"error",
27-
"always"
28-
],
29-
"no-unused-vars": [
30-
"error",
31-
{ "vars": "all", "args": "none" }
32-
],
33-
"strict": 2,
34-
"no-cond-assign": 2,
35-
"camelcase": 1
36-
}
2+
"env": {
3+
"node": true,
4+
"browser": true,
5+
"mocha": true,
6+
"commonjs": true
7+
},
8+
"extends": "eslint:recommended",
9+
"rules": {
10+
"indent": ["error", 4, { "SwitchCase": 1 }],
11+
"linebreak-style": ["error", "unix"],
12+
"quotes": ["error", "single"],
13+
"semi": ["error", "always"],
14+
"no-unused-vars": ["error", { "vars": "all", "args": "none" }],
15+
"no-cond-assign": 2,
16+
"camelcase": 1
17+
}
3718
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"build:unmin": "NODE_ENV=development webpack index.js dist/html-react-parser.js",
1212
"build:min": "NODE_ENV=production webpack -p index.js dist/html-react-parser.min.js",
1313
"test": "mocha",
14-
"lint": "eslint index.js \"lib/**\" \"test/**\"",
14+
"lint": "eslint --ignore-path .gitignore .",
15+
"lint:fix": "npm run lint -- --fix",
1516
"cover": "istanbul cover _mocha -- -R spec \"test/**/*\"",
1617
"coveralls": "cat coverage/lcov.info | coveralls"
1718
},

0 commit comments

Comments
 (0)