From 54bc9104801316c8e259bd5b7adad91e0ba3b949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sat, 4 Sep 2021 18:57:32 +0200 Subject: [PATCH] feat: support ESLint 8.x BREAKING CHANGE: Requires ESLint@^8.0.0 --- index.js | 2 ++ jest.js | 11 +++-------- package.json | 18 +++++++++--------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index 946fba3..1473f30 100644 --- a/index.js +++ b/index.js @@ -172,6 +172,7 @@ module.exports = { 'no-unsafe-optional-chaining': 'error', 'no-unused-expressions': 'off', 'no-unused-labels': 'error', + 'no-unused-private-class-members': 'error', 'no-unused-vars': [ 'error', { @@ -208,6 +209,7 @@ module.exports = { 'prefer-exponentiation-operator': 'warn', 'prefer-named-capture-group': 'off', // maybe one day... But I'm not used to it yet. 'prefer-numeric-literals': 'error', + 'prefer-object-has-own': 'error', 'prefer-object-spread': 'warn', 'prefer-promise-reject-errors': 'off', // maybe one day... Not sure I'm in... 'prefer-regex-literals': 'off', diff --git a/jest.js b/jest.js index 175f265..982c393 100644 --- a/jest.js +++ b/jest.js @@ -36,7 +36,6 @@ const rules = { 'jest/consistent-test-it': 'off', 'jest/expect-expect': 'off', - 'jest/lowercase-name': 'off', 'jest/max-nested-describe': 'error', 'jest/no-alias-methods': 'off', 'jest/no-commented-out-tests': 'warn', @@ -59,17 +58,13 @@ const rules = { 'jest/no-standalone-expect': 'off', 'jest/no-test-prefixes': 'error', 'jest/no-test-return-statement': 'off', - 'jest/no-truthy-falsy': 'off', - 'jest/no-try-expect': 'error', 'jest/prefer-called-with': 'error', 'jest/prefer-expect-assertions': 'off', 'jest/prefer-expect-resolves': 'off', 'jest/prefer-hooks-on-top': 'error', - 'jest/prefer-inline-snapshots': 'off', + 'jest/prefer-lowercase-title': 'off', 'jest/prefer-spy-on': 'off', 'jest/prefer-strict-equal': 'off', - 'jest/prefer-to-be-null': 'off', - 'jest/prefer-to-be-undefined': 'off', 'jest/prefer-to-be': 'off', 'jest/prefer-to-contain': 'warn', 'jest/prefer-to-have-length': 'warn', @@ -78,7 +73,7 @@ const rules = { 'jest/require-to-throw-message': 'off', 'jest/require-top-level-describe': 'off', 'jest/unbound-method': 'off', - 'jest/valid-describe': 'error', + 'jest/valid-describe-callback': 'error', 'jest/valid-expect': 'error', 'jest/valid-expect-in-promise': 'error', 'jest/valid-title': 'warn', @@ -108,7 +103,7 @@ const rules = { 'testing-library/no-await-sync-events': 'error', 'testing-library/no-await-sync-query': 'error', 'testing-library/no-container': 'error', - 'testing-library/no-debug': 'error', + 'testing-library/no-debugging-utils': 'error', 'testing-library/no-dom-import': ['error', 'react'], 'testing-library/no-manual-cleanup': 'error', 'testing-library/no-node-access': 'error', diff --git a/package.json b/package.json index 93aca0b..2529aba 100644 --- a/package.json +++ b/package.json @@ -33,24 +33,24 @@ }, "homepage": "https://github.com/kentcdodds/eslint-config-kentcdodds#readme", "dependencies": { - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.25.3", - "eslint-plugin-jest": "^24.7.0", - "eslint-plugin-jest-dom": "^3.9.4", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-jest": "^25.3.4", + "eslint-plugin-jest-dom": "^4.0.1", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0", - "eslint-plugin-testing-library": "^4.12.4", + "eslint-plugin-testing-library": "^5.0.1", "read-pkg-up": "^7.0.1", "semver": "^7.3.5" }, "devDependencies": { "@testing-library/dom": "^8.11.1", "@testing-library/jest-dom": "^5.16.1", - "eslint": "^7.32.0", - "eslint-find-rules": "^3.6.1", + "eslint": "^8.6.0", + "eslint-find-rules": "^4.0.0", "husky": "^7.0.0", "jest": "^27.4.5", "npm-run-all": "^4.1.5", @@ -60,7 +60,7 @@ "typescript": "^4.5.4" }, "peerDependencies": { - "eslint": "^7.5.0", + "eslint": "^8.0.0", "typescript": "^4.0.0" }, "peerDependenciesMeta": {