Skip to content

Commit

Permalink
Eslint config: migrate to the new 'flowtype/use-read-only-spread' rule
Browse files Browse the repository at this point in the history
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: gajus/eslint-plugin-flowtype#472

adeira-source-id: bf37c3e6bc3e80b54d97f1c9ac3157139fe76243
  • Loading branch information
mrtnzlml authored and adeira-github-bot committed Apr 6, 2021
1 parent 1f7402f commit 9989592
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 6 additions & 1 deletion __tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ourRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9989592

Please sign in to comment.