Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant