-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
85 lines (84 loc) · 2.21 KB
/
eslint.config.mjs
File metadata and controls
85 lines (84 loc) · 2.21 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import js from '@eslint/js';
import react from 'eslint-plugin-react';
import babelParser from '@babel/eslint-parser';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import globals from 'globals';
export default [
js.configs.recommended,
{
files: ['src/**/*.{js,jsx}', 'test/**/*.{js,jsx}'],
plugins: {
react,
},
languageOptions: {
parser: babelParser,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
requireConfigFile: false,
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
},
rules: {
'comma-dangle': 'warn',
'quotes': ['warn', 'single'],
'no-undef': 'warn',
'no-extra-semi': 'warn',
'no-console': 'off',
'no-unused-vars': 'warn',
'no-trailing-spaces': ['warn', { 'skipBlankLines': true }],
'no-unreachable': 'warn',
'no-alert': 'off',
'react/jsx-uses-react': 'warn',
'react/jsx-uses-vars': 'warn',
'indent': ['error', 2, { 'SwitchCase': 1 }],
},
},
{
files: ['src/**/*.{ts,tsx}', 'test/**/*.{ts,tsx}'],
plugins: {
'@typescript-eslint': tseslint,
react,
},
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
},
rules: {
// Base ESLint rules
'comma-dangle': 'warn',
'quotes': ['warn', 'single'],
'no-undef': 'warn',
'no-extra-semi': 'warn',
'no-console': 'off',
'no-trailing-spaces': ['warn', { 'skipBlankLines': true }],
'no-unreachable': 'warn',
'no-alert': 'off',
'react/jsx-uses-react': 'warn',
'react/jsx-uses-vars': 'warn',
'indent': ['error', 2, { 'SwitchCase': 1 }],
// TypeScript specific rules
'@typescript-eslint/no-unused-vars': 'warn',
'no-unused-vars': 'off', // Turn off base rule as it conflicts with @typescript-eslint version
},
},
];