Skip to content
Snippets Groups Projects
.eslintrc.js 1.72 KiB
Newer Older
Guilhem CARRON's avatar
Guilhem CARRON committed
  extends: [
    'eslint:recommended',
    'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
Guilhem CARRON's avatar
Guilhem CARRON committed
    'plugin:react-hooks/recommended',
Bastien DUMONT's avatar
Bastien DUMONT committed
  ],
  parser: '@typescript-eslint/parser', // Specifies the ESLint parser
Bastien DUMONT's avatar
Bastien DUMONT committed
  plugins: ['@typescript-eslint', 'react', 'react-hooks'],
  parserOptions: {
    ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
    sourceType: 'module', // Allows for the use of imports
    ecmaFeatures: {
      jsx: true, // Allows for the parsing of JSX
    },
    tsconfigRootDir: __dirname,
    project: './tsconfig.json',
  },
  root: true,
Bastien DUMONT's avatar
Bastien DUMONT committed
  overrides: [
    {
Bastien DUMONT's avatar
Bastien DUMONT committed
      extends: [
        'plugin:@typescript-eslint/recommended',
        'plugin:@typescript-eslint/stylistic-type-checked',
Bastien DUMONT's avatar
Bastien DUMONT committed
      ],
      rules: {
        '@typescript-eslint/explicit-function-return-type': 'off',
        '@typescript-eslint/no-unused-vars': 'warn',
        '@typescript-eslint/no-explicit-any': 'warn',
        '@typescript-eslint/prefer-optional-chain': 'warn',
        '@typescript-eslint/prefer-as-const': 'error',
        '@typescript-eslint/await-thenable': 'error',
        '@typescript-eslint/no-var-requires': 'off',

        '@typescript-eslint/no-empty-function': 'off', // fixes a build error
Bastien DUMONT's avatar
Bastien DUMONT committed
      },
    },
Guilhem CARRON's avatar
Guilhem CARRON committed
  ],
Guilhem CARRON's avatar
Guilhem CARRON committed
    // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
    'react/react-in-jsx-scope': 'off',
    'react/prop-types': 'warn',
Bastien DUMONT's avatar
Bastien DUMONT committed
    'react/self-closing-comp': 'warn',
Guilhem CARRON's avatar
Guilhem CARRON committed
  },
  settings: {
    react: {
      version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
    },