-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
79 lines (79 loc) · 2.57 KB
/
.eslintrc.js
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
/* eslint-env node */
module.exports = {
env: {
node: true,
'jest/globals': true,
},
ignorePatterns: ['node_modules', 'dist', 'coverage', 'jest.config.js'],
extends: [
'eslint:recommended',
'plugin:github/recommended',
'plugin:jsx-a11y/recommended',
'plugin:sonarjs/recommended',
'plugin:unicorn/recommended',
'prettier',
],
plugins: ['github', 'prettier', 'sonarjs'],
overrides: [
{
files: ['*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
globals: {
__dirname: true,
},
rules: {
'unicorn/prefer-module': 'off', // To be able to use __dirname
},
},
],
rules: {
// OFF
'import/no-commonjs': 'off',
'unicorn/prefer-module': 'off',
'i18n-text/no-en': 'off',
'filenames/match-regex': 'off', // handled by unicorn/filename-case
'import/named': 'off', // doesn't work well
'import/no-deprecated': 'off', // takes too long
'import/default': 'off', // takes too long
'import/no-unresolved': 'off', // module bundle is vite
'import/no-named-as-default-member': 'off', // takes too long
'import/no-namespace': 'off', // enable namespaces
// ERRORS
'import/extensions': [
'error',
'never',
{
json: 'always',
css: 'always',
scss: 'always',
svg: 'always',
png: 'always',
jpg: 'always',
jpeg: 'always',
gif: 'always',
webp: 'always',
},
],
'import/no-anonymous-default-export': ['error', { allowNew: true }],
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'unicorn/filename-case': [
'error',
{
cases: {
camelCase: true,
pascalCase: true,
},
ignore: ['^[A-Za-z0-9]+\\.[A-Za-z0-9]+$'], // To allow syntax like TripDAO.ts
},
],
'unicorn/no-null': 'off', // To allow null values, need for some libs
'unicorn/prefer-node-protocol': 'off', // Not really useful and some errors when using it with path like 'constants/paths.ts'
},
};