forked from codesnippetspro/code-snippets
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
90 lines (87 loc) · 2.61 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
const length = 140
module.exports = {
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'import',
'react'
],
parserOptions: {
ecmaVersion: 9,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json']
},
env: {
es6: true,
node: true,
browser: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:react-hooks/recommended'
],
settings: {
'import/core-modules': ['tinymce'],
'react': { version: '17.0.2' }
},
rules: {
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/no-unused-vars': ['warn', {
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
argsIgnorePattern: '^_'
}],
'quotes': ['error', 'single', { avoidEscape: true }],
'linebreak-style': ['error', 'unix'],
'eqeqeq': ['error', 'always'],
'indent': ['error', 'tab', { SwitchCase: 1 }],
'max-len': ['warn', length],
'array-bracket-newline': ['error', 'consistent'],
'function-call-argument-newline': ['error', 'consistent'],
'comma-dangle': ['error', 'only-multiline'],
'no-tabs': ['error', { allowIndentationTabs: true }],
'one-var': ['error', 'never'],
'arrow-parens': ['error', 'as-needed'],
'quote-props': ['error', 'consistent-as-needed'],
'yoda': ['error', 'always'],
'dot-notation': 'error',
'operator-linebreak': ['error', 'after'],
'no-extra-parens': ['warn', 'all'],
'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
'prefer-template': 'error',
'no-magic-numbers': ['error', { ignore: [-1, 0, 1] }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'dot-location': ['error', 'property'],
'capitalized-comments': ['warn', 'always', {
ignorePattern: 'translators:',
ignoreInlineComments: true,
ignoreConsecutiveComments: true
}],
'no-invalid-this': 'error',
'max-lines-per-function': ['warn', { skipBlankLines: true, skipComments: true }],
'prefer-named-capture-group': 'error',
'func-style': ['error', 'expression'],
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'semi': ['error', 'never'],
'no-ternary': 'off',
'multiline-ternary': 'off',
'no-nested-ternary': 'off',
'padded-blocks': 'off',
'implicit-arrow-linebreak': 'off',
// Potentially revisit these later
'curly': ['error', 'multi-line'],
'no-alert': 'off',
'camelcase': 'off',
'sort-keys': 'off',
'max-params': 'off',
'sort-imports': 'off',
'require-unicode-regexp': 'off',
'array-element-newline': 'off',
'space-before-function-paren': 'off'
}
}