From 9989592940948844c77ebbec3b5bcf32a46f936e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Mon, 5 Apr 2021 20:10:04 -0500 Subject: [PATCH] Eslint config: migrate to the new 'flowtype/use-read-only-spread' rule This change finishes a migration from our custom `adeira/flow-use-readonly-spread` rule to the official `flowtype/use-read-only-spread` rule. The behavior should stay unchanged since the underlying code is basically identical. See: https://github.com/gajus/eslint-plugin-flowtype/pull/472 adeira-source-id: bf37c3e6bc3e80b54d97f1c9ac3157139fe76243 --- CHANGELOG.md | 3 ++- __tests__/__snapshots__/index.test.js.snap | 7 ++++++- ourRules.js | 2 +- package.json | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07128c2..9989c98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ # Unreleased - Rule [`react/no-unstable-nested-components`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md) enabled (warnings or errors in strict mode) +- Our custom rule `adeira/flow-use-readonly-spread` has been migrated to official [`flowtype/use-read-only-spread`](https://github.com/gajus/eslint-plugin-flowtype/blob/master/.README/rules/use-read-only-spread.md) while keeping the same behavior (https://github.com/gajus/eslint-plugin-flowtype/pull/472). You might need to adjust your config in case you are overwriting the default config values. # 5.2.0 -- Our custom rule `adeira/no-internal-flow-type` has been migrated to official `flowtype/no-internal-flow-type` (https://github.com/gajus/eslint-plugin-flowtype/pull/469). There should be no changes in behavior. +- Our custom rule `adeira/no-internal-flow-type` has been migrated to official [`flowtype/no-internal-flow-type`](https://github.com/gajus/eslint-plugin-flowtype/blob/998eb5a315666e342fea929a31dbe67568c8231f/.README/rules/no-internal-flow-type.md) while keeping the same behavior (https://github.com/gajus/eslint-plugin-flowtype/pull/469). You might need to adjust your config in case you are overwriting the default config values. - Rule `react/forbid-dom-props` has been temporarily disabled because it causes problems with [FBT](https://facebook.github.io/fbt/) tags, see: https://github.com/adeira/universe/issues/2005 - New accessibility rules enabled: [`jsx-a11y/anchor-has-content`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-has-content.md), [`jsx-a11y/heading-has-content`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/heading-has-content.md) and [`jsx-a11y/no-noninteractive-tabindex`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-noninteractive-tabindex.md) (warnings or errors in strict mode) - Rule [`react/jsx-no-target-blank`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md) enabled (warnings or errors in strict mode) diff --git a/__tests__/__snapshots__/index.test.js.snap b/__tests__/__snapshots__/index.test.js.snap index f55b033..c701de1 100644 --- a/__tests__/__snapshots__/index.test.js.snap +++ b/__tests__/__snapshots__/index.test.js.snap @@ -57,7 +57,6 @@ Object { "setWithoutGet": true, }, ], - "adeira/flow-use-readonly-spread": 0, "adeira/graphql-require-object-description": 1, "adeira/no-duplicate-import-type-import": 2, "adeira/no-invalid-flow-annotations": 2, @@ -182,6 +181,7 @@ Object { "flowtype/type-import-style": 0, "flowtype/union-intersection-spacing": "off", "flowtype/use-flow-type": 1, + "flowtype/use-read-only-spread": 1, "flowtype/valid-syntax": 0, "for-direction": 2, "func-call-spacing": "off", @@ -1032,6 +1032,11 @@ Snapshot Diff: - Value for stable rules + Value for STRICT rules +@@ --- --- @@ + "flowtype/use-flow-type": 1, +- "flowtype/use-read-only-spread": 1, ++ "flowtype/use-read-only-spread": 2, + "flowtype/valid-syntax": 0, @@ --- --- @@ "jsx-a11y/alt-text": 2, - "jsx-a11y/anchor-has-content": 1, diff --git a/ourRules.js b/ourRules.js index 40f8f8f..194a601 100644 --- a/ourRules.js +++ b/ourRules.js @@ -305,6 +305,7 @@ module.exports = ({ 'flowtype/type-id-match': OFF, 'flowtype/type-import-style': OFF, 'flowtype/use-flow-type': WARN, + 'flowtype/use-read-only-spread': NEXT_VERSION_ERROR, 'flowtype/valid-syntax': OFF, // Jest (https://github.com/jest-community/eslint-plugin-jest) @@ -700,7 +701,6 @@ module.exports = ({ 'promise/valid-params': NEXT_VERSION_ERROR, // Adeira custom rules - 'adeira/flow-use-readonly-spread': OFF, // opt-in when needed 'adeira/graphql-require-object-description': WARN, 'adeira/no-duplicate-import-type-import': ERROR, 'adeira/no-invalid-flow-annotations': ERROR, diff --git a/package.json b/package.json index 618598d..08757de 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ "dependencies": { "@babel/runtime": "^7.13.10", "eslint-config-prettier": "^8.1.0", - "eslint-plugin-adeira": "^0.12.0", + "eslint-plugin-adeira": "^0.13.0", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-flowtype": "^5.5.0", + "eslint-plugin-flowtype": "^5.6.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jest": "^24.3.4", "eslint-plugin-jsx-a11y": "^6.4.1",