Skip to content

Commit

Permalink
feat(eslint): simplify config since v7 (#640)
Browse files Browse the repository at this point in the history
- Set `root: true`.
- Remove `--ignore-path`.
- Remove `--no-ignore`.
- Remove `--ext`

See also https://eslint.org/blog/2020/05/eslint-v7.0.0-released
  • Loading branch information
ybiquitous authored Jul 14, 2020
1 parent b1b419b commit c22d7e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const initCommand = (baseDir, logger) => {
extends: ["@commitlint/config-conventional"],
};
packageInfo.eslintConfig = {
root: true,
extends: ["ybiquitous"],
};

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"test": "nyc --check-coverage --lines 100 --branches 90 tape \"test/**/*.test.js\"",
"test:watch": "nodemon --ext js,json --watch . --exec \"tape test/**/*.test.js\"",
"test:coverage": "nyc report --reporter=html",
"lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.mjs,.ts,.tsx .",
"lint:js": "eslint .",
"lint:js:fix": "npm run lint:js -- --fix",
"lint:md": "remark . --frail",
"lint:md:fix": "remark . --output",
Expand All @@ -68,7 +68,7 @@
}
},
"lint-staged": {
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix --no-ignore",
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
"*": "prettier --write",
"!(CHANGELOG).md": "remark --frail"
},
Expand Down Expand Up @@ -125,6 +125,7 @@
}
},
"eslintConfig": {
"root": true,
"extends": [
"ybiquitous/node"
],
Expand Down
5 changes: 3 additions & 2 deletions test/fixtures/package-empty_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"test": "test",
"test:watch": "test --watch",
"test:coverage": "echo \"unsupported.\" && exit 1",
"lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.mjs,.ts,.tsx .",
"lint:js": "eslint .",
"lint:js:fix": "npm run lint:js -- --fix",
"lint:md": "remark . --frail",
"lint:md:fix": "remark . --output",
Expand All @@ -23,7 +23,7 @@
}
},
"lint-staged": {
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix --no-ignore",
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
"*": "prettier --write",
"!(CHANGELOG).md": "remark --frail"
},
Expand All @@ -46,6 +46,7 @@
"extends": ["@commitlint/config-conventional"]
},
"eslintConfig": {
"root": true,
"extends": ["ybiquitous"]
}
}
5 changes: 3 additions & 2 deletions test/fixtures/package-normal_expected.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"scripts": {
"test": "abc",
"lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.mjs,.ts,.tsx .",
"lint:js": "eslint .",
"test:watch": "abc --watch",
"test:coverage": "echo \"unsupported.\" && exit 1",
"lint:js:fix": "npm run lint:js -- --fix",
Expand All @@ -24,7 +24,7 @@
},
"lint-staged": {
"*.css": "xyz",
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix --no-ignore",
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
"*": "prettier --write",
"!(CHANGELOG).md": "remark --frail"
},
Expand All @@ -47,6 +47,7 @@
"extends": ["@commitlint/config-conventional"]
},
"eslintConfig": {
"root": true,
"extends": ["ybiquitous"]
}
}

0 comments on commit c22d7e3

Please sign in to comment.