@lincy/eslint-config 1.1.3 → 1.1.5
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/vue2.js +99 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincy/eslint-config",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"packageManager": "pnpm@8.4.0",
|
|
5
5
|
"description": "LinCenYing's ESLint config",
|
|
6
6
|
"author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"index.js",
|
|
15
15
|
"vue.js",
|
|
16
|
+
"vue2.js",
|
|
16
17
|
"ts.js",
|
|
17
18
|
"basic.js",
|
|
18
19
|
"standard.js"
|
package/vue2.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const { isPackageExists } = require('local-pkg')
|
|
2
|
+
|
|
3
|
+
const Prettier = isPackageExists('prettier')
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
extends: [
|
|
7
|
+
'plugin:vue/recommended',
|
|
8
|
+
'./basic',
|
|
9
|
+
...(Prettier ? ['prettier'] : []),
|
|
10
|
+
],
|
|
11
|
+
plugins: [
|
|
12
|
+
...(Prettier ? ['prettier'] : []),
|
|
13
|
+
],
|
|
14
|
+
rules: {
|
|
15
|
+
'vue/max-attributes-per-line': 'off',
|
|
16
|
+
'vue/no-v-html': 'off',
|
|
17
|
+
'vue/require-prop-types': 'off',
|
|
18
|
+
'vue/require-default-prop': 'off',
|
|
19
|
+
'vue/multi-word-component-names': 'off',
|
|
20
|
+
'vue/prefer-import-from-vue': 'off',
|
|
21
|
+
'vue/no-v-text-v-html-on-component': 'off',
|
|
22
|
+
|
|
23
|
+
// reactivity transform
|
|
24
|
+
'vue/no-setup-props-destructure': 'off',
|
|
25
|
+
|
|
26
|
+
'vue/component-tags-order': ['error', {
|
|
27
|
+
order: ['template', 'script', 'style'],
|
|
28
|
+
}],
|
|
29
|
+
'vue/block-tag-newline': ['error', {
|
|
30
|
+
singleline: 'always',
|
|
31
|
+
multiline: 'always',
|
|
32
|
+
}],
|
|
33
|
+
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
34
|
+
'vue/component-options-name-casing': ['error', 'PascalCase'],
|
|
35
|
+
'vue/custom-event-name-casing': ['error', 'kebab-case'],
|
|
36
|
+
'vue/define-macros-order': ['error', {
|
|
37
|
+
order: ['defineProps', 'defineEmits'],
|
|
38
|
+
}],
|
|
39
|
+
'vue/html-indent': ['error', 4, {
|
|
40
|
+
attribute: 1,
|
|
41
|
+
baseIndent: 1,
|
|
42
|
+
closeBracket: 0,
|
|
43
|
+
alignAttributesVertically: true,
|
|
44
|
+
ignores: [],
|
|
45
|
+
}],
|
|
46
|
+
'vue/html-comment-content-spacing': ['error', 'always', {
|
|
47
|
+
exceptions: ['-'],
|
|
48
|
+
}],
|
|
49
|
+
'vue/no-restricted-v-bind': ['error', '/^v-/'],
|
|
50
|
+
'vue/no-useless-v-bind': 'error',
|
|
51
|
+
'vue/no-unused-refs': 'error',
|
|
52
|
+
'vue/padding-line-between-blocks': ['error', 'always'],
|
|
53
|
+
'vue/prefer-separate-static-class': 'error',
|
|
54
|
+
|
|
55
|
+
// extensions
|
|
56
|
+
'vue/array-bracket-spacing': ['error', 'never'],
|
|
57
|
+
'vue/arrow-spacing': ['error', { before: true, after: true }],
|
|
58
|
+
'vue/block-spacing': ['error', 'always'],
|
|
59
|
+
'vue/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
|
|
60
|
+
'vue/comma-dangle': ['error', 'always-multiline'],
|
|
61
|
+
'vue/comma-spacing': ['error', { before: false, after: true }],
|
|
62
|
+
'vue/comma-style': ['error', 'last'],
|
|
63
|
+
'vue/dot-location': ['error', 'property'],
|
|
64
|
+
'vue/dot-notation': ['error', { allowKeywords: true }],
|
|
65
|
+
'vue/eqeqeq': ['error', 'smart'],
|
|
66
|
+
// 'vue/func-call-spacing': ['off', 'never'],
|
|
67
|
+
'vue/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
68
|
+
'vue/keyword-spacing': ['error', { before: true, after: true }],
|
|
69
|
+
'vue/no-constant-condition': 'warn',
|
|
70
|
+
'vue/no-empty-pattern': 'error',
|
|
71
|
+
'vue/no-extra-parens': ['error', 'functions'],
|
|
72
|
+
'vue/no-irregular-whitespace': 'error',
|
|
73
|
+
'vue/no-loss-of-precision': 'error',
|
|
74
|
+
'vue/no-restricted-syntax': [
|
|
75
|
+
'error',
|
|
76
|
+
'DebuggerStatement',
|
|
77
|
+
'LabeledStatement',
|
|
78
|
+
'WithStatement',
|
|
79
|
+
],
|
|
80
|
+
'vue/no-sparse-arrays': 'error',
|
|
81
|
+
'vue/object-curly-newline': ['error', { multiline: true, consistent: true }],
|
|
82
|
+
'vue/object-curly-spacing': ['error', 'always'],
|
|
83
|
+
'vue/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
|
|
84
|
+
'vue/object-shorthand': ['error', 'always', {
|
|
85
|
+
ignoreConstructors: false,
|
|
86
|
+
avoidQuotes: true,
|
|
87
|
+
}],
|
|
88
|
+
'vue/operator-linebreak': ['error', 'before'],
|
|
89
|
+
'vue/prefer-template': 'error',
|
|
90
|
+
'vue/quote-props': ['error', 'consistent-as-needed'],
|
|
91
|
+
'vue/space-in-parens': ['error', 'never'],
|
|
92
|
+
'vue/space-infix-ops': 'error',
|
|
93
|
+
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
94
|
+
'vue/template-curly-spacing': 'error',
|
|
95
|
+
'vue/singleline-html-element-content-newline': 'off',
|
|
96
|
+
|
|
97
|
+
...(Prettier ? { 'prettier/prettier': 'error' } : null),
|
|
98
|
+
},
|
|
99
|
+
}
|