@useinsider/eslint-config 1.0.1-beta.8 → 1.1.2
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/README.md +6 -11
- package/package.json +25 -10
- package/src/rules/core.cjs +11 -3
- package/src/rules/stylistic.cjs +5 -0
- package/src/rules/typescript.cjs +1 -11
- package/src/rules/vue.cjs +161 -175
- package/src/typescript/index.cjs +2 -0
- package/src/typescript-dom/README.md +21 -0
- package/src/typescript-dom/index.cjs +2 -1
- package/src/vue3-typescript/index.cjs +16 -0
package/README.md
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
# ESLint
|
|
2
|
-
|
|
3
|
-
Welcome to Insider's shared ESLint configuration! This project offers a set of
|
|
4
|
-
ESLint rules tailored for both EcmaScript/JavaScript and TypeScript. It is
|
|
5
|
-
designed to help you seamlessly integrate Insider's coding style into your
|
|
6
|
-
development workflow.
|
|
1
|
+
# ESLint Configurations
|
|
7
2
|
|
|
8
3
|
## Table of Contents
|
|
9
|
-
- [ESLint
|
|
4
|
+
- [ESLint Configurations](#eslint-configurations)
|
|
10
5
|
- [Table of Contents](#table-of-contents)
|
|
11
6
|
- [Getting Started](#getting-started)
|
|
12
7
|
- [Installation](#installation)
|
|
@@ -26,14 +21,14 @@ using the `-D` and `-E` flags in your package manager commands.
|
|
|
26
21
|
### Installation
|
|
27
22
|
|
|
28
23
|
1. **Install as a Development Dependency:**
|
|
29
|
-
- For npm users:
|
|
30
|
-
```bash
|
|
31
|
-
npm install -D -E @useinsider/eslint-config
|
|
32
|
-
```
|
|
33
24
|
- For pnpm users:
|
|
34
25
|
```bash
|
|
35
26
|
pnpm add -D -E @useinsider/eslint-config
|
|
36
27
|
```
|
|
28
|
+
- For npm users:
|
|
29
|
+
```bash
|
|
30
|
+
npm install -D -E @useinsider/eslint-config
|
|
31
|
+
```
|
|
37
32
|
2. **Create an ESLint config file:**
|
|
38
33
|
You'll need an ESLint config file in your projects root directory.
|
|
39
34
|
|
package/package.json
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/eslint-config",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "A collection of ESLint configurations provided by @useinsider, offering support for various environments including Vanilla JS, TypeScript, and framework-specific setups such as Vue 3.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"useinsider",
|
|
7
|
+
"eslint",
|
|
8
|
+
"eslint-config",
|
|
9
|
+
"lint",
|
|
10
|
+
"code style",
|
|
11
|
+
"vanilla",
|
|
12
|
+
"typescript",
|
|
13
|
+
"vue",
|
|
14
|
+
"vue3",
|
|
15
|
+
"node"
|
|
16
|
+
],
|
|
3
17
|
"author": "Sahin Deniz <sahin.deniz@useinsider.com>",
|
|
4
18
|
"license": "MIT",
|
|
5
|
-
"version": "1.0.1-beta.8",
|
|
6
19
|
"packageManager": "pnpm@8.11.0",
|
|
7
20
|
"scripts": {
|
|
8
|
-
"lint": "eslint
|
|
9
|
-
"lint:
|
|
21
|
+
"lint": "eslint ./",
|
|
22
|
+
"lint:ci": "pnpm lint --quiet",
|
|
23
|
+
"lint:fix": "pnpm lint --fix",
|
|
24
|
+
"release": "semantic-release -e semantic-release-monorepo"
|
|
10
25
|
},
|
|
11
|
-
"homepage": "https://github.com/useinsider/eslint-config#readme",
|
|
26
|
+
"homepage": "https://github.com/useinsider/config/tree/master/packages/eslint-config#readme",
|
|
12
27
|
"repository": {
|
|
13
28
|
"type": "git",
|
|
14
|
-
"url": "
|
|
29
|
+
"url": "https://github.com/useinsider/config",
|
|
30
|
+
"directory": "packages/eslint-config"
|
|
15
31
|
},
|
|
16
32
|
"bugs": {
|
|
17
|
-
"url": "https://github.com/useinsider/
|
|
33
|
+
"url": "https://github.com/useinsider/config/issues"
|
|
18
34
|
},
|
|
19
35
|
"exports": {
|
|
20
36
|
".": "./src/node/index.cjs",
|
|
@@ -45,7 +61,9 @@
|
|
|
45
61
|
"@semantic-release/git": "10.0.1",
|
|
46
62
|
"@types/eslint": "8.44.8",
|
|
47
63
|
"@types/node": "20.10.2",
|
|
48
|
-
"
|
|
64
|
+
"@useinsider/release-config": "workspace:*",
|
|
65
|
+
"semantic-release": "19.0.5",
|
|
66
|
+
"semantic-release-monorepo": "7.0.5"
|
|
49
67
|
},
|
|
50
68
|
"optionalDependencies": {
|
|
51
69
|
"@rushstack/eslint-patch": ">=1.6.0",
|
|
@@ -57,8 +75,5 @@
|
|
|
57
75
|
"eslint-plugin-vue": ">=9.19.2",
|
|
58
76
|
"eslint-plugin-vue-scoped-css": ">=2.5.1",
|
|
59
77
|
"vue-eslint-parser": ">=9.3.2"
|
|
60
|
-
},
|
|
61
|
-
"publishConfig": {
|
|
62
|
-
"access": "restricted"
|
|
63
78
|
}
|
|
64
79
|
}
|
package/src/rules/core.cjs
CHANGED
|
@@ -13,7 +13,13 @@ module.exports = {
|
|
|
13
13
|
'guard-for-in': 'error',
|
|
14
14
|
'handle-callback-err': ['error'],
|
|
15
15
|
'import/extensions': ['error', {
|
|
16
|
+
css: 'always',
|
|
16
17
|
js: 'never',
|
|
18
|
+
json: 'always',
|
|
19
|
+
jsx: 'never',
|
|
20
|
+
sass: 'always',
|
|
21
|
+
scss: 'always',
|
|
22
|
+
svg: 'always',
|
|
17
23
|
ts: 'never',
|
|
18
24
|
tsx: 'never',
|
|
19
25
|
vue: 'always',
|
|
@@ -62,6 +68,7 @@ module.exports = {
|
|
|
62
68
|
}],
|
|
63
69
|
'no-invalid-regexp': ['error'],
|
|
64
70
|
'no-iterator': ['error'],
|
|
71
|
+
'no-mixed-operators': 'off',
|
|
65
72
|
'no-multi-str': ['error'],
|
|
66
73
|
'no-native-reassign': 'error',
|
|
67
74
|
'no-nested-ternary': ['error'],
|
|
@@ -120,18 +127,18 @@ module.exports = {
|
|
|
120
127
|
},
|
|
121
128
|
{
|
|
122
129
|
blankLine: 'always',
|
|
123
|
-
prev: ['*'],
|
|
124
130
|
next: ['multiline-block-like'],
|
|
131
|
+
prev: ['*'],
|
|
125
132
|
},
|
|
126
133
|
{
|
|
127
134
|
blankLine: 'always',
|
|
128
|
-
prev: ['multiline-block-like'],
|
|
129
135
|
next: ['*'],
|
|
136
|
+
prev: ['multiline-block-like'],
|
|
130
137
|
},
|
|
131
138
|
{
|
|
132
139
|
blankLine: 'any',
|
|
133
|
-
prev: ['case'],
|
|
134
140
|
next: ['case'],
|
|
141
|
+
prev: ['case'],
|
|
135
142
|
},
|
|
136
143
|
{
|
|
137
144
|
blankLine: 'any',
|
|
@@ -144,6 +151,7 @@ module.exports = {
|
|
|
144
151
|
}],
|
|
145
152
|
'prefer-destructuring': ['error'],
|
|
146
153
|
radix: ['error', 'as-needed'],
|
|
154
|
+
semi: 'off',
|
|
147
155
|
'space-before-function-paren': 'off',
|
|
148
156
|
strict: ['error'],
|
|
149
157
|
'use-isnan': ['error'],
|
package/src/rules/stylistic.cjs
CHANGED
|
@@ -24,6 +24,10 @@ module.exports = {
|
|
|
24
24
|
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
25
25
|
'@stylistic/indent': ['error', 4, {
|
|
26
26
|
SwitchCase: 1,
|
|
27
|
+
ignoredNodes: [
|
|
28
|
+
'PropertyDefinition[decorators]',
|
|
29
|
+
'TSUnionType',
|
|
30
|
+
],
|
|
27
31
|
}],
|
|
28
32
|
'@stylistic/key-spacing': ['error'],
|
|
29
33
|
'@stylistic/keyword-spacing': ['error'],
|
|
@@ -53,6 +57,7 @@ module.exports = {
|
|
|
53
57
|
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
54
58
|
'@stylistic/new-parens': ['error', 'always'],
|
|
55
59
|
'@stylistic/no-extra-parens': ['error', 'all', {
|
|
60
|
+
allowParensAfterCommentPattern: '@type',
|
|
56
61
|
enforceForArrowConditionals: false,
|
|
57
62
|
nestedBinaryExpressions: false,
|
|
58
63
|
returnAssign: false,
|
package/src/rules/typescript.cjs
CHANGED
|
@@ -24,13 +24,7 @@ module.exports = {
|
|
|
24
24
|
'no-useless-constructor': 'off',
|
|
25
25
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
26
26
|
'@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],
|
|
27
|
-
'@typescript-eslint/indent':
|
|
28
|
-
SwitchCase: 1,
|
|
29
|
-
ignoredNodes: [
|
|
30
|
-
'PropertyDefinition[decorators]',
|
|
31
|
-
'TSUnionType',
|
|
32
|
-
],
|
|
33
|
-
}],
|
|
27
|
+
'@typescript-eslint/indent': 'off',
|
|
34
28
|
semi: 'off',
|
|
35
29
|
'@typescript-eslint/semi': ['error', 'always'],
|
|
36
30
|
'@typescript-eslint/no-misused-promises': ['error', {
|
|
@@ -42,9 +36,5 @@ module.exports = {
|
|
|
42
36
|
'@typescript-eslint/lines-between-class-members': ['error', 'always', {
|
|
43
37
|
exceptAfterSingleLine: true,
|
|
44
38
|
}],
|
|
45
|
-
|
|
46
|
-
// TODO enable after SD-80950
|
|
47
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
48
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
49
39
|
},
|
|
50
40
|
};
|
package/src/rules/vue.cjs
CHANGED
|
@@ -1,180 +1,166 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.RulesRecord} */
|
|
2
|
-
const vueRules = {
|
|
3
|
-
'vue/array-bracket-newline': ['error'],
|
|
4
|
-
'vue/array-bracket-spacing': ['error', 'never'],
|
|
5
|
-
'vue/arrow-spacing': ['error'],
|
|
6
|
-
'vue/attribute-hyphenation': ['error', 'always'],
|
|
7
|
-
'vue/attributes-order': ['error', {
|
|
8
|
-
alphabetical: false,
|
|
9
|
-
order: [
|
|
10
|
-
'DEFINITION',
|
|
11
|
-
'LIST_RENDERING',
|
|
12
|
-
'CONDITIONALS',
|
|
13
|
-
'RENDER_MODIFIERS',
|
|
14
|
-
'GLOBAL',
|
|
15
|
-
'UNIQUE',
|
|
16
|
-
'TWO_WAY_BINDING',
|
|
17
|
-
'OTHER_DIRECTIVES',
|
|
18
|
-
'OTHER_ATTR',
|
|
19
|
-
'EVENTS',
|
|
20
|
-
'CONTENT',
|
|
21
|
-
],
|
|
22
|
-
}],
|
|
23
|
-
'vue/brace-style': ['error', '1tbs'],
|
|
24
|
-
'vue/comma-dangle': ['error', {
|
|
25
|
-
arrays: 'always-multiline',
|
|
26
|
-
exports: 'always-multiline',
|
|
27
|
-
functions: 'never',
|
|
28
|
-
imports: 'always-multiline',
|
|
29
|
-
objects: 'always-multiline',
|
|
30
|
-
}],
|
|
31
|
-
'vue/comma-spacing': ['error'],
|
|
32
|
-
'vue/comma-style': ['error', 'last'],
|
|
33
|
-
'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
34
|
-
'vue/component-name-in-template-casing': ['error', 'PascalCase', {
|
|
35
|
-
registeredComponentsOnly: false,
|
|
36
|
-
ignores: [
|
|
37
|
-
'component',
|
|
38
|
-
'transition',
|
|
39
|
-
],
|
|
40
|
-
}],
|
|
41
|
-
'vue/component-tags-order': ['error', {
|
|
42
|
-
order: [
|
|
43
|
-
'script[setup]',
|
|
44
|
-
'template',
|
|
45
|
-
'script:not([setup])',
|
|
46
|
-
'style',
|
|
47
|
-
],
|
|
48
|
-
}],
|
|
49
|
-
'vue/dot-location': ['error'],
|
|
50
|
-
'vue/dot-notation': ['error'],
|
|
51
|
-
'vue/eqeqeq': ['error'],
|
|
52
|
-
'vue/func-call-spacing': ['error'],
|
|
53
|
-
'vue/html-closing-bracket-newline': ['error', {
|
|
54
|
-
multiline: 'never',
|
|
55
|
-
singleline: 'never',
|
|
56
|
-
}],
|
|
57
|
-
'vue/html-end-tags': ['error'],
|
|
58
|
-
'vue/html-indent': ['error', 4],
|
|
59
|
-
'vue/html-quotes': ['error', 'double'],
|
|
60
|
-
'vue/html-self-closing': ['error'],
|
|
61
|
-
'vue/html-closing-bracket-spacing': ['error'],
|
|
62
|
-
'vue/key-spacing': ['error'],
|
|
63
|
-
'vue/keyword-spacing': ['error'],
|
|
64
|
-
'vue/max-attributes-per-line': ['error', {
|
|
65
|
-
multiline: {
|
|
66
|
-
max: 1,
|
|
67
|
-
},
|
|
68
|
-
singleline: 1,
|
|
69
|
-
}],
|
|
70
|
-
'vue/max-len': ['error', 120, {
|
|
71
|
-
ignoreComments: true,
|
|
72
|
-
ignoreRegExpLiterals: true,
|
|
73
|
-
ignoreTemplateLiterals: true,
|
|
74
|
-
ignoreTrailingComments: true,
|
|
75
|
-
ignoreUrls: true,
|
|
76
|
-
}],
|
|
77
|
-
'vue/multi-word-component-names': 'off',
|
|
78
|
-
'vue/mustache-interpolation-spacing': ['error', 'always'],
|
|
79
|
-
'vue/no-bare-strings-in-template': ['error'],
|
|
80
|
-
'vue/no-constant-condition': ['error'],
|
|
81
|
-
'vue/no-empty-component-block': ['error'],
|
|
82
|
-
'vue/no-empty-pattern': ['error'],
|
|
83
|
-
'vue/no-extra-parens': ['error'],
|
|
84
|
-
'vue/no-irregular-whitespace': ['error'],
|
|
85
|
-
'vue/no-multi-spaces': ['error'],
|
|
86
|
-
'vue/no-multiple-objects-in-class': ['error'],
|
|
87
|
-
'vue/no-potential-component-option-typo': ['error'],
|
|
88
|
-
'vue/no-reserved-component-names': ['error'],
|
|
89
|
-
'vue/no-restricted-syntax': ['error'],
|
|
90
|
-
'vue/no-spaces-around-equal-signs-in-attribute': ['error'],
|
|
91
|
-
'vue/no-sparse-arrays': ['error'],
|
|
92
|
-
'vue/no-undef-components': ['error'],
|
|
93
|
-
'vue/no-unsupported-features': ['error'],
|
|
94
|
-
'vue/no-unused-properties': ['error'],
|
|
95
|
-
'vue/no-unused-refs': ['error'],
|
|
96
|
-
'vue/no-use-computed-property-like-method': ['error'],
|
|
97
|
-
'vue/no-use-v-if-with-v-for': 'error',
|
|
98
|
-
'vue/no-useless-concat': ['error'],
|
|
99
|
-
'vue/no-useless-mustaches': ['error'],
|
|
100
|
-
'vue/no-useless-v-bind': ['error'],
|
|
101
|
-
'vue/no-v-text': ['error'],
|
|
102
|
-
'vue/object-curly-newline': ['error', {
|
|
103
|
-
consistent: true,
|
|
104
|
-
}],
|
|
105
|
-
'vue/object-curly-spacing': ['error', 'always'],
|
|
106
|
-
'vue/object-property-newline': ['error', {
|
|
107
|
-
allowAllPropertiesOnSameLine: true,
|
|
108
|
-
}],
|
|
109
|
-
'vue/object-shorthand': ['error', 'always'],
|
|
110
|
-
'vue/order-in-components': ['error', {
|
|
111
|
-
order: [
|
|
112
|
-
'el',
|
|
113
|
-
'name',
|
|
114
|
-
'parent',
|
|
115
|
-
'functional',
|
|
116
|
-
['delimiters', 'comments'],
|
|
117
|
-
['components', 'directives', 'filters'],
|
|
118
|
-
'extends',
|
|
119
|
-
'mixins',
|
|
120
|
-
'inheritAttrs',
|
|
121
|
-
'model',
|
|
122
|
-
['props', 'propsData'],
|
|
123
|
-
'data',
|
|
124
|
-
'computed',
|
|
125
|
-
'watch',
|
|
126
|
-
'LIFECYCLE_HOOKS',
|
|
127
|
-
'methods',
|
|
128
|
-
['template', 'render'],
|
|
129
|
-
'renderError',
|
|
130
|
-
],
|
|
131
|
-
}],
|
|
132
|
-
'vue/padding-line-between-blocks': ['error'],
|
|
133
|
-
'vue/prefer-separate-static-class': ['error'],
|
|
134
|
-
'vue/prefer-template': ['error'],
|
|
135
|
-
'vue/prefer-true-attribute-shorthand': ['error'],
|
|
136
|
-
'vue/prop-name-casing': ['error', 'camelCase'],
|
|
137
|
-
'vue/quote-props': ['error', 'as-needed'],
|
|
138
|
-
'vue/require-default-prop': ['error'],
|
|
139
|
-
'vue/require-prop-type-constructor': 'error',
|
|
140
|
-
'vue/require-prop-types': ['error'],
|
|
141
|
-
'vue/script-indent': ['error', 4, {
|
|
142
|
-
switchCase: 1,
|
|
143
|
-
}],
|
|
144
|
-
'vue/space-in-parens': ['error', 'never'],
|
|
145
|
-
'vue/space-infix-ops': ['error'],
|
|
146
|
-
'vue/space-unary-ops': ['error'],
|
|
147
|
-
'vue/template-curly-spacing': ['error'],
|
|
148
|
-
'vue/this-in-template': ['error', 'never'],
|
|
149
|
-
'vue/v-bind-style': ['error', 'shorthand'],
|
|
150
|
-
'vue/v-on-function-call': 'off',
|
|
151
|
-
'vue/v-on-style': ['error', 'shorthand'],
|
|
152
|
-
'vue/v-on-event-hyphenation': 'off',
|
|
153
|
-
'vue/no-setup-props-destructure': 'off',
|
|
154
|
-
'vue/block-tag-newline': ['error', {
|
|
155
|
-
singleline: 'always',
|
|
156
|
-
multiline: 'always',
|
|
157
|
-
}],
|
|
158
|
-
'vue/require-explicit-emits': ['error'],
|
|
159
|
-
'vue/no-required-prop-with-default': ['error'],
|
|
160
|
-
'vue/no-ref-object-destructure': ['error'],
|
|
161
|
-
'vue/no-template-target-blank': ['error'],
|
|
162
|
-
'vue/define-emits-declaration': ['error', 'type-based'],
|
|
163
|
-
'vue/define-props-declaration': ['error', 'type-based'],
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// Following rules will be refactored within SD-71639
|
|
167
|
-
const vueCSSRules = {
|
|
168
|
-
'vue-scoped-css/enforce-style-type': 'off',
|
|
169
|
-
'vue-scoped-css/require-v-deep-argument': 'off',
|
|
170
|
-
'vue-scoped-css/no-unused-selector': 'off',
|
|
171
|
-
'vue-scoped-css/no-deprecated-deep-combinator': ['error'],
|
|
172
|
-
};
|
|
173
|
-
|
|
174
1
|
/** @type {import("eslint").Linter.Config} */
|
|
175
2
|
module.exports = {
|
|
176
3
|
rules: {
|
|
177
|
-
|
|
178
|
-
|
|
4
|
+
'vue/array-bracket-newline': ['error'],
|
|
5
|
+
'vue/array-bracket-spacing': ['error', 'never'],
|
|
6
|
+
'vue/arrow-spacing': ['error'],
|
|
7
|
+
'vue/attribute-hyphenation': ['error', 'always'],
|
|
8
|
+
'vue/attributes-order': ['error', {
|
|
9
|
+
alphabetical: false,
|
|
10
|
+
order: [
|
|
11
|
+
'DEFINITION',
|
|
12
|
+
'LIST_RENDERING',
|
|
13
|
+
'CONDITIONALS',
|
|
14
|
+
'RENDER_MODIFIERS',
|
|
15
|
+
'GLOBAL',
|
|
16
|
+
'UNIQUE',
|
|
17
|
+
'TWO_WAY_BINDING',
|
|
18
|
+
'OTHER_DIRECTIVES',
|
|
19
|
+
'OTHER_ATTR',
|
|
20
|
+
'EVENTS',
|
|
21
|
+
'CONTENT',
|
|
22
|
+
],
|
|
23
|
+
}],
|
|
24
|
+
'vue/brace-style': ['error', '1tbs'],
|
|
25
|
+
'vue/comma-dangle': ['error', {
|
|
26
|
+
arrays: 'always-multiline',
|
|
27
|
+
exports: 'always-multiline',
|
|
28
|
+
functions: 'never',
|
|
29
|
+
imports: 'always-multiline',
|
|
30
|
+
objects: 'always-multiline',
|
|
31
|
+
}],
|
|
32
|
+
'vue/comma-spacing': ['error'],
|
|
33
|
+
'vue/comma-style': ['error', 'last'],
|
|
34
|
+
'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
35
|
+
'vue/component-name-in-template-casing': ['error', 'PascalCase', {
|
|
36
|
+
registeredComponentsOnly: false,
|
|
37
|
+
ignores: [
|
|
38
|
+
'component',
|
|
39
|
+
'transition',
|
|
40
|
+
],
|
|
41
|
+
}],
|
|
42
|
+
'vue/component-tags-order': ['error', {
|
|
43
|
+
order: [
|
|
44
|
+
'script[setup]',
|
|
45
|
+
'template',
|
|
46
|
+
'script:not([setup])',
|
|
47
|
+
'style',
|
|
48
|
+
],
|
|
49
|
+
}],
|
|
50
|
+
'vue/dot-location': ['error'],
|
|
51
|
+
'vue/dot-notation': ['error'],
|
|
52
|
+
'vue/eqeqeq': ['error'],
|
|
53
|
+
'vue/func-call-spacing': ['error'],
|
|
54
|
+
'vue/html-closing-bracket-newline': ['error', {
|
|
55
|
+
multiline: 'never',
|
|
56
|
+
singleline: 'never',
|
|
57
|
+
}],
|
|
58
|
+
'vue/html-end-tags': ['error'],
|
|
59
|
+
'vue/html-indent': ['error', 4],
|
|
60
|
+
'vue/html-quotes': ['error', 'double'],
|
|
61
|
+
'vue/html-self-closing': ['error'],
|
|
62
|
+
'vue/html-closing-bracket-spacing': ['error'],
|
|
63
|
+
'vue/key-spacing': ['error'],
|
|
64
|
+
'vue/keyword-spacing': ['error'],
|
|
65
|
+
'vue/max-attributes-per-line': ['error', {
|
|
66
|
+
multiline: {
|
|
67
|
+
max: 1,
|
|
68
|
+
},
|
|
69
|
+
singleline: 1,
|
|
70
|
+
}],
|
|
71
|
+
'vue/max-len': ['error', 120, {
|
|
72
|
+
ignoreComments: true,
|
|
73
|
+
ignoreRegExpLiterals: true,
|
|
74
|
+
ignoreTemplateLiterals: true,
|
|
75
|
+
ignoreTrailingComments: true,
|
|
76
|
+
ignoreUrls: true,
|
|
77
|
+
}],
|
|
78
|
+
'vue/multi-word-component-names': 'off',
|
|
79
|
+
'vue/mustache-interpolation-spacing': ['error', 'always'],
|
|
80
|
+
'vue/no-bare-strings-in-template': ['error'],
|
|
81
|
+
'vue/no-constant-condition': ['error'],
|
|
82
|
+
'vue/no-empty-component-block': ['error'],
|
|
83
|
+
'vue/no-empty-pattern': ['error'],
|
|
84
|
+
'vue/no-extra-parens': ['error'],
|
|
85
|
+
'vue/no-irregular-whitespace': ['error'],
|
|
86
|
+
'vue/no-multi-spaces': ['error'],
|
|
87
|
+
'vue/no-multiple-objects-in-class': ['error'],
|
|
88
|
+
'vue/no-potential-component-option-typo': ['error'],
|
|
89
|
+
'vue/no-reserved-component-names': ['error'],
|
|
90
|
+
'vue/no-restricted-syntax': ['error'],
|
|
91
|
+
'vue/no-spaces-around-equal-signs-in-attribute': ['error'],
|
|
92
|
+
'vue/no-sparse-arrays': ['error'],
|
|
93
|
+
'vue/no-undef-components': ['error'],
|
|
94
|
+
'vue/no-unsupported-features': ['error'],
|
|
95
|
+
'vue/no-unused-properties': ['error'],
|
|
96
|
+
'vue/no-unused-refs': ['error'],
|
|
97
|
+
'vue/no-use-computed-property-like-method': ['error'],
|
|
98
|
+
'vue/no-use-v-if-with-v-for': 'error',
|
|
99
|
+
'vue/no-useless-concat': ['error'],
|
|
100
|
+
'vue/no-useless-mustaches': ['error'],
|
|
101
|
+
'vue/no-useless-v-bind': ['error'],
|
|
102
|
+
'vue/no-v-text': ['error'],
|
|
103
|
+
'vue/object-curly-newline': ['error', {
|
|
104
|
+
consistent: true,
|
|
105
|
+
}],
|
|
106
|
+
'vue/object-curly-spacing': ['error', 'always'],
|
|
107
|
+
'vue/object-property-newline': ['error', {
|
|
108
|
+
allowAllPropertiesOnSameLine: true,
|
|
109
|
+
}],
|
|
110
|
+
'vue/object-shorthand': ['error', 'always'],
|
|
111
|
+
'vue/order-in-components': ['error', {
|
|
112
|
+
order: [
|
|
113
|
+
'el',
|
|
114
|
+
'name',
|
|
115
|
+
'parent',
|
|
116
|
+
'functional',
|
|
117
|
+
['delimiters', 'comments'],
|
|
118
|
+
['components', 'directives', 'filters'],
|
|
119
|
+
'extends',
|
|
120
|
+
'mixins',
|
|
121
|
+
'inheritAttrs',
|
|
122
|
+
'model',
|
|
123
|
+
['props', 'propsData'],
|
|
124
|
+
'data',
|
|
125
|
+
'computed',
|
|
126
|
+
'watch',
|
|
127
|
+
'LIFECYCLE_HOOKS',
|
|
128
|
+
'methods',
|
|
129
|
+
['template', 'render'],
|
|
130
|
+
'renderError',
|
|
131
|
+
],
|
|
132
|
+
}],
|
|
133
|
+
'vue/padding-line-between-blocks': ['error'],
|
|
134
|
+
'vue/prefer-separate-static-class': ['error'],
|
|
135
|
+
'vue/prefer-template': ['error'],
|
|
136
|
+
'vue/prefer-true-attribute-shorthand': ['error'],
|
|
137
|
+
'vue/prop-name-casing': ['error', 'camelCase'],
|
|
138
|
+
'vue/quote-props': ['error', 'as-needed'],
|
|
139
|
+
'vue/require-default-prop': ['error'],
|
|
140
|
+
'vue/require-prop-type-constructor': 'error',
|
|
141
|
+
'vue/require-prop-types': ['error'],
|
|
142
|
+
'vue/script-indent': ['error', 4, {
|
|
143
|
+
switchCase: 1,
|
|
144
|
+
}],
|
|
145
|
+
'vue/space-in-parens': ['error', 'never'],
|
|
146
|
+
'vue/space-infix-ops': ['error'],
|
|
147
|
+
'vue/space-unary-ops': ['error'],
|
|
148
|
+
'vue/template-curly-spacing': ['error'],
|
|
149
|
+
'vue/this-in-template': ['error', 'never'],
|
|
150
|
+
'vue/v-bind-style': ['error', 'shorthand'],
|
|
151
|
+
'vue/v-on-function-call': 'off',
|
|
152
|
+
'vue/v-on-style': ['error', 'shorthand'],
|
|
153
|
+
'vue/v-on-event-hyphenation': 'off',
|
|
154
|
+
'vue/no-setup-props-destructure': 'off',
|
|
155
|
+
'vue/block-tag-newline': ['error', {
|
|
156
|
+
singleline: 'always',
|
|
157
|
+
multiline: 'always',
|
|
158
|
+
}],
|
|
159
|
+
'vue/require-explicit-emits': ['error'],
|
|
160
|
+
'vue/no-required-prop-with-default': ['error'],
|
|
161
|
+
'vue/no-ref-object-destructure': ['error'],
|
|
162
|
+
'vue/no-template-target-blank': ['error'],
|
|
163
|
+
'vue/define-emits-declaration': ['error', 'type-based'],
|
|
164
|
+
'vue/define-props-declaration': ['error', 'type-based'],
|
|
179
165
|
},
|
|
180
166
|
};
|
package/src/typescript/index.cjs
CHANGED
|
@@ -62,3 +62,24 @@ module.exports = {
|
|
|
62
62
|
],
|
|
63
63
|
};
|
|
64
64
|
```
|
|
65
|
+
|
|
66
|
+
### Vue Extension Configuration
|
|
67
|
+
|
|
68
|
+
To properly lint `.vue` files imported within `.ts` files, it's essential to
|
|
69
|
+
update the `parserOptions` in your ESLint configuration. This adjustment helps
|
|
70
|
+
prevent ESLint errors that may arise due to the import of Vue components. Add
|
|
71
|
+
the following configuration to your `.eslintrc` file:
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
{
|
|
75
|
+
// Existing configuration...
|
|
76
|
+
parserOptions: {
|
|
77
|
+
// Other existing parser options...
|
|
78
|
+
extraFileExtensions: ['.vue'], // Add this line
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This change ensures that ESLint correctly processes .vue files alongside
|
|
84
|
+
TypeScript files, maintaining consistent code quality and style across your
|
|
85
|
+
project.
|
|
@@ -26,12 +26,13 @@ module.exports = {
|
|
|
26
26
|
ecmaFeatures: {
|
|
27
27
|
jsx: true,
|
|
28
28
|
},
|
|
29
|
-
extraFileExtensions: ['.vue'],
|
|
30
29
|
},
|
|
31
30
|
rules: {
|
|
32
31
|
'jsdoc/require-param': 'off',
|
|
33
32
|
'jsdoc/require-jsdoc': 'off',
|
|
34
33
|
'jsdoc/require-returns': 'off',
|
|
34
|
+
'jsdoc/require-param-type': 'off',
|
|
35
|
+
'jsdoc/check-param-names': 'off',
|
|
35
36
|
},
|
|
36
37
|
settings: {
|
|
37
38
|
jsdoc: {
|
|
@@ -30,4 +30,20 @@ module.exports = {
|
|
|
30
30
|
},
|
|
31
31
|
extraFileExtensions: ['.vue'],
|
|
32
32
|
},
|
|
33
|
+
rules: {
|
|
34
|
+
'jsdoc/require-param': 'off',
|
|
35
|
+
'jsdoc/require-jsdoc': 'off',
|
|
36
|
+
'jsdoc/require-returns': 'off',
|
|
37
|
+
'jsdoc/require-param-type': 'off',
|
|
38
|
+
'jsdoc/check-param-names': 'off',
|
|
39
|
+
},
|
|
40
|
+
settings: {
|
|
41
|
+
jsdoc: {
|
|
42
|
+
mode: 'typescript',
|
|
43
|
+
tagNamePreference: {
|
|
44
|
+
callback: 'watch',
|
|
45
|
+
desc: 'use',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
33
49
|
};
|