-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy patheslint.config.mjs
More file actions
150 lines (143 loc) · 4.34 KB
/
Copy patheslint.config.mjs
File metadata and controls
150 lines (143 loc) · 4.34 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import globals from 'globals'
import neostandard from 'neostandard'
import tseslint from 'typescript-eslint'
import vueParser from 'vue-eslint-parser'
import pluginVue from 'eslint-plugin-vue'
import jsdoc from 'eslint-plugin-jsdoc'
import pluginUnicorn from 'eslint-plugin-unicorn'
import importX from 'eslint-plugin-import-x'
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'
import { defineConfig } from 'eslint/config'
export default defineConfig(
{
ignores: [
'**/dist/**',
'**/node_modules/**',
'**/schema/**',
'**/*.tmpl.*',
'**/sw.js',
'**/.nuxt/**',
'**/.output/**',
],
},
...neostandard({ ts: true }),
...tseslint.configs.recommended,
...pluginVue.configs['flat/vue2-recommended'],
jsdoc.configs['flat/recommended'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
NodeJS: 'readonly',
$fetch: 'readonly',
},
},
settings: {
jsdoc: {
tagNamePreference: {
warning: 'warning',
note: 'note',
},
},
'import-x/resolver-next': [
createTypeScriptImportResolver({
project: './tsconfig.json'
})
]
},
},
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tseslint.parser,
},
},
},
{
plugins: {
unicorn: pluginUnicorn,
'import-x': importX
},
},
{
rules: {
'no-console': 'off',
'vue/multi-word-component-names': 'off',
'vue/one-component-per-file': 'off',
'vue/require-default-prop': 'off',
'vue/no-multiple-template-root': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/no-undefined-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
caughtErrors: 'none',
}],
// @nuxtjs/eslint-config-typescript
'no-unused-vars': 'off',
'no-undef': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/no-require-imports': 'off',
// @nuxtjs/eslint-config
'import-x/order': 'error',
'import-x/first': 'error',
'import-x/no-mutable-exports': 'error',
'import-x/no-unresolved': 'off',
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
'prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: false }],
'no-lonely-if': 'error',
curly: ['error', 'all'],
'require-await': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'no-useless-rename': 'error',
// unicorn
'unicorn/error-message': 'error',
'unicorn/escape-case': 'error',
'unicorn/no-instanceof-array': 'error',
'unicorn/no-new-buffer': 'error',
'unicorn/number-literal-case': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-string-starts-ends-with': 'error',
'unicorn/prefer-dom-node-text-content': 'error',
'unicorn/prefer-type-error': 'error',
'unicorn/throw-new-error': 'error',
// Vue parsing error
'vue/no-parsing-error': ['error', { 'x-invalid-end-tag': false }],
'vue/max-attributes-per-line': ['error', { singleline: 5 }],
// stylistic
'@stylistic/quote-props': 'off',
'@stylistic/comma-dangle': 'off',
'@stylistic/no-multiple-empty-lines': 'off',
'@stylistic/jsx-quotes': 'off',
},
},
{
files: [
'**/pages/**/*.{js,ts,vue}',
'**/layouts/**/*.{js,ts,vue}',
'**/app.{js,ts,vue}',
'**/error.{js,ts,vue}',
],
rules: {
'vue/multi-word-component-names': 'off',
'vue/no-multiple-template-root': 'error',
},
}
)