From 26b62803df6d738b07443def4718fad41d4f3b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Sat, 18 Dec 2021 11:28:26 -0600 Subject: [PATCH] Eslint config: convert all `NEXT_VERSION_ERROR` to `ERROR` In preparation for next major version. --- src/eslint-config-adeira/CHANGELOG.md | 1 + .../__snapshots__/index.test.js.snap | 191 ++++-------------- .../__snapshots__/presets.test.js.snap | 104 +++++----- src/eslint-config-adeira/src/presets/base.js | 12 +- .../src/presets/flowtype.js | 14 +- src/eslint-config-adeira/src/presets/jest.js | 8 +- src/eslint-config-adeira/src/presets/next.js | 38 ++-- src/eslint-config-adeira/src/presets/react.js | 42 ++-- 8 files changed, 145 insertions(+), 265 deletions(-) diff --git a/src/eslint-config-adeira/CHANGELOG.md b/src/eslint-config-adeira/CHANGELOG.md index 7c9fe4e769..9171c6bc2b 100644 --- a/src/eslint-config-adeira/CHANGELOG.md +++ b/src/eslint-config-adeira/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- Many rules that were showing warnings in normal mode but errors in strict mode were converted to normal errors (so there is no difference between normal and strict mode). The best way how to migrate is to temporarily switch to the strict mode and address all the errors before upgrading to this major version. - New rule enabled: `fb-flow/use-indexed-access-type` (warnings or errors in strict mode), for more information visit: https://flow.org/en/docs/types/indexed-access/. - We internally switched from [`eslint-plugin-flowtype`](https://github.com/gajus/eslint-plugin-flowtype/tree/449cb99f1b6d3bbbb66f5be55f497667f5b2cb31) to [`eslint-plugin-ft-flow`](https://github.com/flow-typed/eslint-plugin-ft-flow/tree/820e631ce491cdf45821744d4e29f348cf776392) which contains the same set of rules but should be more up to date and maintained. We are going to enable additional rules later. There is a possible minor breaking change (with very simple fix) when suppressing the rules manually, for example: diff --git a/src/eslint-config-adeira/__tests__/__snapshots__/index.test.js.snap b/src/eslint-config-adeira/__tests__/__snapshots__/index.test.js.snap index 9c7d526d02..2588e8be29 100644 --- a/src/eslint-config-adeira/__tests__/__snapshots__/index.test.js.snap +++ b/src/eslint-config-adeira/__tests__/__snapshots__/index.test.js.snap @@ -24,33 +24,33 @@ Object { ], "rules": Object { "testing-library/await-async-query": 0, - "testing-library/await-async-utils": 1, + "testing-library/await-async-utils": 2, "testing-library/await-fire-event": 0, "testing-library/consistent-data-testid": 0, - "testing-library/no-await-sync-events": 1, - "testing-library/no-await-sync-query": 1, + "testing-library/no-await-sync-events": 2, + "testing-library/no-await-sync-query": 2, "testing-library/no-container": 0, - "testing-library/no-debugging-utils": 1, + "testing-library/no-debugging-utils": 2, "testing-library/no-dom-import": Array [ - 1, + 2, "react", ], "testing-library/no-manual-cleanup": 0, "testing-library/no-node-access": 0, - "testing-library/no-promise-in-fire-event": 1, + "testing-library/no-promise-in-fire-event": 2, "testing-library/no-render-in-setup": 0, - "testing-library/no-unnecessary-act": 1, - "testing-library/no-wait-for-empty-callback": 1, - "testing-library/no-wait-for-multiple-assertions": 1, - "testing-library/no-wait-for-side-effects": 1, - "testing-library/no-wait-for-snapshot": 1, - "testing-library/prefer-explicit-assert": 1, - "testing-library/prefer-find-by": 1, - "testing-library/prefer-presence-queries": 1, - "testing-library/prefer-query-by-disappearance": 1, + "testing-library/no-unnecessary-act": 2, + "testing-library/no-wait-for-empty-callback": 2, + "testing-library/no-wait-for-multiple-assertions": 2, + "testing-library/no-wait-for-side-effects": 2, + "testing-library/no-wait-for-snapshot": 2, + "testing-library/prefer-explicit-assert": 2, + "testing-library/prefer-find-by": 2, + "testing-library/prefer-presence-queries": 2, + "testing-library/prefer-query-by-disappearance": 2, "testing-library/prefer-screen-queries": 0, - "testing-library/prefer-user-event": 1, - "testing-library/prefer-wait-for": 1, + "testing-library/prefer-user-event": 2, + "testing-library/prefer-wait-for": 2, "testing-library/render-result-naming-convention": 0, }, }, @@ -162,11 +162,11 @@ Object { "eslint-comments/no-unused-enable": 2, "eslint-comments/no-use": 0, "eslint-comments/require-description": 0, - "fb-flow/flow-enums-default-if-possible": 1, - "fb-flow/no-flow-enums-object-mapping": 1, - "fb-flow/use-exact-by-default-object-type": 1, - "fb-flow/use-flow-enums": 1, - "fb-flow/use-indexed-access-type": 1, + "fb-flow/flow-enums-default-if-possible": 2, + "fb-flow/no-flow-enums-object-mapping": 2, + "fb-flow/use-exact-by-default-object-type": 2, + "fb-flow/use-flow-enums": 2, + "fb-flow/use-indexed-access-type": 2, "flowtype/boolean-style": "off", "flowtype/delimiter-dangle": "off", "flowtype/generic-spacing": "off", @@ -194,7 +194,7 @@ Object { "always", ], "ft-flow/no-dupe-keys": 2, - "ft-flow/no-duplicate-type-union-intersection-members": 1, + "ft-flow/no-duplicate-type-union-intersection-members": 2, "ft-flow/no-existential-type": 2, "ft-flow/no-flow-fix-me-comments": 0, "ft-flow/no-flow-fix-me-in-strict-files": 0, @@ -330,7 +330,7 @@ Object { "import/no-named-export": 0, "import/no-namespace": 0, "import/no-nodejs-modules": 0, - "import/no-relative-packages": 1, + "import/no-relative-packages": 2, "import/no-relative-parent-imports": 0, "import/no-restricted-paths": 0, "import/no-self-import": 2, @@ -371,7 +371,7 @@ Object { "jest/consistent-test-it": 0, "jest/expect-expect": 0, "jest/max-nested-describe": Array [ - 1, + 2, Object { "max": 5, }, @@ -400,12 +400,12 @@ Object { "jest/no-test-return-statement": 2, "jest/prefer-called-with": 2, "jest/prefer-expect-assertions": 0, - "jest/prefer-expect-resolves": 1, + "jest/prefer-expect-resolves": 2, "jest/prefer-hooks-on-top": 2, "jest/prefer-lowercase-title": 0, "jest/prefer-spy-on": 0, "jest/prefer-strict-equal": 0, - "jest/prefer-to-be": 1, + "jest/prefer-to-be": 2, "jest/prefer-to-contain": 2, "jest/prefer-to-have-length": 2, "jest/prefer-todo": 2, @@ -506,7 +506,7 @@ Object { "no-bitwise": 2, "no-buffer-constructor": 1, "no-caller": 2, - "no-case-declarations": 1, + "no-case-declarations": 2, "no-class-assign": 1, "no-comma-dangle": "off", "no-compare-neg-zero": 2, @@ -551,7 +551,7 @@ Object { "no-extra-label": 2, "no-extra-parens": "off", "no-extra-semi": "off", - "no-fallthrough": 1, + "no-fallthrough": 2, "no-floating-decimal": "off", "no-func-assign": 2, "no-global-assign": Array [ @@ -622,7 +622,7 @@ Object { "no-proto": 2, "no-prototype-builtins": 2, "no-redeclare": Array [ - 1, + 2, Object { "builtinGlobals": true, }, @@ -887,7 +887,7 @@ Object { "react/no-access-state-in-setstate": 2, "react/no-adjacent-inline-elements": 0, "react/no-array-index-key": 0, - "react/no-arrow-function-lifecycle": 1, + "react/no-arrow-function-lifecycle": 2, "react/no-children-prop": 0, "react/no-danger": 0, "react/no-danger-with-children": 2, @@ -896,7 +896,7 @@ Object { "react/no-did-update-set-state": 2, "react/no-direct-mutation-state": 2, "react/no-find-dom-node": 2, - "react/no-invalid-html-attribute": 1, + "react/no-invalid-html-attribute": 2, "react/no-is-mounted": 2, "react/no-multi-comp": Array [ 2, @@ -920,7 +920,7 @@ Object { "allowAsProps": true, }, ], - "react/no-unused-class-component-methods": 1, + "react/no-unused-class-component-methods": 2, "react/no-unused-prop-types": 0, "react/no-unused-state": 0, "react/no-will-update-set-state": 0, @@ -1043,7 +1043,7 @@ Object { "switch-colon-spacing": "off", "sx/no-concatenated-classes": 2, "sx/no-unused-stylesheet": 2, - "sx/use-logical-properties": 1, + "sx/use-logical-properties": 2, "sx/valid-usage": 2, "symbol-description": 2, "template-curly-spacing": "off", @@ -1124,126 +1124,5 @@ Object { exports[`rules snapshot: diff of stable and strict rules 1`] = ` Snapshot Diff: -- Value for stable rules -+ Value for STRICT rules - -@@ --- --- @@ - "testing-library/await-async-query": 0, -- "testing-library/await-async-utils": 1, -+ "testing-library/await-async-utils": 2, - "testing-library/await-fire-event": 0, - "testing-library/consistent-data-testid": 0, -- "testing-library/no-await-sync-events": 1, -- "testing-library/no-await-sync-query": 1, -+ "testing-library/no-await-sync-events": 2, -+ "testing-library/no-await-sync-query": 2, - "testing-library/no-container": 0, -- "testing-library/no-debugging-utils": 1, -+ "testing-library/no-debugging-utils": 2, - "testing-library/no-dom-import": Array [ -- 1, -+ 2, - "react", -@@ --- --- @@ - "testing-library/no-node-access": 0, -- "testing-library/no-promise-in-fire-event": 1, -+ "testing-library/no-promise-in-fire-event": 2, - "testing-library/no-render-in-setup": 0, -- "testing-library/no-unnecessary-act": 1, -- "testing-library/no-wait-for-empty-callback": 1, -- "testing-library/no-wait-for-multiple-assertions": 1, -- "testing-library/no-wait-for-side-effects": 1, -- "testing-library/no-wait-for-snapshot": 1, -- "testing-library/prefer-explicit-assert": 1, -- "testing-library/prefer-find-by": 1, -- "testing-library/prefer-presence-queries": 1, -- "testing-library/prefer-query-by-disappearance": 1, -+ "testing-library/no-unnecessary-act": 2, -+ "testing-library/no-wait-for-empty-callback": 2, -+ "testing-library/no-wait-for-multiple-assertions": 2, -+ "testing-library/no-wait-for-side-effects": 2, -+ "testing-library/no-wait-for-snapshot": 2, -+ "testing-library/prefer-explicit-assert": 2, -+ "testing-library/prefer-find-by": 2, -+ "testing-library/prefer-presence-queries": 2, -+ "testing-library/prefer-query-by-disappearance": 2, - "testing-library/prefer-screen-queries": 0, -- "testing-library/prefer-user-event": 1, -- "testing-library/prefer-wait-for": 1, -+ "testing-library/prefer-user-event": 2, -+ "testing-library/prefer-wait-for": 2, - "testing-library/render-result-naming-convention": 0, -@@ --- --- @@ - "eslint-comments/require-description": 0, -- "fb-flow/flow-enums-default-if-possible": 1, -- "fb-flow/no-flow-enums-object-mapping": 1, -- "fb-flow/use-exact-by-default-object-type": 1, -- "fb-flow/use-flow-enums": 1, -- "fb-flow/use-indexed-access-type": 1, -+ "fb-flow/flow-enums-default-if-possible": 2, -+ "fb-flow/no-flow-enums-object-mapping": 2, -+ "fb-flow/use-exact-by-default-object-type": 2, -+ "fb-flow/use-flow-enums": 2, -+ "fb-flow/use-indexed-access-type": 2, - "flowtype/boolean-style": "off", -@@ --- --- @@ - "ft-flow/no-dupe-keys": 2, -- "ft-flow/no-duplicate-type-union-intersection-members": 1, -+ "ft-flow/no-duplicate-type-union-intersection-members": 2, - "ft-flow/no-existential-type": 2, -@@ --- --- @@ - "import/no-nodejs-modules": 0, -- "import/no-relative-packages": 1, -+ "import/no-relative-packages": 2, - "import/no-relative-parent-imports": 0, -@@ --- --- @@ - "jest/max-nested-describe": Array [ -- 1, -+ 2, - Object { -@@ --- --- @@ - "jest/prefer-expect-assertions": 0, -- "jest/prefer-expect-resolves": 1, -+ "jest/prefer-expect-resolves": 2, - "jest/prefer-hooks-on-top": 2, -@@ --- --- @@ - "jest/prefer-strict-equal": 0, -- "jest/prefer-to-be": 1, -+ "jest/prefer-to-be": 2, - "jest/prefer-to-contain": 2, -@@ --- --- @@ - "no-caller": 2, -- "no-case-declarations": 1, -+ "no-case-declarations": 2, - "no-class-assign": 1, -@@ --- --- @@ - "no-extra-semi": "off", -- "no-fallthrough": 1, -+ "no-fallthrough": 2, - "no-floating-decimal": "off", -@@ --- --- @@ - "no-redeclare": Array [ -- 1, -+ 2, - Object { -@@ --- --- @@ - "react/no-array-index-key": 0, -- "react/no-arrow-function-lifecycle": 1, -+ "react/no-arrow-function-lifecycle": 2, - "react/no-children-prop": 0, -@@ --- --- @@ - "react/no-find-dom-node": 2, -- "react/no-invalid-html-attribute": 1, -+ "react/no-invalid-html-attribute": 2, - "react/no-is-mounted": 2, -@@ --- --- @@ - ], -- "react/no-unused-class-component-methods": 1, -+ "react/no-unused-class-component-methods": 2, - "react/no-unused-prop-types": 0, -@@ --- --- @@ - "sx/no-unused-stylesheet": 2, -- "sx/use-logical-properties": 1, -+ "sx/use-logical-properties": 2, - "sx/valid-usage": 2, +Compared values have no visual difference. `; diff --git a/src/eslint-config-adeira/__tests__/__snapshots__/presets.test.js.snap b/src/eslint-config-adeira/__tests__/__snapshots__/presets.test.js.snap index a8b0d58266..453eba2cd8 100644 --- a/src/eslint-config-adeira/__tests__/__snapshots__/presets.test.js.snap +++ b/src/eslint-config-adeira/__tests__/__snapshots__/presets.test.js.snap @@ -157,7 +157,7 @@ Object { "import/no-named-export": 0, "import/no-namespace": 0, "import/no-nodejs-modules": 0, - "import/no-relative-packages": 1, + "import/no-relative-packages": 2, "import/no-relative-parent-imports": 0, "import/no-restricted-paths": 0, "import/no-self-import": 2, @@ -226,7 +226,7 @@ Object { "no-bitwise": 2, "no-buffer-constructor": 1, "no-caller": 2, - "no-case-declarations": 1, + "no-case-declarations": 2, "no-class-assign": 1, "no-compare-neg-zero": 2, "no-cond-assign": 2, @@ -267,7 +267,7 @@ Object { "no-extra-bind": 1, "no-extra-boolean-cast": 2, "no-extra-label": 2, - "no-fallthrough": 1, + "no-fallthrough": 2, "no-func-assign": 2, "no-global-assign": Array [ 2, @@ -333,7 +333,7 @@ Object { "no-proto": 2, "no-prototype-builtins": 2, "no-redeclare": Array [ - 1, + 2, Object { "builtinGlobals": true, }, @@ -515,7 +515,7 @@ Object { "strict": 1, "sx/no-concatenated-classes": 2, "sx/no-unused-stylesheet": 2, - "sx/use-logical-properties": 1, + "sx/use-logical-properties": 2, "sx/valid-usage": 2, "symbol-description": 2, "use-isnan": Array [ @@ -565,11 +565,11 @@ Object { 2, "all", ], - "fb-flow/flow-enums-default-if-possible": 1, - "fb-flow/no-flow-enums-object-mapping": 1, - "fb-flow/use-exact-by-default-object-type": 1, - "fb-flow/use-flow-enums": 1, - "fb-flow/use-indexed-access-type": 1, + "fb-flow/flow-enums-default-if-possible": 2, + "fb-flow/no-flow-enums-object-mapping": 2, + "fb-flow/use-exact-by-default-object-type": 2, + "fb-flow/use-flow-enums": 2, + "fb-flow/use-indexed-access-type": 2, "ft-flow/array-style-complex-type": 0, "ft-flow/array-style-simple-type": 0, "ft-flow/arrow-parens": 0, @@ -585,7 +585,7 @@ Object { "always", ], "ft-flow/no-dupe-keys": 2, - "ft-flow/no-duplicate-type-union-intersection-members": 1, + "ft-flow/no-duplicate-type-union-intersection-members": 2, "ft-flow/no-existential-type": 2, "ft-flow/no-flow-fix-me-comments": 0, "ft-flow/no-flow-fix-me-in-strict-files": 0, @@ -679,7 +679,7 @@ Object { "jest/consistent-test-it": 0, "jest/expect-expect": 0, "jest/max-nested-describe": Array [ - 1, + 2, Object { "max": 5, }, @@ -708,12 +708,12 @@ Object { "jest/no-test-return-statement": 2, "jest/prefer-called-with": 2, "jest/prefer-expect-assertions": 0, - "jest/prefer-expect-resolves": 1, + "jest/prefer-expect-resolves": 2, "jest/prefer-hooks-on-top": 2, "jest/prefer-lowercase-title": 0, "jest/prefer-spy-on": 0, "jest/prefer-strict-equal": 0, - "jest/prefer-to-be": 1, + "jest/prefer-to-be": 2, "jest/prefer-to-contain": 2, "jest/prefer-to-have-length": 2, "jest/prefer-todo": 2, @@ -755,25 +755,25 @@ Object { "eslint-plugin-prettier", ], "rules": Object { - "@next/next/google-font-display": 1, - "@next/next/google-font-preconnect": 1, - "@next/next/inline-script-id": 1, - "@next/next/link-passhref": 1, + "@next/next/google-font-display": 2, + "@next/next/google-font-preconnect": 2, + "@next/next/inline-script-id": 2, + "@next/next/link-passhref": 2, "@next/next/next-script-for-ga": 0, - "@next/next/no-css-tags": 1, - "@next/next/no-document-import-in-page": 1, - "@next/next/no-duplicate-head": 1, - "@next/next/no-head-import-in-document": 1, - "@next/next/no-html-link-for-pages": 1, - "@next/next/no-img-element": 1, - "@next/next/no-page-custom-font": 1, - "@next/next/no-script-in-document": 1, - "@next/next/no-script-in-head": 1, - "@next/next/no-server-import-in-page": 1, - "@next/next/no-sync-scripts": 1, - "@next/next/no-title-in-document-head": 1, - "@next/next/no-typos": 1, - "@next/next/no-unwanted-polyfillio": 1, + "@next/next/no-css-tags": 2, + "@next/next/no-document-import-in-page": 2, + "@next/next/no-duplicate-head": 2, + "@next/next/no-head-import-in-document": 2, + "@next/next/no-html-link-for-pages": 2, + "@next/next/no-img-element": 2, + "@next/next/no-page-custom-font": 2, + "@next/next/no-script-in-document": 2, + "@next/next/no-script-in-head": 2, + "@next/next/no-server-import-in-page": 2, + "@next/next/no-sync-scripts": 2, + "@next/next/no-title-in-document-head": 2, + "@next/next/no-typos": 2, + "@next/next/no-unwanted-polyfillio": 2, "curly": Array [ 2, "all", @@ -810,33 +810,33 @@ Object { ], "rules": Object { "testing-library/await-async-query": 0, - "testing-library/await-async-utils": 1, + "testing-library/await-async-utils": 2, "testing-library/await-fire-event": 0, "testing-library/consistent-data-testid": 0, - "testing-library/no-await-sync-events": 1, - "testing-library/no-await-sync-query": 1, + "testing-library/no-await-sync-events": 2, + "testing-library/no-await-sync-query": 2, "testing-library/no-container": 0, - "testing-library/no-debugging-utils": 1, + "testing-library/no-debugging-utils": 2, "testing-library/no-dom-import": Array [ - 1, + 2, "react", ], "testing-library/no-manual-cleanup": 0, "testing-library/no-node-access": 0, - "testing-library/no-promise-in-fire-event": 1, + "testing-library/no-promise-in-fire-event": 2, "testing-library/no-render-in-setup": 0, - "testing-library/no-unnecessary-act": 1, - "testing-library/no-wait-for-empty-callback": 1, - "testing-library/no-wait-for-multiple-assertions": 1, - "testing-library/no-wait-for-side-effects": 1, - "testing-library/no-wait-for-snapshot": 1, - "testing-library/prefer-explicit-assert": 1, - "testing-library/prefer-find-by": 1, - "testing-library/prefer-presence-queries": 1, - "testing-library/prefer-query-by-disappearance": 1, + "testing-library/no-unnecessary-act": 2, + "testing-library/no-wait-for-empty-callback": 2, + "testing-library/no-wait-for-multiple-assertions": 2, + "testing-library/no-wait-for-side-effects": 2, + "testing-library/no-wait-for-snapshot": 2, + "testing-library/prefer-explicit-assert": 2, + "testing-library/prefer-find-by": 2, + "testing-library/prefer-presence-queries": 2, + "testing-library/prefer-query-by-disappearance": 2, "testing-library/prefer-screen-queries": 0, - "testing-library/prefer-user-event": 1, - "testing-library/prefer-wait-for": 1, + "testing-library/prefer-user-event": 2, + "testing-library/prefer-wait-for": 2, "testing-library/render-result-naming-convention": 0, }, }, @@ -985,7 +985,7 @@ Object { "react/no-access-state-in-setstate": 2, "react/no-adjacent-inline-elements": 0, "react/no-array-index-key": 0, - "react/no-arrow-function-lifecycle": 1, + "react/no-arrow-function-lifecycle": 2, "react/no-children-prop": 0, "react/no-danger": 0, "react/no-danger-with-children": 2, @@ -994,7 +994,7 @@ Object { "react/no-did-update-set-state": 2, "react/no-direct-mutation-state": 2, "react/no-find-dom-node": 2, - "react/no-invalid-html-attribute": 1, + "react/no-invalid-html-attribute": 2, "react/no-is-mounted": 2, "react/no-multi-comp": Array [ 2, @@ -1018,7 +1018,7 @@ Object { "allowAsProps": true, }, ], - "react/no-unused-class-component-methods": 1, + "react/no-unused-class-component-methods": 2, "react/no-unused-prop-types": 0, "react/no-unused-state": 0, "react/no-will-update-set-state": 0, diff --git a/src/eslint-config-adeira/src/presets/base.js b/src/eslint-config-adeira/src/presets/base.js index d6cb4c3e42..a169f374bf 100644 --- a/src/eslint-config-adeira/src/presets/base.js +++ b/src/eslint-config-adeira/src/presets/base.js @@ -1,6 +1,6 @@ // @flow -const { ERROR, NEXT_VERSION_ERROR, OFF, WARN } = require('../constants'); +const { ERROR, OFF, WARN } = require('../constants'); /*:: @@ -78,7 +78,7 @@ module.exports = ({ 'no-alert': WARN, 'no-await-in-loop': WARN, 'no-caller': ERROR, - 'no-case-declarations': NEXT_VERSION_ERROR, + 'no-case-declarations': ERROR, 'no-constructor-return': ERROR, 'no-div-regex': WARN, 'no-else-return': ERROR, @@ -89,7 +89,7 @@ module.exports = ({ 'no-extend-native': WARN, 'no-extra-bind': WARN, 'no-extra-label': ERROR, - 'no-fallthrough': NEXT_VERSION_ERROR, + 'no-fallthrough': ERROR, 'no-global-assign': [ERROR, { exceptions: ['Map', 'Set'] }], 'no-implicit-coercion': [ ERROR, @@ -115,7 +115,7 @@ module.exports = ({ 'no-octal-escape': ERROR, 'no-param-reassign': ERROR, 'no-proto': ERROR, - 'no-redeclare': [NEXT_VERSION_ERROR, { builtinGlobals: true }], + 'no-redeclare': [ERROR, { builtinGlobals: true }], 'no-restricted-exports': OFF, 'no-restricted-properties': OFF, 'no-return-assign': WARN, @@ -331,7 +331,7 @@ module.exports = ({ 'import/no-named-export': OFF, 'import/no-namespace': OFF, 'import/no-nodejs-modules': OFF, - 'import/no-relative-packages': NEXT_VERSION_ERROR, + 'import/no-relative-packages': ERROR, 'import/no-relative-parent-imports': OFF, 'import/no-restricted-paths': OFF, 'import/no-unassigned-import': OFF, @@ -438,7 +438,7 @@ module.exports = ({ // Adeira SX custom rules 'sx/no-concatenated-classes': ERROR, 'sx/no-unused-stylesheet': ERROR, - 'sx/use-logical-properties': NEXT_VERSION_ERROR, + 'sx/use-logical-properties': ERROR, 'sx/valid-usage': ERROR, }, settings: { diff --git a/src/eslint-config-adeira/src/presets/flowtype.js b/src/eslint-config-adeira/src/presets/flowtype.js index 154e5e0c1e..352ee1a795 100644 --- a/src/eslint-config-adeira/src/presets/flowtype.js +++ b/src/eslint-config-adeira/src/presets/flowtype.js @@ -1,6 +1,6 @@ // @flow -const { ERROR, OFF, WARN, NEXT_VERSION_ERROR } = require('../constants'); +const { ERROR, OFF, WARN } = require('../constants'); /*:: @@ -24,7 +24,7 @@ module.exports = ({ 'ft-flow/interface-id-match': OFF, 'ft-flow/newline-after-flow-annotation': [ERROR, 'always'], 'ft-flow/no-dupe-keys': ERROR, - 'ft-flow/no-duplicate-type-union-intersection-members': NEXT_VERSION_ERROR, + 'ft-flow/no-duplicate-type-union-intersection-members': ERROR, 'ft-flow/no-existential-type': ERROR, // https://github.com/facebook/flow/issues/6308 'ft-flow/no-flow-fix-me-comments': OFF, 'ft-flow/no-flow-fix-me-in-strict-files': OFF, // TODO: enable (after fixing our codebase) @@ -76,10 +76,10 @@ module.exports = ({ 'ft-flow/valid-syntax': OFF, // Flow FB: https://github.com/facebook/flow/tree/master/packages/eslint-plugin-fb-flow - 'fb-flow/flow-enums-default-if-possible': NEXT_VERSION_ERROR, - 'fb-flow/no-flow-enums-object-mapping': NEXT_VERSION_ERROR, - 'fb-flow/use-exact-by-default-object-type': NEXT_VERSION_ERROR, // we are using `exact_by_default=true` - 'fb-flow/use-flow-enums': NEXT_VERSION_ERROR, - 'fb-flow/use-indexed-access-type': NEXT_VERSION_ERROR, + 'fb-flow/flow-enums-default-if-possible': ERROR, + 'fb-flow/no-flow-enums-object-mapping': ERROR, + 'fb-flow/use-exact-by-default-object-type': ERROR, // we are using `exact_by_default=true` + 'fb-flow/use-flow-enums': ERROR, + 'fb-flow/use-indexed-access-type': ERROR, }, } /*: EslintConfig */); diff --git a/src/eslint-config-adeira/src/presets/jest.js b/src/eslint-config-adeira/src/presets/jest.js index 05d821ecd7..bcc14d84dd 100644 --- a/src/eslint-config-adeira/src/presets/jest.js +++ b/src/eslint-config-adeira/src/presets/jest.js @@ -1,6 +1,6 @@ // @flow -const { ERROR, NEXT_VERSION_ERROR, OFF } = require('../constants'); +const { ERROR, OFF } = require('../constants'); /*:: @@ -15,7 +15,7 @@ module.exports = ({ 'jest/consistent-test-it': OFF, 'jest/expect-expect': OFF, 'jest/prefer-lowercase-title': OFF, - 'jest/max-nested-describe': [NEXT_VERSION_ERROR, { max: 5 }], + 'jest/max-nested-describe': [ERROR, { max: 5 }], 'jest/no-alias-methods': OFF, 'jest/no-commented-out-tests': OFF, 'jest/no-conditional-expect': OFF, @@ -53,8 +53,8 @@ module.exports = ({ 'jest/valid-expect': ERROR, 'jest/valid-expect-in-promise': ERROR, 'jest/valid-title': ERROR, - 'jest/prefer-expect-resolves': NEXT_VERSION_ERROR, - 'jest/prefer-to-be': NEXT_VERSION_ERROR, + 'jest/prefer-expect-resolves': ERROR, + 'jest/prefer-to-be': ERROR, 'jest/require-hook': OFF, }, } /*: EslintConfig */); diff --git a/src/eslint-config-adeira/src/presets/next.js b/src/eslint-config-adeira/src/presets/next.js index cf01491c59..77e7459a48 100644 --- a/src/eslint-config-adeira/src/presets/next.js +++ b/src/eslint-config-adeira/src/presets/next.js @@ -1,6 +1,6 @@ // @flow -const { NEXT_VERSION_ERROR, OFF } = require('../constants'); +const { ERROR, OFF } = require('../constants'); /*:: @@ -12,24 +12,24 @@ module.exports = ({ plugins: ['@next/eslint-plugin-next'], rules: { // Next.js (https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) - '@next/next/google-font-display': NEXT_VERSION_ERROR, - '@next/next/google-font-preconnect': NEXT_VERSION_ERROR, - '@next/next/inline-script-id': NEXT_VERSION_ERROR, - '@next/next/link-passhref': NEXT_VERSION_ERROR, + '@next/next/google-font-display': ERROR, + '@next/next/google-font-preconnect': ERROR, + '@next/next/inline-script-id': ERROR, + '@next/next/link-passhref': ERROR, '@next/next/next-script-for-ga': OFF, // TODO: https://github.com/vercel/next.js/issues/28635 - '@next/next/no-css-tags': NEXT_VERSION_ERROR, - '@next/next/no-document-import-in-page': NEXT_VERSION_ERROR, - '@next/next/no-duplicate-head': NEXT_VERSION_ERROR, - '@next/next/no-head-import-in-document': NEXT_VERSION_ERROR, - '@next/next/no-html-link-for-pages': NEXT_VERSION_ERROR, - '@next/next/no-img-element': NEXT_VERSION_ERROR, - '@next/next/no-page-custom-font': NEXT_VERSION_ERROR, - '@next/next/no-script-in-document': NEXT_VERSION_ERROR, - '@next/next/no-script-in-head': NEXT_VERSION_ERROR, - '@next/next/no-server-import-in-page': NEXT_VERSION_ERROR, - '@next/next/no-sync-scripts': NEXT_VERSION_ERROR, - '@next/next/no-title-in-document-head': NEXT_VERSION_ERROR, - '@next/next/no-typos': NEXT_VERSION_ERROR, - '@next/next/no-unwanted-polyfillio': NEXT_VERSION_ERROR, + '@next/next/no-css-tags': ERROR, + '@next/next/no-document-import-in-page': ERROR, + '@next/next/no-duplicate-head': ERROR, + '@next/next/no-head-import-in-document': ERROR, + '@next/next/no-html-link-for-pages': ERROR, + '@next/next/no-img-element': ERROR, + '@next/next/no-page-custom-font': ERROR, + '@next/next/no-script-in-document': ERROR, + '@next/next/no-script-in-head': ERROR, + '@next/next/no-server-import-in-page': ERROR, + '@next/next/no-sync-scripts': ERROR, + '@next/next/no-title-in-document-head': ERROR, + '@next/next/no-typos': ERROR, + '@next/next/no-unwanted-polyfillio': ERROR, }, } /*: EslintConfig */); diff --git a/src/eslint-config-adeira/src/presets/react.js b/src/eslint-config-adeira/src/presets/react.js index 292639b647..8721c22ad2 100644 --- a/src/eslint-config-adeira/src/presets/react.js +++ b/src/eslint-config-adeira/src/presets/react.js @@ -1,6 +1,6 @@ // @flow -const { ERROR, OFF, WARN, NEXT_VERSION_ERROR } = require('../constants'); +const { ERROR, OFF, WARN } = require('../constants'); const detectReactVersion = require('../detectReactVersion'); /*:: @@ -69,7 +69,7 @@ module.exports = ({ 'react/jsx-uses-vars': ERROR, 'react/no-access-state-in-setstate': ERROR, 'react/no-array-index-key': OFF, - 'react/no-arrow-function-lifecycle': NEXT_VERSION_ERROR, + 'react/no-arrow-function-lifecycle': ERROR, 'react/no-children-prop': OFF, 'react/no-danger': OFF, 'react/no-danger-with-children': ERROR, @@ -78,7 +78,7 @@ module.exports = ({ 'react/no-did-update-set-state': ERROR, 'react/no-direct-mutation-state': ERROR, 'react/no-find-dom-node': ERROR, - 'react/no-invalid-html-attribute': NEXT_VERSION_ERROR, + 'react/no-invalid-html-attribute': ERROR, 'react/no-is-mounted': ERROR, 'react/no-multi-comp': [ERROR, { ignoreStateless: true }], 'react/no-namespace': OFF, // complains about `` and similar @@ -92,7 +92,7 @@ module.exports = ({ 'react/no-unknown-property': ERROR, 'react/no-unsafe': OFF, 'react/no-unstable-nested-components': [ERROR, { allowAsProps: true }], - 'react/no-unused-class-component-methods': NEXT_VERSION_ERROR, + 'react/no-unused-class-component-methods': ERROR, 'react/no-unused-prop-types': OFF, 'react/no-unused-state': OFF, // Enable when they fix this issue: https://github.com/yannickcr/eslint-plugin-react/issues/1910 'react/no-will-update-set-state': OFF, @@ -221,30 +221,30 @@ module.exports = ({ files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], rules: { 'testing-library/await-async-query': OFF, // TODO: seems to be broken for some `findAllByProps` in our codebase - 'testing-library/await-async-utils': NEXT_VERSION_ERROR, + 'testing-library/await-async-utils': ERROR, 'testing-library/await-fire-event': OFF, // Vue only (https://github.com/testing-library/eslint-plugin-testing-library#supported-rules) 'testing-library/consistent-data-testid': OFF, - 'testing-library/no-await-sync-events': NEXT_VERSION_ERROR, - 'testing-library/no-await-sync-query': NEXT_VERSION_ERROR, + 'testing-library/no-await-sync-events': ERROR, + 'testing-library/no-await-sync-query': ERROR, 'testing-library/no-container': OFF, - 'testing-library/no-debugging-utils': NEXT_VERSION_ERROR, - 'testing-library/no-dom-import': [NEXT_VERSION_ERROR, 'react'], + 'testing-library/no-debugging-utils': ERROR, + 'testing-library/no-dom-import': [ERROR, 'react'], 'testing-library/no-manual-cleanup': OFF, 'testing-library/no-node-access': OFF, - 'testing-library/no-promise-in-fire-event': NEXT_VERSION_ERROR, + 'testing-library/no-promise-in-fire-event': ERROR, 'testing-library/no-render-in-setup': OFF, - 'testing-library/no-unnecessary-act': NEXT_VERSION_ERROR, - 'testing-library/no-wait-for-empty-callback': NEXT_VERSION_ERROR, - 'testing-library/no-wait-for-multiple-assertions': NEXT_VERSION_ERROR, - 'testing-library/no-wait-for-side-effects': NEXT_VERSION_ERROR, - 'testing-library/no-wait-for-snapshot': NEXT_VERSION_ERROR, - 'testing-library/prefer-explicit-assert': NEXT_VERSION_ERROR, - 'testing-library/prefer-find-by': NEXT_VERSION_ERROR, - 'testing-library/prefer-presence-queries': NEXT_VERSION_ERROR, - 'testing-library/prefer-query-by-disappearance': NEXT_VERSION_ERROR, + 'testing-library/no-unnecessary-act': ERROR, + 'testing-library/no-wait-for-empty-callback': ERROR, + 'testing-library/no-wait-for-multiple-assertions': ERROR, + 'testing-library/no-wait-for-side-effects': ERROR, + 'testing-library/no-wait-for-snapshot': ERROR, + 'testing-library/prefer-explicit-assert': ERROR, + 'testing-library/prefer-find-by': ERROR, + 'testing-library/prefer-presence-queries': ERROR, + 'testing-library/prefer-query-by-disappearance': ERROR, 'testing-library/prefer-screen-queries': OFF, // TODO: NEXT_VERSION_ERROR (?) - 'testing-library/prefer-user-event': NEXT_VERSION_ERROR, - 'testing-library/prefer-wait-for': NEXT_VERSION_ERROR, + 'testing-library/prefer-user-event': ERROR, + 'testing-library/prefer-wait-for': ERROR, 'testing-library/render-result-naming-convention': OFF, }, },