@useinsider/eslint-config 0.0.1
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 +42 -0
- package/src/base.cjs +10 -0
- package/src/config.cjs +7 -0
- package/src/dom.cjs +15 -0
- package/src/node.cjs +12 -0
- package/src/rules/agnostic.cjs +152 -0
- package/src/rules/jsdoc.cjs +26 -0
- package/src/rules/stylistic.cjs +109 -0
- package/src/rules/typescript.cjs +50 -0
- package/src/rules/vue.cjs +180 -0
- package/src/typescript.cjs +44 -0
- package/src/vue3.cjs +33 -0
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@useinsider/eslint-config",
|
|
3
|
+
"author": "Sahin Deniz <sahin.deniz@useinsider.com>",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"version": "0.0.1",
|
|
6
|
+
"packageManager": "pnpm@8.11.0",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"lint": "eslint --ext .js,.cjs ./",
|
|
9
|
+
"lint:fix": "pnpm lint --fix",
|
|
10
|
+
"release": "standard-version && git push --follow-tags && pnpm publish --dry-run --no-git-checks packages/eslint"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://useinsider/eslint-config.git"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./src/node.cjs",
|
|
18
|
+
"./dom": "./src/dom.cjs",
|
|
19
|
+
"./typescript": "./src/typescript.cjs",
|
|
20
|
+
"./typescript-dom": "./src/typescript-dom.cjs",
|
|
21
|
+
"./vue3": "./src/vue3.cjs",
|
|
22
|
+
"./node": "./src/node.cjs",
|
|
23
|
+
"./config": "./src/config.cjs"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src/**/*"
|
|
27
|
+
],
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@cspell/eslint-plugin": "8.0.0",
|
|
30
|
+
"@stylistic/eslint-plugin": "1.4.1",
|
|
31
|
+
"@stylistic/eslint-plugin-migrate": "1.4.1",
|
|
32
|
+
"@types/eslint": "8.44.7",
|
|
33
|
+
"@types/node": "20.10.1",
|
|
34
|
+
"eslint": "8.54.0",
|
|
35
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
36
|
+
"eslint-plugin-import": "2.29.0",
|
|
37
|
+
"eslint-plugin-jsdoc": "46.9.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"standard-version": "9.5.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/base.cjs
ADDED
package/src/config.cjs
ADDED
package/src/dom.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
5
|
+
'airbnb-base',
|
|
6
|
+
'plugin:jsdoc/recommended',
|
|
7
|
+
'plugin:@cspell/recommended',
|
|
8
|
+
require.resolve('./rules/agnostic.cjs'),
|
|
9
|
+
require.resolve('./rules/stylistic.cjs'),
|
|
10
|
+
require.resolve('./rules/jsdoc.cjs'),
|
|
11
|
+
],
|
|
12
|
+
env: {
|
|
13
|
+
browser: true,
|
|
14
|
+
},
|
|
15
|
+
};
|
package/src/node.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
5
|
+
'airbnb-base',
|
|
6
|
+
'plugin:jsdoc/recommended',
|
|
7
|
+
'plugin:@cspell/recommended',
|
|
8
|
+
require.resolve('./rules/agnostic.cjs'),
|
|
9
|
+
require.resolve('./rules/stylistic.cjs'),
|
|
10
|
+
require.resolve('./rules/jsdoc.cjs'),
|
|
11
|
+
],
|
|
12
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
rules: {
|
|
4
|
+
'arrow-parens': 'off',
|
|
5
|
+
camelcase: ['error', {
|
|
6
|
+
allow: ['^\\$_'],
|
|
7
|
+
}],
|
|
8
|
+
'class-methods-use-this': 'off',
|
|
9
|
+
'comma-dangle': 'off',
|
|
10
|
+
'consistent-return': ['error'],
|
|
11
|
+
curly: ['error', 'all'],
|
|
12
|
+
'dot-notation': ['error'],
|
|
13
|
+
'guard-for-in': 'error',
|
|
14
|
+
'handle-callback-err': ['error'],
|
|
15
|
+
'import/extensions': ['error', {
|
|
16
|
+
js: 'never',
|
|
17
|
+
ts: 'never',
|
|
18
|
+
tsx: 'never',
|
|
19
|
+
vue: 'always',
|
|
20
|
+
}],
|
|
21
|
+
'import/no-cycle': 'off',
|
|
22
|
+
'import/no-unresolved': 'off',
|
|
23
|
+
'import/order': ['error', {
|
|
24
|
+
alphabetize: {
|
|
25
|
+
caseInsensitive: true,
|
|
26
|
+
order: 'asc',
|
|
27
|
+
},
|
|
28
|
+
groups: ['index', 'builtin', 'object', 'type', 'external', 'parent', 'internal', 'sibling'],
|
|
29
|
+
pathGroups: [{
|
|
30
|
+
group: 'internal',
|
|
31
|
+
pattern: '@/**',
|
|
32
|
+
}],
|
|
33
|
+
}],
|
|
34
|
+
'import/prefer-default-export': 'off',
|
|
35
|
+
indent: 'off',
|
|
36
|
+
'max-len': 'off',
|
|
37
|
+
'new-cap': ['error'],
|
|
38
|
+
'no-alert': ['error'],
|
|
39
|
+
'no-bitwise': ['error', {
|
|
40
|
+
allow: ['~'],
|
|
41
|
+
}],
|
|
42
|
+
'no-caller': ['error'],
|
|
43
|
+
'no-case-declarations': ['error'],
|
|
44
|
+
'no-confusing-arrow': ['error', {
|
|
45
|
+
allowParens: true,
|
|
46
|
+
}],
|
|
47
|
+
'no-console': ['error'],
|
|
48
|
+
'no-debugger': ['error'],
|
|
49
|
+
'no-div-regex': ['error'],
|
|
50
|
+
'no-dupe-args': ['error'],
|
|
51
|
+
'no-dupe-keys': ['error'],
|
|
52
|
+
'no-duplicate-case': ['error'],
|
|
53
|
+
'no-else-return': ['error'],
|
|
54
|
+
'no-empty': ['error'],
|
|
55
|
+
'no-extra-bind': ['error'],
|
|
56
|
+
'no-extra-boolean-cast': 'error',
|
|
57
|
+
'no-fallthrough': ['error'],
|
|
58
|
+
'no-implicit-coercion': ['error', {
|
|
59
|
+
boolean: true,
|
|
60
|
+
number: true,
|
|
61
|
+
string: true,
|
|
62
|
+
}],
|
|
63
|
+
'no-invalid-regexp': ['error'],
|
|
64
|
+
'no-iterator': ['error'],
|
|
65
|
+
'no-multi-str': ['error'],
|
|
66
|
+
'no-native-reassign': 'error',
|
|
67
|
+
'no-nested-ternary': ['error'],
|
|
68
|
+
'no-new': 'off',
|
|
69
|
+
'no-new-object': ['error'],
|
|
70
|
+
'no-new-require': ['error'],
|
|
71
|
+
'no-param-reassign': ['error', {
|
|
72
|
+
props: false,
|
|
73
|
+
}],
|
|
74
|
+
'no-plusplus': 'off',
|
|
75
|
+
'no-process-exit': ['error'],
|
|
76
|
+
'no-return-assign': ['error', 'except-parens'],
|
|
77
|
+
'no-self-compare': ['error'],
|
|
78
|
+
'no-sequences': ['error'],
|
|
79
|
+
'no-shadow': ['error', {
|
|
80
|
+
allow: ['state'],
|
|
81
|
+
}],
|
|
82
|
+
'no-undef': ['error'],
|
|
83
|
+
'no-underscore-dangle': 'off',
|
|
84
|
+
'no-unexpected-multiline': ['error'],
|
|
85
|
+
'no-unreachable': ['error'],
|
|
86
|
+
'no-unused-vars': ['error'],
|
|
87
|
+
'no-use-before-define': 'error',
|
|
88
|
+
'no-useless-call': ['error'],
|
|
89
|
+
'no-void': 'off',
|
|
90
|
+
'no-with': ['error'],
|
|
91
|
+
'object-curly-newline': 'off',
|
|
92
|
+
'object-shorthand': ['error', 'always'],
|
|
93
|
+
'padded-blocks': 'off',
|
|
94
|
+
'padding-line-between-statements': [
|
|
95
|
+
'error',
|
|
96
|
+
{
|
|
97
|
+
blankLine: 'always',
|
|
98
|
+
next: '*',
|
|
99
|
+
prev: ['const', 'let', 'var', 'if', 'block-like', 'directive'],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
blankLine: 'always',
|
|
103
|
+
next: ['const', 'let', 'var', 'if', 'directive', 'return', 'break', 'default', 'cjs-export', 'export'],
|
|
104
|
+
prev: '*',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
blankLine: 'any',
|
|
108
|
+
next: ['cjs-export', 'export'],
|
|
109
|
+
prev: ['cjs-export', 'export'],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
blankLine: 'any',
|
|
113
|
+
next: ['const', 'let', 'var', 'directive'],
|
|
114
|
+
prev: ['const', 'let', 'var', 'directive'],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
blankLine: 'never',
|
|
118
|
+
next: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
119
|
+
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
blankLine: 'always',
|
|
123
|
+
prev: ['*'],
|
|
124
|
+
next: ['multiline-block-like'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
blankLine: 'always',
|
|
128
|
+
prev: ['multiline-block-like'],
|
|
129
|
+
next: ['*'],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
blankLine: 'any',
|
|
133
|
+
prev: ['case'],
|
|
134
|
+
next: ['case'],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
blankLine: 'any',
|
|
138
|
+
next: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
139
|
+
prev: ['cjs-import'],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
'prefer-const': ['error', {
|
|
143
|
+
destructuring: 'all',
|
|
144
|
+
}],
|
|
145
|
+
'prefer-destructuring': ['error'],
|
|
146
|
+
radix: ['error', 'as-needed'],
|
|
147
|
+
'space-before-function-paren': 'off',
|
|
148
|
+
strict: ['error'],
|
|
149
|
+
'use-isnan': ['error'],
|
|
150
|
+
'valid-typeof': ['error'],
|
|
151
|
+
},
|
|
152
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
rules: {
|
|
4
|
+
'jsdoc/check-param-names': ['error'],
|
|
5
|
+
'jsdoc/check-tag-names': ['error'],
|
|
6
|
+
'jsdoc/no-undefined-types': 'off',
|
|
7
|
+
'jsdoc/require-param': ['error', {
|
|
8
|
+
enableRestElementFixer: false,
|
|
9
|
+
enableRootFixer: false,
|
|
10
|
+
}],
|
|
11
|
+
'jsdoc/require-jsdoc': ['off'],
|
|
12
|
+
'jsdoc/require-param-description': 'off',
|
|
13
|
+
'jsdoc/require-param-type': ['error'],
|
|
14
|
+
'jsdoc/require-property-description': 'off',
|
|
15
|
+
'jsdoc/require-returns': ['error', {
|
|
16
|
+
contexts: ['TSInterfaceDeclaration', 'TSMethodSignature'],
|
|
17
|
+
forceRequireReturn: true,
|
|
18
|
+
exemptedBy: ['inheritdoc', 'watch'],
|
|
19
|
+
}],
|
|
20
|
+
'jsdoc/require-returns-check': ['error'],
|
|
21
|
+
'jsdoc/require-returns-description': 'off',
|
|
22
|
+
'jsdoc/tag-lines': ['error'],
|
|
23
|
+
'jsdoc/valid-types': 'off',
|
|
24
|
+
'jsdoc/check-types': ['error'],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.RulesRecord} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
rules: {
|
|
4
|
+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
5
|
+
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
6
|
+
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
7
|
+
'@stylistic/arrow-parens': ['error', 'as-needed'],
|
|
8
|
+
'@stylistic/arrow-spacing': ['error'],
|
|
9
|
+
'@stylistic/brace-style': ['error', '1tbs'],
|
|
10
|
+
'@stylistic/comma-dangle': ['error', {
|
|
11
|
+
arrays: 'always-multiline',
|
|
12
|
+
exports: 'always-multiline',
|
|
13
|
+
functions: 'never',
|
|
14
|
+
imports: 'always-multiline',
|
|
15
|
+
objects: 'always-multiline',
|
|
16
|
+
}],
|
|
17
|
+
'@stylistic/comma-spacing': ['error'],
|
|
18
|
+
'@stylistic/computed-property-spacing': ['error'],
|
|
19
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
20
|
+
'@stylistic/eol-last': ['error', 'always'],
|
|
21
|
+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
22
|
+
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
23
|
+
'@stylistic/function-paren-newline': ['error', 'consistent'],
|
|
24
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
25
|
+
'@stylistic/indent': ['error', 4, {
|
|
26
|
+
SwitchCase: 1,
|
|
27
|
+
}],
|
|
28
|
+
'@stylistic/key-spacing': ['error'],
|
|
29
|
+
'@stylistic/keyword-spacing': ['error'],
|
|
30
|
+
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
31
|
+
'@stylistic/lines-between-class-members': ['error', 'always', {
|
|
32
|
+
exceptAfterSingleLine: true,
|
|
33
|
+
}],
|
|
34
|
+
'@stylistic/max-len': ['error', 120, {
|
|
35
|
+
ignoreComments: true,
|
|
36
|
+
ignoreRegExpLiterals: true,
|
|
37
|
+
ignoreStrings: true,
|
|
38
|
+
ignoreTemplateLiterals: true,
|
|
39
|
+
ignoreTrailingComments: true,
|
|
40
|
+
ignoreUrls: true,
|
|
41
|
+
}],
|
|
42
|
+
'@stylistic/max-statements-per-line': ['error', {
|
|
43
|
+
max: 2,
|
|
44
|
+
}],
|
|
45
|
+
'@stylistic/member-delimiter-style': ['error', {
|
|
46
|
+
multiline: {
|
|
47
|
+
requireLast: true,
|
|
48
|
+
},
|
|
49
|
+
singleline: {
|
|
50
|
+
requireLast: false,
|
|
51
|
+
},
|
|
52
|
+
}],
|
|
53
|
+
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
54
|
+
'@stylistic/new-parens': ['error', 'always'],
|
|
55
|
+
'@stylistic/no-extra-parens': ['error', 'all', {
|
|
56
|
+
enforceForArrowConditionals: false,
|
|
57
|
+
nestedBinaryExpressions: false,
|
|
58
|
+
returnAssign: false,
|
|
59
|
+
}],
|
|
60
|
+
'@stylistic/no-extra-semi': ['error'],
|
|
61
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
62
|
+
'@stylistic/no-mixed-operators': ['error', {
|
|
63
|
+
allowSamePrecedence: true,
|
|
64
|
+
groups: [
|
|
65
|
+
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
|
66
|
+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
67
|
+
['&&', '||'],
|
|
68
|
+
['in', 'instanceof'],
|
|
69
|
+
],
|
|
70
|
+
}],
|
|
71
|
+
'@stylistic/no-mixed-spaces-and-tabs': ['error'],
|
|
72
|
+
'@stylistic/no-multi-spaces': ['error'],
|
|
73
|
+
'@stylistic/no-multiple-empty-lines': ['error', {
|
|
74
|
+
max: 1,
|
|
75
|
+
maxEOF: 0,
|
|
76
|
+
}],
|
|
77
|
+
'@stylistic/no-trailing-spaces': ['error'],
|
|
78
|
+
'@stylistic/no-whitespace-before-property': ['error'],
|
|
79
|
+
'@stylistic/object-curly-newline': ['error', {
|
|
80
|
+
consistent: true,
|
|
81
|
+
}],
|
|
82
|
+
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
83
|
+
'@stylistic/padded-blocks': ['error', 'never'],
|
|
84
|
+
'@stylistic/quote-props': ['error', 'as-needed'],
|
|
85
|
+
'@stylistic/quotes': ['error', 'single', {
|
|
86
|
+
avoidEscape: true,
|
|
87
|
+
}],
|
|
88
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
89
|
+
'@stylistic/semi': ['error'],
|
|
90
|
+
'@stylistic/semi-spacing': ['error', {
|
|
91
|
+
after: true,
|
|
92
|
+
before: false,
|
|
93
|
+
}],
|
|
94
|
+
'@stylistic/semi-style': ['error', 'last'],
|
|
95
|
+
'@stylistic/space-before-blocks': ['error'],
|
|
96
|
+
'@stylistic/space-before-function-paren': ['error', {
|
|
97
|
+
anonymous: 'always',
|
|
98
|
+
named: 'always',
|
|
99
|
+
}],
|
|
100
|
+
'@stylistic/space-in-parens': ['error', 'never'],
|
|
101
|
+
'@stylistic/space-infix-ops': ['error'],
|
|
102
|
+
'@stylistic/spaced-comment': ['error', 'always', {
|
|
103
|
+
markers: ['/'],
|
|
104
|
+
}],
|
|
105
|
+
'@stylistic/template-curly-spacing': ['error', 'never'],
|
|
106
|
+
'@stylistic/template-tag-spacing': ['error', 'never'],
|
|
107
|
+
'@stylistic/type-annotation-spacing': ['error'],
|
|
108
|
+
},
|
|
109
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
rules: {
|
|
3
|
+
indent: 'off',
|
|
4
|
+
'no-undef': 'off',
|
|
5
|
+
'@typescript-eslint/comma-dangle': ['error', {
|
|
6
|
+
arrays: 'always-multiline',
|
|
7
|
+
exports: 'always-multiline',
|
|
8
|
+
functions: 'never',
|
|
9
|
+
imports: 'always-multiline',
|
|
10
|
+
objects: 'always-multiline',
|
|
11
|
+
}],
|
|
12
|
+
'no-extra-parens': 'off',
|
|
13
|
+
'@typescript-eslint/no-extra-parens': ['error', 'all', {
|
|
14
|
+
enforceForArrowConditionals: false,
|
|
15
|
+
nestedBinaryExpressions: false,
|
|
16
|
+
returnAssign: false,
|
|
17
|
+
}],
|
|
18
|
+
'@typescript-eslint/space-before-function-paren': ['error', {
|
|
19
|
+
anonymous: 'always',
|
|
20
|
+
named: 'always',
|
|
21
|
+
}],
|
|
22
|
+
'no-unused-vars': 'off',
|
|
23
|
+
'@typescript-eslint/no-unused-vars': ['error'],
|
|
24
|
+
'no-useless-constructor': 'off',
|
|
25
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
26
|
+
'@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],
|
|
27
|
+
'@typescript-eslint/indent': ['error', 4, {
|
|
28
|
+
SwitchCase: 1,
|
|
29
|
+
ignoredNodes: [
|
|
30
|
+
'PropertyDefinition[decorators]',
|
|
31
|
+
'TSUnionType',
|
|
32
|
+
],
|
|
33
|
+
}],
|
|
34
|
+
semi: 'off',
|
|
35
|
+
'@typescript-eslint/semi': ['error', 'always'],
|
|
36
|
+
'@typescript-eslint/no-misused-promises': ['error', {
|
|
37
|
+
checksVoidReturn: { arguments: false },
|
|
38
|
+
}],
|
|
39
|
+
'react/jsx-filename-extension': 'off',
|
|
40
|
+
'no-use-before-define': 'off',
|
|
41
|
+
'@typescript-eslint/no-use-before-define': ['error'],
|
|
42
|
+
'@typescript-eslint/lines-between-class-members': ['error', 'always', {
|
|
43
|
+
exceptAfterSingleLine: true,
|
|
44
|
+
}],
|
|
45
|
+
|
|
46
|
+
// TODO enable after SD-80950
|
|
47
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
48
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
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
|
+
/** @type {import("eslint").Linter.Config} */
|
|
175
|
+
module.exports = {
|
|
176
|
+
rules: {
|
|
177
|
+
...vueRules,
|
|
178
|
+
...vueCSSRules,
|
|
179
|
+
},
|
|
180
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
5
|
+
'airbnb-typescript/base',
|
|
6
|
+
'plugin:jsdoc/recommended',
|
|
7
|
+
'plugin:@cspell/recommended',
|
|
8
|
+
'plugin:jsdoc/recommended-typescript-error',
|
|
9
|
+
'plugin:@typescript-eslint/recommended',
|
|
10
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
11
|
+
require.resolve('./rules/agnostic.cjs'),
|
|
12
|
+
require.resolve('./rules/stylistic.cjs'),
|
|
13
|
+
require.resolve('./rules/jsdoc.cjs'),
|
|
14
|
+
require.resolve('./rules/typescript.cjs'),
|
|
15
|
+
],
|
|
16
|
+
plugins: ['@typescript-eslint'],
|
|
17
|
+
env: {
|
|
18
|
+
browser: true,
|
|
19
|
+
es2021: true,
|
|
20
|
+
},
|
|
21
|
+
parser: '@typescript-eslint/parser',
|
|
22
|
+
parserOptions: {
|
|
23
|
+
ecmaVersion: 'latest',
|
|
24
|
+
sourceType: 'module',
|
|
25
|
+
ecmaFeatures: {
|
|
26
|
+
jsx: true,
|
|
27
|
+
},
|
|
28
|
+
extraFileExtensions: ['.vue'],
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
'jsdoc/require-param': 'off',
|
|
32
|
+
'jsdoc/require-jsdoc': 'off',
|
|
33
|
+
'jsdoc/require-returns': 'off',
|
|
34
|
+
},
|
|
35
|
+
settings: {
|
|
36
|
+
jsdoc: {
|
|
37
|
+
mode: 'typescript',
|
|
38
|
+
tagNamePreference: {
|
|
39
|
+
callback: 'watch',
|
|
40
|
+
desc: 'use',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
package/src/vue3.cjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
extends: [
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
5
|
+
'airbnb-typescript/base',
|
|
6
|
+
'plugin:vue/vue3-recommended',
|
|
7
|
+
'plugin:vue-scoped-css/vue3-recommended',
|
|
8
|
+
'plugin:jsdoc/recommended',
|
|
9
|
+
'plugin:jsdoc/recommended-typescript-error',
|
|
10
|
+
'plugin:@cspell/recommended',
|
|
11
|
+
'@vue/eslint-config-typescript',
|
|
12
|
+
'plugin:@typescript-eslint/recommended',
|
|
13
|
+
require.resolve('./rules/agnostic.cjs'),
|
|
14
|
+
require.resolve('./rules/stylistic.cjs'),
|
|
15
|
+
require.resolve('./rules/jsdoc.cjs'),
|
|
16
|
+
require.resolve('./rules/vue.cjs'),
|
|
17
|
+
require.resolve('./rules/typescript.cjs'),
|
|
18
|
+
],
|
|
19
|
+
plugins: ['@typescript-eslint'],
|
|
20
|
+
env: {
|
|
21
|
+
browser: true,
|
|
22
|
+
},
|
|
23
|
+
parser: 'vue-eslint-parser',
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaVersion: 'latest',
|
|
26
|
+
parser: '@typescript-eslint/parser',
|
|
27
|
+
sourceType: 'module',
|
|
28
|
+
ecmaFeatures: {
|
|
29
|
+
jsx: true,
|
|
30
|
+
},
|
|
31
|
+
extraFileExtensions: ['.vue'],
|
|
32
|
+
},
|
|
33
|
+
};
|