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
This commit is contained in:
Brad Zacher 2022-07-16 01:41:27 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 9ecd203eec
Коммит f3db6cc527
7 изменённых файлов: 870 добавлений и 761 удалений

Просмотреть файл

@ -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,
},

Просмотреть файл

@ -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,
},
},
{

Просмотреть файл

@ -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"
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -20,20 +20,18 @@
"clang-format": "^1.2.4",
"connect": "^3.6.5",
"coveralls": "^3.1.1",
"eslint": "^7.32.0",
"eslint-config-fb-strict": "^26.0.0",
"eslint-config-fbjs": "^3.1.1",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-flowtype": "^7.0.0",
"eslint-plugin-jest": "^25.2.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"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-relay": "^1.8.2",
"eslint-plugin-ft-flow": "^2.0.1",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-jsx-a11y": "^6.6.0",
"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",
"eslint-plugin-relay": "^1.8.3",
"flow-bin": "^0.182.0",
"inquirer": "^7.1.0",
"jest": "^26.6.3",

Просмотреть файл

@ -18,7 +18,7 @@
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"eslint": "^8.19.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.71.3",
"react-test-renderer": "18.1.0"

745
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу