-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
98 lines (91 loc) · 2.5 KB
/
.eslintrc.js
File metadata and controls
98 lines (91 loc) · 2.5 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
module.exports = {
extends: [
'plugin:import/recommended',
'eslint:recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'script',
},
ignorePatterns: ['.eslintrc.js'],
root: true,
env: {
node: true,
},
globals: {
document: 'readonly',
Promise: 'readonly',
axios: 'readonly',
window: 'readonly',
localStorage: 'readonly',
alert: 'readonly',
confirm: 'readonly',
Razorpay: 'readonly'
},
rules: {
// Basic rules
indent: ['error', 2, {
SwitchCase: 1,
flatTernaryExpressions: false,
}],
'no-unused-vars': 'error',
'prefer-const': 'error',
semi: 'error',
// Quote rules
quotes: ['error', 'single'],
'quote-props': ['error', 'as-needed'],
// Comma rules
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
'comma-style': ['error', 'last'],
// End of file/trailing space rules
'eol-last': ['error', 'always'],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
'no-trailing-spaces': 'error',
// Keyword/operator spacing rules
'keyword-spacing': 'error',
'space-infix-ops': 'error',
// Brace/parenthesis spacing rules
'array-bracket-spacing': ['error', 'never'],
'array-bracket-newline': ['error', 'consistent'],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': 'error',
'brace-style': 'error',
'key-spacing': 'error',
'object-curly-newline': ['error', { consistent: true }],
'object-curly-spacing': ['error', 'always', { objectsInObjects: false }],
'object-shorthand': ['error', 'always', { avoidQuotes: true }],
'padded-blocks': ['error', 'never'],
'space-before-blocks': 'error',
'space-in-parens': ['error', 'never'],
// Newline padding rules
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'export' },
{ blankLine: 'any', prev: 'export', next: 'export' },
{ blankLine: 'always', prev: 'directive', next: '*' },
],
// Import/export rules
'import/exports-last': 'error',
'import/newline-after-import': 'error',
'import/order': ['error', {
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
}],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
},
};