-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.js
More file actions
83 lines (80 loc) · 2.14 KB
/
eslint.config.js
File metadata and controls
83 lines (80 loc) · 2.14 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
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettierPlugin from 'eslint-plugin-prettier';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import prettier from 'eslint-plugin-prettier';
export default [
{
ignores: ['dist/**/*'],
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
'@typescript-eslint': tsPlugin,
prettier: prettierPlugin,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
prettier: prettier,
},
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
// Browser globals
window: true,
document: true,
navigator: true,
console: true,
URL: true,
TextDecoder: true,
crypto: true,
self: true,
structuredClone: true,
ReadableStream: true,
// Node.js globals
process: true,
Buffer: true,
__dirname: true,
module: true,
require: true,
exports: true,
// ES2022 globals
Promise: true,
Set: true,
Map: true,
WeakMap: true,
WeakSet: true,
Proxy: true,
Reflect: true,
globalThis: true,
},
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-this-alias': 'off',
'no-prototype-builtins': 'off',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-useless-escape': 'off',
'no-cond-assign': ['error', 'except-parens'],
'no-func-assign': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
},
];