forked from Auralities/whspr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
118 lines (117 loc) · 3.96 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
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
118
module.exports = {
'env': {
'browser': true,
'es2021': true,
'node': true,
},
'extends': [
'airbnb-typescript',
'plugin:react/recommended',
],
'overrides': [
{
'files': ['*.ts', '*.tsx'],
'parser': '@typescript-eslint/parser',
'extends': [
'airbnb-typescript',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
},
{
'env': {
'node': true,
},
'files': [
'.eslintrc.{js,cjs}',
],
'parserOptions': {
'sourceType': 'script',
},
},
],
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'module',
'project': './tsconfig.json',
'module': 'ESNext',
},
'plugins': [
'react',
'@typescript-eslint',
],
'rules': {
'no-mixed-spaces-and-tabs': 'error',
indent: [2, 2],
/* Variable cames */
camelcase: 'error',
/* Language constructs */
curly: 'error',
eqeqeq: ['error', 'smart'],
'func-style': ['error', 'expression'],
'no-var': 'error',
'prefer-const': 'error',
/* Semicolons */
semi: 'error',
'no-extra-semi': 'error',
/* Padding & additional whitespace (preferred but optional) */
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'semi-spacing': 'warn',
'key-spacing': 'warn',
'block-spacing': 'warn',
'comma-spacing': 'warn',
'no-multi-spaces': 'warn',
'space-before-blocks': 'warn',
'keyword-spacing': ['warn', { before: true, after: true }],
'space-infix-ops': 'warn',
/* Minuta */
'comma-style': ['error', 'last'],
quotes: ['warn', 'single'],
'eol-last': 'off',
'no-trailing-spaces': 'off',
'spaced-comment': 'off',
'no-console': 'off',
'react/function-component-definition': 'off',
'arrow-body-style': 'off',
'no-unused-vars': 'off',
'no-plusplus': 'off',
'react/prop-types': 'off',
'react/jsx-one-expression-per-line': 'off',
'import/no-extraneous-dependencies': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
// typescript rules
'@typescript-eslint/indent': [2, 2],
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-vars': ['off', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': ['off', { ignoreRestArgs: true }],
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false }],
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
'@typescript-eslint/no-mixed-spaces-and-tabs': 'error',
'@typescript-eslint/camelcase': 'error',
'@typescript-eslint/curly': 'error',
'@typescript-eslint/eqeqeq': ['error', 'smart'],
'@typescript-eslint/func-style': ['error', 'expression'],
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/no-var': 'error',
'@typescript-eslint/prefer-const': 'error',
'@typescript-eslint/semi': 'error',
'@typescript-eslint/no-extra-semi': 'error',
'@typescript-eslint/brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'@typescript-eslint/semi-spacing': 'error',
'@typescript-eslint/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
'@typescript-eslint/block-spacing': 'error',
'@typescript-eslint/comma-spacing': 'error',
'@typescript-eslint/no-multi-spaces': 'error',
'@typescript-eslint/space-before-blocks': 'error',
'@typescript-eslint/keyword-spacing': ['error', { 'before': true, 'after': true }],
'@typescript-eslint/space-infix-ops': 'error',
'@typescript-eslint/comma-style': ['error', 'last'],
'@typescript-eslint/quotes': ['error', 'single'],
'@typescript-eslint/eol-last': 'off',
'@typescript-eslint/no-trailing-spaces': 'off',
'@typescript-eslint/spaced-comment': 'off',
'@typescript-eslint/no-console': 'off',
'@typescript-eslint/react/function-component-definition': 'off',
'@typescript-eslint/arrow-body-style': 'off',
},
};