gajus / eslint-plugin-flowtype

Flow type linting rules for ESLint.
Other
1.08k stars 153 forks source link

Value ["boolean"] should NOT have more than 0 items. #527

Open lyzzz0101 opened 1 week ago

lyzzz0101 commented 1 week ago

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),
coltenkrauter commented 3 hours ago

Did you figure out what is going on?