Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
leahlin01 opened this issue Oct 1, 2024 · 2 comments
Open

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

leahlin01 opened this issue Oct 1, 2024 · 2 comments

Comments

@leahlin01
Copy link

leahlin01 commented Oct 1, 2024

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
Copy link

Did you figure out what is going on?

@ngyikp
Copy link

ngyikp commented Oct 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants