2022-06-26 21:13:52 +02:00
|
|
|
/** @type {import('eslint').Linter.Config} */
|
|
|
|
module.exports = {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: 6,
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
|
|
|
project: './tsconfig.json',
|
|
|
|
tsconfigRootDir: './',
|
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
pragma: 'React',
|
|
|
|
version: 'detect',
|
|
|
|
},
|
|
|
|
linkComponents: [
|
2022-12-05 00:32:15 +01:00
|
|
|
{ name: 'Link', linkAttribute: 'to' },
|
|
|
|
{ name: 'NavLink', linkAttribute: 'to' },
|
2022-06-26 21:13:52 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es6: true,
|
|
|
|
},
|
2022-12-05 00:32:15 +01:00
|
|
|
plugins: ['react', 'react-hooks', 'prettier', '@typescript-eslint'],
|
2022-06-26 21:13:52 +02:00
|
|
|
extends: [
|
|
|
|
// 'standard',
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:react/recommended',
|
2022-11-25 21:25:03 +01:00
|
|
|
'plugin:react/jsx-runtime',
|
2022-06-26 21:13:52 +02:00
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
eqeqeq: 'error',
|
2022-12-05 00:32:15 +01:00
|
|
|
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
|
2022-06-26 21:30:05 +02:00
|
|
|
// TypeScript can infer this significantly better than eslint ever can.
|
|
|
|
'react/prop-types': 0,
|
|
|
|
'react/display-name': 0,
|
2022-11-25 21:25:03 +01:00
|
|
|
'react/no-unknown-property': ['error', {ignore: ['css']}],
|
2022-06-26 21:30:05 +02:00
|
|
|
'@typescript-eslint/no-explicit-any': 0,
|
|
|
|
'@typescript-eslint/no-non-null-assertion': 0,
|
2022-06-26 21:13:52 +02:00
|
|
|
// This setup is required to avoid a spam of errors when running eslint about React being
|
|
|
|
// used before it is defined.
|
|
|
|
//
|
|
|
|
// @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use
|
|
|
|
'no-use-before-define': 0,
|
|
|
|
'@typescript-eslint/no-use-before-define': 'warn',
|
2022-12-05 00:32:15 +01:00
|
|
|
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
|
|
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }],
|
|
|
|
},
|
2022-06-26 21:13:52 +02:00
|
|
|
};
|