-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy patheslint.config.js
More file actions
65 lines (62 loc) · 2.25 KB
/
eslint.config.js
File metadata and controls
65 lines (62 loc) · 2.25 KB
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
import reactCompiler from 'eslint-plugin-react-compiler';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';
import i18next from 'eslint-plugin-i18next';
import prettierConfig from 'eslint-config-prettier';
import prettierPluginConfig from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import { defineConfig } from 'eslint/config';
export default defineConfig([
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
hooksPlugin.configs.recommended,
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
prettierConfig,
prettierPluginConfig,
{
settings: {
react: {
version: 'detect',
},
},
languageOptions: {
globals: { ...globals.browser },
parser: tsParser,
parserOptions: { ecmaFeatures: { jsx: true } },
},
files: ['src/**/*.{js,ts,jsx,tsx}', 'scripts/**/*.{js,ts,jsx,tsx}'],
ignores: ['./**/*.config.{js,ts}'],
plugins: { react, 'react-hooks': hooksPlugin, i18next },
rules: {
...react.configs.recommended.rules,
...hooksPlugin.configs.recommended.rules,
'no-console': ['warn', { allow: ['info', 'warn', 'debug', 'error'] }],
'no-unused-vars': 'off', // base rule must be disabled
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-explicit-any': 'warn',
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'i18next/no-literal-string': ['error', { markupOnly: true }],
},
},
reactCompiler.configs.recommended,
{
files: ['src/**/*.test.{ts,tsx}', 'src/test/**/*.{ts,tsx}'],
rules: {
'i18next/no-literal-string': 'off',
},
},
]);