-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy patheslint.config.js
More file actions
100 lines (99 loc) · 2.8 KB
/
Copy patheslint.config.js
File metadata and controls
100 lines (99 loc) · 2.8 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
import eslint from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import eslintPluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import typescriptEslint from 'typescript-eslint'
export default typescriptEslint.config(
{ ignores: ['**/coverage', '**/.output', '**/.wxt', '**/node_modules', 'playwright-report/**'] },
{
plugins: {
'@stylistic': stylistic,
'@typescript-eslint': typescriptEslint.plugin,
'simple-import-sort': simpleImportSort,
},
},
{
files: ['**/*.{ts,tsx,vue}'],
extends: [
eslint.configs.recommended,
...typescriptEslint.configs.recommended,
...eslintPluginVue.configs['flat/recommended'],
],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: globals.browser,
parserOptions: {
parser: typescriptEslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
'vue/attribute-hyphenation': ['error', 'never'],
'vue/v-on-event-hyphenation': ['error', 'never'],
'vue/multi-word-component-names': ['off'],
'vue/no-v-html': ['off'],
'vue/require-default-prop': ['off'],
'vue/padding-line-between-blocks': ['error'],
'vue/array-bracket-spacing': ['error'],
'vue/block-spacing': ['error'],
'vue/arrow-spacing': ['error'],
'template-curly-spacing': ['error'],
},
},
stylistic.configs.customize({
indent: 2,
quotes: 'single',
semi: false,
jsx: true,
arrowParens: 'always',
}),
{
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-console': ['error'],
'no-restricted-imports': [
'error',
{
paths: [
{ name: '#imports', message: `please use "import * from 'wxt/xxx' instead" ` },
],
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
},
],
'@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
},
},
)