-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
117 lines (117 loc) · 3.58 KB
/
Copy path.eslintrc.js
File metadata and controls
117 lines (117 loc) · 3.58 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
jest: true
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended'
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: false
}
},
plugins: ['prettier'],
rules: {
'prettier/prettier': 'error',
'no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}],
'no-console': 'off',
'prefer-const': 'error',
'no-var': 'error',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-alert': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-duplicate-imports': 'error',
'prefer-template': 'error',
'template-curly-spacing': 'error',
'arrow-spacing': 'error',
'comma-dangle': ['error', 'only-multiline'],
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
'indent': ['error', 2, { SwitchCase: 1 }],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'func-call-spacing': ['error', 'never'],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'keyword-spacing': ['error', { before: true, after: true }],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': ['error', 'always'],
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1 }],
'eol-last': ['error', 'always'],
'linebreak-style': ['error', 'unix'],
'max-len': ['error', { code: 100, ignoreUrls: true, ignoreStrings: true }],
'complexity': ['warn', 10],
'max-depth': ['warn', 4],
'max-params': ['warn', 4],
'max-statements': ['warn', 20],
'no-magic-numbers': ['warn', {
ignore: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 32, 64, 100, 1000],
ignoreArrayIndexes: true,
ignoreDefaultValues: true
}],
'no-param-reassign': ['error', { props: false }],
'prefer-arrow-callback': 'error',
'arrow-body-style': ['error', 'as-needed'],
'no-useless-constructor': 'error',
'no-useless-return': 'error',
'prefer-destructuring': ['error', {
VariableDeclarator: { array: false, object: true },
AssignmentExpression: { array: false, object: false }
}],
'object-shorthand': 'error',
'prefer-spread': 'error'
},
overrides: [
{
files: ['*.test.js', '**/__tests__/**/*.js'],
env: {
jest: true
},
rules: {
'no-magic-numbers': 'off',
'max-statements': 'off'
}
},
{
files: ['webpack.config.js', 'babel.config.js', 'jest.config.js'],
env: {
node: true
}
}
],
settings: {
'import/resolver': {
alias: {
map: [
['@', './src'],
['@engine', './src/engine.js'],
['@renderer', './src/renderer.js'],
['@scene', './src/scene.js'],
['@input', './src/input.js'],
['@physics', './src/physics.js'],
['@audio', './src/audio.js'],
['@ai', './src/ai.js'],
['@network', './src/network.js'],
['@ui', './src/ui.js'],
['@animation', './src/animation-system.js']
],
extensions: ['.js', '.json']
}
}
}
};