eslint-plugin-flowtype
eslint-plugin-flowtype copied to clipboard
Value ["boolean"] should NOT have more than 0 items.
got this error when i try to build a create-react-app project env: node v18.18.0 webpack5 error message:
Failed to compile.
[eslint] BaseConfig » plugin:flowtype/recommended:
Configuration for rule "flowtype/boolean-style" is invalid:
Value ["boolean"] should NOT have more than 0 items.
my webpack config code:
plugins: [
// Generates an `index.html` file with the <script> injected.
new ESLintPlugin({
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
context: paths.appSrc,
cache: true,
cwd: paths.appPath,
resolvePluginsRelativeTo: __dirname,
baseConfig: {
extends: [
require.resolve('eslint-config-react-app/base'),
'plugin:flowtype/recommended'
],
plugins: ['flowtype'],
rules: {
"flowtype/define-flow-type": 1,
'flowtype/boolean-style': [
2,
"boolean"
],
},
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-react', '@babel/preset-flow'],
},
},
settings: {
flowtype: {
onlyFilesWithFlowAnnotation: true,
},
},
},
})
].filter(Boolean),
Did you figure out what is going on?
This plugin is broken on ESLint 9 due to this breaking change: https://eslint.org/docs/latest/use/migrate-to-9.0.0#meta-schema-required
There hasn't been any updates to this plugin in 3 years, best to switch to this fork: https://github.com/flow-typed/eslint-plugin-ft-flow