forked from nuxt-community/sentry-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
107 lines (106 loc) · 4.04 KB
/
.eslintrc.cjs
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
const tsParser = require('@typescript-eslint/parser')
module.exports = {
extends: [
'@nuxtjs/eslint-config',
],
rules: {
'comma-dangle': ['error', 'always-multiline'],
'import/named': 'off',
'import/namespace': 'off',
'import/no-absolute-path': 'off',
'no-console': [
'error', {
allow: ['assert', 'warn', 'error', 'info'],
},
],
'vue/multi-word-component-names': 'off',
},
overrides: [
{
files: ['**/.nuxt/*.js'],
rules: {
'comma-spacing': 'off',
'import/order': 'off',
'key-spacing': 'off',
'object-curly-spacing': 'off',
'quote-props': 'off',
quotes: 'off',
},
},
{
files: ['*.vue'],
parserOptions: {
parser: {
// Overrides script parser for `<script lang="ts">`
ts: tsParser,
},
},
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
extends: [
'@nuxtjs/eslint-config-typescript',
],
rules: {
'comma-dangle': 'off',
'constructor-super': 'off', // ts(2335) & ts(2377)
'getter-return': 'off', // ts(2378)
'import/named': 'off',
'no-const-assign': 'off', // ts(2588)
'no-dupe-args': 'off', // ts(2300)
'no-dupe-class-members': 'off', // ts(2393) & ts(2300)
'no-dupe-keys': 'off', // ts(1117)
'no-func-assign': 'off', // ts(2539)
'no-import-assign': 'off', // ts(2539) & ts(2540)
'no-new-symbol': 'off', // ts(2588)
'no-obj-calls': 'off', // ts(2349)
'no-redeclare': 'off', // ts(2451)
'no-setter-return': 'off', // ts(2408)
'no-this-before-super': 'off', // ts(2376)
'no-undef': 'off', // ts(2304)
'no-unreachable': 'off', // ts(7027)
'no-unsafe-negation': 'off', // ts(2365) & ts(2360) & ts(2358)
'no-var': 'error', // ts transpiles let/const to var, so no need for vars any more
'prefer-const': 'error', // ts provides better types with const
'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply
quotes: 'off',
semi: 'off',
'valid-typeof': 'off', // ts(2367)
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'no-array-constructor': 'off',
'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none', requireLast: false } }],
'@typescript-eslint/no-array-constructor': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-this-alias': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/triple-slash-reference': 'error',
},
},
],
}