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

jest/unbound-method throws in CRA due to not being properly set up #760

Open
ljosberinn opened this issue Apr 26, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@ljosberinn
Copy link
Owner

Error: Error while loading rule 'jest/unbound-method': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.

const { createConfig } = require('eslint-config-galex/dist/createConfig');
const { getDependencies } = require('eslint-config-galex/dist/getDependencies');
const {
  createReactOverride,
} = require('eslint-config-galex/dist/overrides/react');
const {
  createTypeScriptOverride,
} = require('eslint-config-galex/dist/overrides/typescript');
const packageJson = require('./package.json');

module.exports = createConfig({
  overrides: [
    createReactOverride({
      ...getDependencies(),
      rules: {
        'import/no-default-export': 'off',
        'no-console': 'off',
        'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0 }],
        'react/function-component-definition': 'off',
        'react/jsx-no-useless-fragment': 'off',
        'react/no-array-index-key': 'off',
        'sonarjs/no-duplicate-string': 'off',
        'unicorn/prefer-spread': 'off',
      },
    }),
    createTypeScriptOverride({
      react: {
        hasReact: true,
      },
      rules: {
        '@typescript-eslint/consistent-type-definitions': 'off',
      },
      typescript: {
        hasTypeScript: true,
        version: packageJson.dependencies.typescript,
      },
    }),
  ],
});

this is within createTestOverrides which adds jest/unbound-method given typescript presence, but it also needs parserOptions extended if its active

@ljosberinn ljosberinn self-assigned this Apr 26, 2023
@ljosberinn ljosberinn added the bug Something isn't working label Apr 26, 2023
@ljosberinn ljosberinn mentioned this issue May 10, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant