From c6abf7babbca0aed2e8c34e2b976021f59db8eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= <info@michaeldeboey.be> Date: Sat, 28 Jan 2023 18:14:43 +0100 Subject: [PATCH 1/4] feat: update dependencies & add new rules --- import.js | 2 ++ index.js | 3 +++ jsx-a11y.js | 3 +++ package.json | 30 +++++++++++++++--------------- react.js | 2 ++ 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/import.js b/import.js index 05be663..a1813f2 100644 --- a/import.js +++ b/import.js @@ -17,6 +17,7 @@ module.exports = { 'import/ignore': ['node_modules', '.json$', '.(scss|less|css|styl)$'], }, rules: { + 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], 'import/default': 'error', 'import/dynamic-import-chunkname': 'off', 'import/export': 'error', @@ -37,6 +38,7 @@ module.exports = { 'import/no-deprecated': 'warn', // this is an in progress rule 'import/no-duplicates': 'error', 'import/no-dynamic-require': 'off', + 'import/no-empty-named-blocks': 'error', 'import/no-extraneous-dependencies': 'error', 'import/no-import-module-exports': 'error', 'import/no-internal-modules': 'off', diff --git a/index.js b/index.js index a494e61..3bcbced 100644 --- a/index.js +++ b/index.js @@ -55,6 +55,7 @@ module.exports = { 'init-declarations': 'off', 'line-comment-position': 'off', 'lines-between-class-members': 'off', + 'logical-assignment-operators': 'warn', 'max-classes-per-file': 'off', 'max-depth': ['error', 4], 'max-lines': [ @@ -99,6 +100,7 @@ module.exports = { 'no-empty-character-class': 'error', 'no-empty-function': 'off', // we're all grown ups here... 'no-empty-pattern': 'error', + 'no-empty-static-block': 'error', 'no-eq-null': 'off', 'no-eval': 'error', 'no-ex-assign': 'error', @@ -133,6 +135,7 @@ module.exports = { 'no-nested-ternary': 'off', 'no-new': 'error', 'no-new-func': 'error', + 'no-new-native-nonconstructor': 'error', 'no-new-object': 'error', 'no-new-symbol': 'error', 'no-new-wrappers': 'error', diff --git a/jsx-a11y.js b/jsx-a11y.js index 77b8aa4..37cfc15 100644 --- a/jsx-a11y.js +++ b/jsx-a11y.js @@ -17,6 +17,7 @@ module.exports = { rules: { 'jsx-a11y/accessible-emoji': 'error', 'jsx-a11y/alt-text': 'warn', + 'jsx-a11y/anchor-ambiguous-text': 'off', 'jsx-a11y/anchor-has-content': 'error', 'jsx-a11y/anchor-is-valid': 'error', 'jsx-a11y/aria-activedescendant-has-tabindex': 'error', @@ -37,6 +38,7 @@ module.exports = { 'jsx-a11y/media-has-caption': 'warn', 'jsx-a11y/mouse-events-have-key-events': 'error', 'jsx-a11y/no-access-key': 'error', + 'jsx-a11y/no-aria-hidden-on-focusable': 'error', 'jsx-a11y/no-autofocus': 'off', // I know what I'm doing... I think... 'jsx-a11y/no-distracting-elements': 'error', 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn', @@ -46,6 +48,7 @@ module.exports = { 'jsx-a11y/no-onchange': 'off', 'jsx-a11y/no-redundant-roles': 'error', 'jsx-a11y/no-static-element-interactions': 'off', + 'jsx-a11y/prefer-tag-over-role': 'error', 'jsx-a11y/role-has-required-aria-props': 'error', 'jsx-a11y/role-supports-aria-props': 'error', 'jsx-a11y/scope': 'error', diff --git a/package.json b/package.json index e7d3fbf..f422f3a 100644 --- a/package.json +++ b/package.json @@ -41,32 +41,32 @@ "dist" ], "dependencies": { - "@rushstack/eslint-patch": "^1.1.4", - "@typescript-eslint/eslint-plugin": "^5.36.0", - "@typescript-eslint/parser": "^5.36.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-import": "^2.26.0", + "@rushstack/eslint-patch": "^1.2.0", + "@typescript-eslint/eslint-plugin": "^5.49.0", + "@typescript-eslint/parser": "^5.49.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-import": "^2.27.5", "eslint-plugin-jest": "^26.9.0", - "eslint-plugin-jest-dom": "^4.0.2", - "eslint-plugin-jsx-a11y": "^6.6.1", - "eslint-plugin-react": "^7.31.1", + "eslint-plugin-jest-dom": "^4.0.3", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.32.1", "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-testing-library": "^5.6.0", + "eslint-plugin-testing-library": "^5.10.0", "read-pkg-up": "^7.0.1", - "semver": "^7.3.7" + "semver": "^7.3.8" }, "devDependencies": { - "@testing-library/dom": "^8.17.1", + "@testing-library/dom": "^8.20.0", "@testing-library/jest-dom": "^5.16.5", - "eslint": "^8.23.0", + "eslint": "^8.32.0", "eslint-find-rules": "^4.1.0", - "husky": "^8.0.1", + "husky": "^8.0.3", "jest": "^28.1.3", "npm-run-all": "^4.1.5", - "prettier": "2.7.1", + "prettier": "2.8.3", "pretty-quick": "^3.1.3", "react": "^18.2.0", - "typescript": "^4.8.2" + "typescript": "^4.9.4" }, "peerDependencies": { "eslint": "^8.0.0", diff --git a/react.js b/react.js index 30ddd89..835cb48 100644 --- a/react.js +++ b/react.js @@ -102,6 +102,7 @@ module.exports = { 'react/no-is-mounted': 'error', 'react/no-multi-comp': 'off', 'react/no-namespace': 'error', + 'react/no-object-type-as-default-prop': 'error', 'react/no-redundant-should-component-update': 'error', 'react/no-render-return-value': 'error', 'react/no-set-state': 'off', @@ -127,6 +128,7 @@ module.exports = { 'react/require-render-return': 'error', 'react/self-closing-comp': 'error', 'react/sort-comp': 'off', + 'react/sort-default-props': 'off', 'react/sort-prop-types': 'off', 'react/state-in-constructor': 'off', 'react/static-property-placement': 'off', From 59019cc21e8e95eb04341732177023ec84cd8911 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" <me+github@kentcdodds.com> Date: Sat, 28 Jan 2023 10:30:56 -0700 Subject: [PATCH 2/4] Update import.js --- import.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import.js b/import.js index a1813f2..f21dc97 100644 --- a/import.js +++ b/import.js @@ -17,7 +17,7 @@ module.exports = { 'import/ignore': ['node_modules', '.json$', '.(scss|less|css|styl)$'], }, rules: { - 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], + 'import/consistent-type-specifier-style': ['error', 'prefer-inline'], 'import/default': 'error', 'import/dynamic-import-chunkname': 'off', 'import/export': 'error', From 230212604da4220f7bd23f74ed1e02e6344ba144 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" <me+github@kentcdodds.com> Date: Sat, 28 Jan 2023 10:31:02 -0700 Subject: [PATCH 3/4] Update jsx-a11y.js --- jsx-a11y.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsx-a11y.js b/jsx-a11y.js index 37cfc15..50343b1 100644 --- a/jsx-a11y.js +++ b/jsx-a11y.js @@ -17,7 +17,7 @@ module.exports = { rules: { 'jsx-a11y/accessible-emoji': 'error', 'jsx-a11y/alt-text': 'warn', - 'jsx-a11y/anchor-ambiguous-text': 'off', + 'jsx-a11y/anchor-ambiguous-text': 'warn', 'jsx-a11y/anchor-has-content': 'error', 'jsx-a11y/anchor-is-valid': 'error', 'jsx-a11y/aria-activedescendant-has-tabindex': 'error', From 80dafe97e75b7eca2e07a95060dd2363e05414e1 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" <me+github@kentcdodds.com> Date: Sat, 28 Jan 2023 10:31:07 -0700 Subject: [PATCH 4/4] Update react.js --- react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react.js b/react.js index 835cb48..bfa0f0e 100644 --- a/react.js +++ b/react.js @@ -102,7 +102,7 @@ module.exports = { 'react/no-is-mounted': 'error', 'react/no-multi-comp': 'off', 'react/no-namespace': 'error', - 'react/no-object-type-as-default-prop': 'error', + 'react/no-object-type-as-default-prop': 'off', 'react/no-redundant-should-component-update': 'error', 'react/no-render-return-value': 'error', 'react/no-set-state': 'off',