-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
107 lines (101 loc) · 2.84 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
/* eslint-env node */
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { defineConfig } = require('eslint-define-config')
module.exports = defineConfig({
root: true,
overrides: [
{
extends: ['plugin:@typescript-eslint/recommended'],
files: ['./**/*.{js,jsx,ts,tsx,vue,md}'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
project: true,
tsconfigRootDir: './',
extraFileExtensions: ['.vue'],
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
tsx: true, // Allows for the parsing of TSX
jsx: true,
},
},
rules: {
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 0,
// 该规则由ts控制
'no-use-before-define': 'off',
},
},
{
extends: ['plugin:md/recommended'],
files: ['./docs/**/*.md'],
parser: 'markdown-eslint-parser',
rules: {
'prettier/prettier': [
'error',
// Important to force prettier to use "markdown" parser - otherwise it wouldn't be able to parse *.md files.
// You also can configure other options supported by prettier here - "prose-wrap" is
// particularly useful for *.md files
{ parser: 'markdown' },
],
},
},
],
plugins: ['json', 'css', 'promise', 'regexp', 'prettier'],
extends: [
'airbnb-base',
'plugin:css/recommended',
'plugin:promise/recommended',
'plugin:regexp/recommended',
'plugin:json/recommended',
'plugin:vue/vue3-recommended',
'plugin:prettier/recommended',
'@unocss',
'.eslintrc-auto-import.json',
],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
semi: false,
endOfLine: 'auto',
},
],
'vue/no-export-in-script-setup': 0,
'vue/component-name-in-template-casing': [
'error',
'kebab-case',
{
registeredComponentsOnly: false,
ignores: [],
},
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'any',
},
},
],
'vue/multi-word-component-names': 0,
'import/no-extraneous-dependencies': [0],
'import/no-mutable-exports': 0,
'import/no-unresolved': 0,
'import/extensions': 0,
'import/prefer-default-export': 0,
// 使用未定义变量由ts报错
'no-undef': 'off',
curly: ['error', 'all'],
semi: ['error', 'never'],
'linebreak-style': ['off'],
'no-bitwise': 'off',
'no-plusplus': 'off',
'no-console': ['error', { allow: ['warn', 'error', 'assert'] }],
'no-param-reassign': ['error', { props: false }],
},
})