Skip to content

Commit

Permalink
update to ESLint v8
Browse files Browse the repository at this point in the history
Summary:
Changelog: [internal]
- Upgrade ESLint version to the latest
- Upgrade ESLint plugin versions to the latest to ensure compatibility
- Switch from eslint-plugin-flowtype to eslint-plugin-ft-flow
- Updates lint suppressions - all `flowtype/` rules to `ft-flow/`

### `flowtype` vs `ft-flow`

`eslint-plugin-flowtype` is well out of date and no-longer maintained. It's been abandoned by its owner. This means it crashes on ESLint v8.
`eslint-plugin-ft-flow` is a fork of the above and is maintained by the same people that own the `flow-typed` project.

Reviewed By: jacdebug

Differential Revision: D37727177

fbshipit-source-id: 516be42f947fec9c886526c182a608b3311c0b50
  • Loading branch information
bradzacher authored and facebook-github-bot committed Jul 16, 2022
1 parent 9ecd203 commit f3db6cc
Show file tree
Hide file tree
Showing 7 changed files with 856 additions and 747 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ module.exports = {
// These rules are not required with hermes-eslint
'ft-flow/define-flow-type': 0,
'ft-flow/use-flow-type': 0,
'flowtype/define-flow-type': 0,
'flowtype/use-flow-type': 0,
// flow handles this check for us, so it's not required
'no-undef': 0,
},
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config-react-native-community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ module.exports = {
{
files: ['*.js'],
parser: '@babel/eslint-parser',
plugins: ['flowtype'],
plugins: ['ft-flow'],
rules: {
// Flow Plugin
// The following rules are made available via `eslint-plugin-flowtype`
// The following rules are made available via `eslint-plugin-ft-flow`

'flowtype/define-flow-type': 1,
'flowtype/use-flow-type': 1,
'ft-flow/define-flow-type': 1,
'ft-flow/use-flow-type': 1,
},
},
{
Expand Down
20 changes: 10 additions & 10 deletions packages/eslint-config-react-native-community/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
"@babel/core": "^7.14.0",
"@babel/eslint-parser": "^7.18.2",
"@react-native-community/eslint-plugin": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^5.15.0",
"@typescript-eslint/parser": "^5.15.0",
"eslint-config-prettier": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-flowtype": "^8.0.0",
"eslint-plugin-jest": "^25.2.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0"
"eslint-plugin-ft-flow": "^2.0.1",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0"
},
"peerDependencies": {
"eslint": ">=7",
"prettier": ">=2"
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint": "^8.19.0",
"prettier": "^2.4.1"
}
}
Loading

0 comments on commit f3db6cc

Please sign in to comment.