Skip to content

Commit

Permalink
feat(deps): bump eslint to v7 (#695)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the minimum required peer dependencies are bumped.
  • Loading branch information
ybiquitous authored Jul 14, 2020
1 parent 8a9d6e6 commit cbf04f0
Show file tree
Hide file tree
Showing 10 changed files with 573 additions and 283 deletions.
818 changes: 546 additions & 272 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"repository": "ybiquitous/eslint-config-ybiquitous",
"engines": {
"node": ">=10"
"node": "^10.12.0 || >=12.0.0"
},
"dependencies": {
"eslint-config-prettier": "^6.11.0",
Expand All @@ -32,9 +32,9 @@
"eslint-plugin-react-hooks": "^4.0.8"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "2.34.0",
"@typescript-eslint/parser": "2.34.0",
"eslint": "6.8.0",
"@typescript-eslint/eslint-plugin": "3.6.0",
"@typescript-eslint/parser": "3.6.0",
"eslint": "7.4.0",
"eslint-find-rules": "3.6.0",
"execa": "4.0.3",
"prettier": "2.0.5",
Expand All @@ -44,9 +44,9 @@
"ybiq": "11.0.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">=2.34.0 <3",
"@typescript-eslint/parser": ">=2.34.0 <3",
"eslint": ">=6.8.0 <7"
"@typescript-eslint/eslint-plugin": ">=3.6.0 <4.0.0",
"@typescript-eslint/parser": ">=3.6.0 <4.0.0",
"eslint": ">=7.4.0 <8.0.0"
},
"peerDependenciesMeta": {
"@typescript-eslint/eslint-plugin": {
Expand Down
1 change: 1 addition & 0 deletions rules/core/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
"consistent-return": "error",
curly: "error",
"default-case": "error",
"default-case-last": "error",
"default-param-last": "error",
"dot-location": ["error", "property"],
"dot-notation": "error",
Expand Down
1 change: 1 addition & 0 deletions rules/core/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
"no-dupe-class-members": "error",
"no-duplicate-imports": "off", // => `import/no-duplicates`
"no-new-symbol": "error",
"no-restricted-exports": "off",
"no-restricted-imports": "off",
"no-this-before-super": "error",
"no-useless-computed-key": "error",
Expand Down
4 changes: 4 additions & 0 deletions rules/core/possible-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@ module.exports = {
"no-inner-declarations": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-obj-calls": "error",
"no-promise-executor-return": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-setter-return": "error",
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "error",
"no-unreachable-loop": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-useless-backreference": "error",
"require-atomic-updates": "error",
"use-isnan": "error",
"valid-typeof": "error",
Expand Down
1 change: 1 addition & 0 deletions rules/core/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
"func-names": ["error", "as-needed"],
"func-style": "off",
"id-blacklist": "off",
"id-denylist": "off",
"id-length": "off",
"id-match": "off",
"line-comment-position": "off",
Expand Down
2 changes: 0 additions & 2 deletions rules/plugins/jsx-a11y.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module.exports = {
extends: ["plugin:jsx-a11y/recommended"],

plugins: ["jsx-a11y"],

rules: {
"jsx-a11y/lang": "error",
},
Expand Down
9 changes: 9 additions & 0 deletions rules/plugins/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ module.exports = {
rules: {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-tslint-comment": "off",
"@typescript-eslint/class-literal-property-style": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"default-param-last": "off",
"@typescript-eslint/default-param-last": "error", // eslint-disable-line sort-keys
Expand All @@ -25,6 +27,7 @@ module.exports = {
"@typescript-eslint/method-signature-style": "error",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": "error", // eslint-disable-line sort-keys
"@typescript-eslint/no-dynamic-delete": "warn",
Expand All @@ -34,6 +37,8 @@ module.exports = {
"@typescript-eslint/no-implied-eval": "error",
"@typescript-eslint/no-invalid-this": "off",
"@typescript-eslint/no-invalid-void-type": "error",
"no-loss-of-precision": "off",
"@typescript-eslint/no-loss-of-precision": ["error"], // eslint-disable-line sort-keys
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-parameter-properties": "off",
Expand All @@ -51,16 +56,20 @@ module.exports = {
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "error", // eslint-disable-line sort-keys
"@typescript-eslint/no-unused-vars-experimental": "off",
"@typescript-eslint/no-use-before-define": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error", // eslint-disable-line sort-keys
"@typescript-eslint/prefer-as-const": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-literal-enum-member": "error",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/prefer-readonly-parameter-types": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-ts-expect-error": "off",
"@typescript-eslint/promise-function-async": "warn",
"@typescript-eslint/require-array-sort-compare": "warn",
Expand Down
1 change: 1 addition & 0 deletions test/check-rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ test("no unused rules", (t) => {

test("deprecated rules", (t) => {
const ignoredRules = [
"no-process-exit",
"jsx-a11y/label-has-for",
"@typescript-eslint/camelcase",
"@typescript-eslint/class-name-casing",
Expand Down
5 changes: 3 additions & 2 deletions test/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const { sandbox, $, lintConfigFiles } = require("./helper");

const baseDir = path.join(__dirname, "..");

const writeESLintConfig = (config) => fs.writeFileSync(".eslintrc", JSON.stringify(config));
const writeESLintConfig = (config) =>
fs.writeFileSync(".eslintrc", JSON.stringify({ root: true, ...config }));

const writeLintTargetFile = (content) => fs.writeFileSync("test.js", `${content}${EOL}`);

Expand Down Expand Up @@ -36,7 +37,7 @@ test("End-to-End", (t) => {
const eslint = path.join(cwd, "node_modules", ".bin", "eslint");

writeESLintConfig({ extends: "ybiquitous" });
writeLintTargetFile("process.stdout.write(1);");
writeLintTargetFile("const func = () => 1;\nfunc();");
$(eslint, ".");
t.pass("default configuration");

Expand Down

0 comments on commit cbf04f0

Please sign in to comment.