forked from react-querybuilder/react-querybuilder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
73 lines (71 loc) · 2.34 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { fixupConfigRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import eslint from '@eslint/js';
import tseslintParser from '@typescript-eslint/parser';
import eslintPluginReact from 'eslint-plugin-react';
import eslintPluginReactCompiler from 'eslint-plugin-react-compiler';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import tseslint from 'typescript-eslint';
const compat = new FlatCompat();
export default [
{
ignores: ['**/dist/', '**/*Parser.js'],
},
...fixupConfigRules(compat.extends('plugin:react-hooks/recommended')),
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintPluginReact.configs.flat.recommended,
eslintPluginUnicorn.configs['flat/recommended'],
{
plugins: {
'react-compiler': eslintPluginReactCompiler,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
parser: tseslintParser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'react/display-name': 'off',
'react/jsx-key': ['warn', { checkKeyMustBeforeSpread: true }],
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-unstable-nested-components': 'error',
'react-compiler/react-compiler': 'error',
'unicorn/catch-error-name': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }],
'unicorn/prefer-global-this': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/consistent-existence-index-check': 'off',
},
},
];