Skip to content

Commit

Permalink
Eslint config: convert all NEXT_VERSION_ERROR to ERROR
Browse files Browse the repository at this point in the history
In preparation for next major version.
  • Loading branch information
mrtnzlml committed Dec 18, 2021
1 parent 729591a commit 26b6280
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 265 deletions.
1 change: 1 addition & 0 deletions src/eslint-config-adeira/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
191 changes: 35 additions & 156 deletions src/eslint-config-adeira/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -371,7 +371,7 @@ Object {
"jest/consistent-test-it": 0,
"jest/expect-expect": 0,
"jest/max-nested-describe": Array [
1,
2,
Object {
"max": 5,
},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 [
Expand Down Expand Up @@ -622,7 +622,7 @@ Object {
"no-proto": 2,
"no-prototype-builtins": 2,
"no-redeclare": Array [
1,
2,
Object {
"builtinGlobals": true,
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
`;
Loading

0 comments on commit 26b6280

Please sign in to comment.