@sxzz/eslint-config 3.0.0-beta.3 → 3.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/js.js +6 -1
- package/src/typescript.js +1 -1
- package/src/vue.js +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sxzz/eslint-config",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
4
4
|
"packageManager": "pnpm@7.27.0",
|
|
5
5
|
"description": "ESLint config for @sxzz.",
|
|
6
6
|
"type": "module",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
|
38
38
|
"@typescript-eslint/parser": "^5.56.0",
|
|
39
39
|
"eslint-config-prettier": "^8.8.0",
|
|
40
|
+
"eslint-plugin-antfu": "^0.38.2",
|
|
40
41
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
41
42
|
"eslint-plugin-import": "^2.27.5",
|
|
42
43
|
"eslint-plugin-jsonc": "^2.7.0",
|
package/src/js.js
CHANGED
|
@@ -2,8 +2,9 @@ import globals from 'globals'
|
|
|
2
2
|
import jsConfig from '@eslint/js'
|
|
3
3
|
import importPlugin from 'eslint-plugin-import'
|
|
4
4
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
5
|
+
import antfuPlugin from 'eslint-plugin-antfu'
|
|
5
6
|
|
|
6
|
-
export { importPlugin, unicornPlugin }
|
|
7
|
+
export { importPlugin, unicornPlugin, antfuPlugin }
|
|
7
8
|
|
|
8
9
|
/** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
|
|
9
10
|
export const js = [
|
|
@@ -115,6 +116,7 @@ export const imports = [
|
|
|
115
116
|
{
|
|
116
117
|
plugins: {
|
|
117
118
|
import: importPlugin,
|
|
119
|
+
antfu: antfuPlugin,
|
|
118
120
|
},
|
|
119
121
|
settings: {
|
|
120
122
|
'import/resolver': {
|
|
@@ -142,6 +144,9 @@ export const imports = [
|
|
|
142
144
|
pathGroupsExcludedImportTypes: ['type'],
|
|
143
145
|
},
|
|
144
146
|
],
|
|
147
|
+
|
|
148
|
+
'antfu/import-dedupe': 'error',
|
|
149
|
+
'antfu/prefer-inline-type-import': 'error',
|
|
145
150
|
},
|
|
146
151
|
},
|
|
147
152
|
]
|
package/src/typescript.js
CHANGED
|
@@ -28,7 +28,7 @@ export const typescript = [
|
|
|
28
28
|
'@typescript-eslint/ban-types': 'off',
|
|
29
29
|
'@typescript-eslint/consistent-type-imports': [
|
|
30
30
|
'error',
|
|
31
|
-
{ fixStyle: '
|
|
31
|
+
{ fixStyle: 'inline-type-imports', disallowTypeAnnotations: false },
|
|
32
32
|
],
|
|
33
33
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
34
34
|
'@typescript-eslint/no-explicit-any': 'off',
|
package/src/vue.js
CHANGED
|
@@ -48,6 +48,8 @@ const vueBaseRules = {
|
|
|
48
48
|
'vue/max-attributes-per-line': 'off',
|
|
49
49
|
'vue/no-v-html': 'off',
|
|
50
50
|
'vue/multi-word-component-names': 'off',
|
|
51
|
+
'vue/require-prop-types': 'off',
|
|
52
|
+
|
|
51
53
|
'vue/html-self-closing': [
|
|
52
54
|
'error',
|
|
53
55
|
{
|
|
@@ -60,6 +62,28 @@ const vueBaseRules = {
|
|
|
60
62
|
math: 'always',
|
|
61
63
|
},
|
|
62
64
|
],
|
|
65
|
+
'vue/component-tags-order': [
|
|
66
|
+
'error',
|
|
67
|
+
{ order: ['script', 'template', 'style'] },
|
|
68
|
+
],
|
|
69
|
+
'vue/custom-event-name-casing': ['error', 'camelCase'],
|
|
70
|
+
'vue/no-useless-v-bind': 'error',
|
|
71
|
+
'vue/no-unused-refs': 'error',
|
|
72
|
+
'vue/padding-line-between-blocks': ['error', 'always'],
|
|
73
|
+
|
|
74
|
+
'vue/prefer-template': 'error',
|
|
75
|
+
'vue/eqeqeq': ['error', 'smart'],
|
|
76
|
+
'vue/no-constant-condition': 'warn',
|
|
77
|
+
'vue/object-shorthand': [
|
|
78
|
+
'error',
|
|
79
|
+
'always',
|
|
80
|
+
{
|
|
81
|
+
ignoreConstructors: false,
|
|
82
|
+
avoidQuotes: true,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
'vue/no-loss-of-precision': 'error',
|
|
86
|
+
'vue/no-empty-pattern': 'error',
|
|
63
87
|
}
|
|
64
88
|
|
|
65
89
|
/** @type {import('eslint-define-config').Rules} */
|