-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
85 lines (84 loc) · 2.55 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
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: '@typescript-eslint/parser',
},
extends: [
'plugin:prettier/recommended',
'plugin:nuxt/recommended',
'plugin:vue/essential',
'plugin:vuejs-accessibility/recommended',
],
plugins: ['prettier', '@typescript-eslint', 'vitest'],
rules: {
'no-unused-vars': 'off',
'no-console': isProduction ? ['error', { allow: ['error', 'warn'] }] : 'off',
'no-debugger': isProduction ? 'error' : 'off',
'no-unreachable': isProduction ? 'error' : 'warn',
quotes: [
isProduction ? 'error' : 'warn',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: false },
],
// no-use-before-define has some special behaviors
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md#how-to-use
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{ enums: true, typedefs: true, ignoreTypeReferences: true },
],
eqeqeq: 'off',
camelcase: 'off',
'vue/this-in-template': 'off',
'require-await': 'off',
'vue/no-use-v-if-with-v-for': 'off',
'import/order': 'off',
'no-new': 'off',
'import/named': 'off',
'handle-callback-err': 'off',
'no-undef': 'off',
'no-lonely-if': 'off',
'vue/valid-v-slot': [
'error',
{
allowModifiers: true,
},
],
// Override label-has-for to allow for either nesting or id/for.
// Default is to require both.
'vuejs-accessibility/label-has-for': [
'error',
{
required: {
some: ['nesting', 'id'],
},
allowChildren: true,
},
],
'vuejs-accessibility/media-has-caption': 'off', // Spotify preview urls do not supply captions
'vuejs-accessibility/click-events-have-key-events': 'off', // Silence for now since there are too many violations
},
overrides: [
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
rules: { '@typescript-eslint/no-use-before-define': 'off' },
},
{
files: ['pages/**/*.vue', 'layouts/*.vue'],
rules: {
'vue/multi-word-component-names': 'off',
},
},
],
};