generated from FluxonApps/ucu-summer-school-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
77 lines (70 loc) · 2.2 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: {
es2023: true,
browser: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
plugins: ['react-refresh', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json', './tsconfig.node.json'],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
rules: {
/// Prettier
'prettier/prettier': 'warn',
/// Vanilla
'object-shorthand': ['warn', 'always'],
'padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: '*', next: 'return' },
],
// TypeScript
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-floating-promises': ['warn', { ignoreVoid: true, ignoreIIFE: true }],
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: { arguments: false, attributes: false } }],
'@typescript-eslint/no-unnecessary-condition': ['warn', { allowConstantLoopConditions: true }],
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-mixed-enums': 'error',
'@typescript-eslint/no-explicit-any': 'off',
/// Import
'import/default': 'off',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
groups: ['unknown', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'import/no-named-as-default-member': 'off',
/// React Refresh
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
ignorePatterns: ['dist', '.eslintrc.cjs'],
};