@useinsider/eslint-config 1.2.0 → 1.3.0-alpha.6
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 +55 -28
- package/package.json +41 -17
- package/src/base.cjs +0 -10
- package/src/config/README.md +0 -56
- package/src/config/index.cjs +0 -7
- package/src/dom/README.md +0 -56
- package/src/dom/index.cjs +0 -20
- package/src/node/README.md +0 -56
- package/src/node/index.cjs +0 -19
- package/src/rules/README.md +0 -6
- package/src/rules/core.cjs +0 -168
- package/src/rules/cspell.cjs +0 -6
- package/src/rules/jsdoc.cjs +0 -26
- package/src/rules/stylistic.cjs +0 -118
- package/src/rules/typescript.cjs +0 -33
- package/src/rules/vue.cjs +0 -172
- package/src/typescript/README.md +0 -64
- package/src/typescript/index.cjs +0 -44
- package/src/typescript-dom/README.md +0 -85
- package/src/typescript-dom/index.cjs +0 -47
- package/src/vue3/README.md +0 -84
- package/src/vue3/index.cjs +0 -29
- package/src/vue3-typescript/README.md +0 -93
- package/src/vue3-typescript/index.cjs +0 -50
package/src/rules/jsdoc.cjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
};
|
package/src/rules/stylistic.cjs
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
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
|
-
enums: 'always-multiline',
|
|
17
|
-
generics: 'always-multiline',
|
|
18
|
-
tuples: 'always-multiline',
|
|
19
|
-
}],
|
|
20
|
-
'@stylistic/comma-spacing': ['error'],
|
|
21
|
-
'@stylistic/computed-property-spacing': ['error'],
|
|
22
|
-
'@stylistic/dot-location': ['error', 'property'],
|
|
23
|
-
'@stylistic/eol-last': ['error', 'always'],
|
|
24
|
-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
25
|
-
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
26
|
-
'@stylistic/function-paren-newline': ['error', 'consistent'],
|
|
27
|
-
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
28
|
-
'@stylistic/indent': ['error', 4, {
|
|
29
|
-
SwitchCase: 1,
|
|
30
|
-
ignoredNodes: [
|
|
31
|
-
'PropertyDefinition[decorators]',
|
|
32
|
-
'TSUnionType',
|
|
33
|
-
],
|
|
34
|
-
}],
|
|
35
|
-
'@stylistic/key-spacing': ['error'],
|
|
36
|
-
'@stylistic/keyword-spacing': ['error'],
|
|
37
|
-
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
38
|
-
'@stylistic/lines-between-class-members': ['error', 'always', {
|
|
39
|
-
exceptAfterSingleLine: true,
|
|
40
|
-
}],
|
|
41
|
-
'@stylistic/max-len': ['error', 120, {
|
|
42
|
-
ignoreComments: true,
|
|
43
|
-
ignoreRegExpLiterals: true,
|
|
44
|
-
ignoreStrings: true,
|
|
45
|
-
ignoreTemplateLiterals: true,
|
|
46
|
-
ignoreTrailingComments: true,
|
|
47
|
-
ignoreUrls: true,
|
|
48
|
-
}],
|
|
49
|
-
'@stylistic/max-statements-per-line': ['error', {
|
|
50
|
-
max: 2,
|
|
51
|
-
}],
|
|
52
|
-
'@stylistic/member-delimiter-style': ['error', {
|
|
53
|
-
multiline: {
|
|
54
|
-
requireLast: true,
|
|
55
|
-
},
|
|
56
|
-
singleline: {
|
|
57
|
-
requireLast: false,
|
|
58
|
-
},
|
|
59
|
-
}],
|
|
60
|
-
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
61
|
-
'@stylistic/new-parens': ['error', 'always'],
|
|
62
|
-
'@stylistic/no-extra-parens': ['error', 'all', {
|
|
63
|
-
allowParensAfterCommentPattern: '@type',
|
|
64
|
-
enforceForArrowConditionals: false,
|
|
65
|
-
nestedBinaryExpressions: false,
|
|
66
|
-
returnAssign: false,
|
|
67
|
-
}],
|
|
68
|
-
'@stylistic/no-extra-semi': ['error'],
|
|
69
|
-
'@stylistic/no-floating-decimal': 'error',
|
|
70
|
-
'@stylistic/no-mixed-operators': ['error', {
|
|
71
|
-
allowSamePrecedence: true,
|
|
72
|
-
groups: [
|
|
73
|
-
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
|
74
|
-
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
75
|
-
['&&', '||'],
|
|
76
|
-
['in', 'instanceof'],
|
|
77
|
-
],
|
|
78
|
-
}],
|
|
79
|
-
'@stylistic/no-mixed-spaces-and-tabs': ['error'],
|
|
80
|
-
'@stylistic/no-multi-spaces': ['error'],
|
|
81
|
-
'@stylistic/no-multiple-empty-lines': ['error', {
|
|
82
|
-
max: 1,
|
|
83
|
-
maxEOF: 0,
|
|
84
|
-
}],
|
|
85
|
-
'@stylistic/no-trailing-spaces': ['error'],
|
|
86
|
-
'@stylistic/no-whitespace-before-property': ['error'],
|
|
87
|
-
'@stylistic/object-curly-newline': ['error', {
|
|
88
|
-
consistent: true,
|
|
89
|
-
}],
|
|
90
|
-
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
91
|
-
'@stylistic/padded-blocks': ['error', 'never'],
|
|
92
|
-
'@stylistic/quote-props': ['error', 'as-needed'],
|
|
93
|
-
'@stylistic/quotes': ['error', 'single', {
|
|
94
|
-
avoidEscape: true,
|
|
95
|
-
}],
|
|
96
|
-
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
97
|
-
'@stylistic/semi': ['error'],
|
|
98
|
-
'@stylistic/semi-spacing': ['error', {
|
|
99
|
-
after: true,
|
|
100
|
-
before: false,
|
|
101
|
-
}],
|
|
102
|
-
'@stylistic/semi-style': ['error', 'last'],
|
|
103
|
-
'@stylistic/space-before-blocks': ['error'],
|
|
104
|
-
'@stylistic/space-before-function-paren': ['error', {
|
|
105
|
-
anonymous: 'always',
|
|
106
|
-
named: 'always',
|
|
107
|
-
}],
|
|
108
|
-
'@stylistic/space-in-parens': ['error', 'never'],
|
|
109
|
-
'@stylistic/space-infix-ops': ['error'],
|
|
110
|
-
'@stylistic/spaced-comment': ['error', 'always', {
|
|
111
|
-
markers: ['/'],
|
|
112
|
-
}],
|
|
113
|
-
'@stylistic/template-curly-spacing': ['error', 'never'],
|
|
114
|
-
'@stylistic/template-tag-spacing': ['error', 'never'],
|
|
115
|
-
'@stylistic/type-annotation-spacing': ['error'],
|
|
116
|
-
'@stylistic/type-generic-spacing': ['error'],
|
|
117
|
-
},
|
|
118
|
-
};
|
package/src/rules/typescript.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const overriddenRules = {
|
|
2
|
-
indent: 'off',
|
|
3
|
-
'no-undef': 'off',
|
|
4
|
-
'no-shadow': 'off',
|
|
5
|
-
'@typescript-eslint/comma-dangle': 'off',
|
|
6
|
-
'no-extra-parens': 'off',
|
|
7
|
-
'@typescript-eslint/no-extra-parens': 'off',
|
|
8
|
-
'@typescript-eslint/space-before-function-paren': 'off',
|
|
9
|
-
'no-unused-vars': 'off',
|
|
10
|
-
'no-useless-constructor': 'off',
|
|
11
|
-
'@typescript-eslint/indent': 'off',
|
|
12
|
-
semi: 'off',
|
|
13
|
-
'@typescript-eslint/semi': 'off',
|
|
14
|
-
'react/jsx-filename-extension': 'off',
|
|
15
|
-
'no-use-before-define': 'off',
|
|
16
|
-
'@typescript-eslint/lines-between-class-members': 'off',
|
|
17
|
-
'@typescript-eslint/comma-spacing': 'off',
|
|
18
|
-
'@typescript-eslint/space-before-blocks': 'off',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
module.exports = {
|
|
22
|
-
rules: {
|
|
23
|
-
...overriddenRules,
|
|
24
|
-
'@typescript-eslint/no-shadow': 'error',
|
|
25
|
-
'@typescript-eslint/no-unused-vars': ['error'],
|
|
26
|
-
'@typescript-eslint/no-useless-constructor': ['error'],
|
|
27
|
-
'@typescript-eslint/array-type': ['error', { default: 'array', readonly: 'array' }],
|
|
28
|
-
'@typescript-eslint/no-misused-promises': ['error', {
|
|
29
|
-
checksVoidReturn: { arguments: false },
|
|
30
|
-
}],
|
|
31
|
-
'@typescript-eslint/no-use-before-define': ['error'],
|
|
32
|
-
},
|
|
33
|
-
};
|
package/src/rules/vue.cjs
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
rules: {
|
|
4
|
-
'vue/array-bracket-newline': ['error'],
|
|
5
|
-
'vue/array-bracket-spacing': ['error', 'never'],
|
|
6
|
-
'vue/array-element-newline': ['error', 'consistent'],
|
|
7
|
-
'vue/arrow-spacing': ['error'],
|
|
8
|
-
'vue/attribute-hyphenation': ['error', 'always'],
|
|
9
|
-
'vue/attributes-order': ['error', {
|
|
10
|
-
alphabetical: false,
|
|
11
|
-
order: [
|
|
12
|
-
'DEFINITION',
|
|
13
|
-
'LIST_RENDERING',
|
|
14
|
-
'CONDITIONALS',
|
|
15
|
-
'RENDER_MODIFIERS',
|
|
16
|
-
'GLOBAL',
|
|
17
|
-
'UNIQUE',
|
|
18
|
-
'TWO_WAY_BINDING',
|
|
19
|
-
'OTHER_DIRECTIVES',
|
|
20
|
-
'OTHER_ATTR',
|
|
21
|
-
'EVENTS',
|
|
22
|
-
'CONTENT',
|
|
23
|
-
],
|
|
24
|
-
}],
|
|
25
|
-
'vue/brace-style': ['error', '1tbs'],
|
|
26
|
-
'vue/camelcase': ['error', {
|
|
27
|
-
allow: ['^\\$_'],
|
|
28
|
-
}],
|
|
29
|
-
'vue/comma-dangle': ['error', {
|
|
30
|
-
arrays: 'always-multiline',
|
|
31
|
-
exports: 'always-multiline',
|
|
32
|
-
functions: 'never',
|
|
33
|
-
imports: 'always-multiline',
|
|
34
|
-
objects: 'always-multiline',
|
|
35
|
-
}],
|
|
36
|
-
'vue/comma-spacing': ['error'],
|
|
37
|
-
'vue/comma-style': ['error', 'last'],
|
|
38
|
-
'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
39
|
-
'vue/component-name-in-template-casing': ['error', 'PascalCase', {
|
|
40
|
-
registeredComponentsOnly: false,
|
|
41
|
-
ignores: [
|
|
42
|
-
'component',
|
|
43
|
-
'transition',
|
|
44
|
-
],
|
|
45
|
-
}],
|
|
46
|
-
'vue/component-tags-order': ['error', {
|
|
47
|
-
order: [
|
|
48
|
-
'script[setup]',
|
|
49
|
-
'template',
|
|
50
|
-
'script:not([setup])',
|
|
51
|
-
'style',
|
|
52
|
-
],
|
|
53
|
-
}],
|
|
54
|
-
'vue/dot-location': ['error'],
|
|
55
|
-
'vue/dot-notation': ['error'],
|
|
56
|
-
'vue/eqeqeq': ['error'],
|
|
57
|
-
'vue/func-call-spacing': ['error'],
|
|
58
|
-
'vue/html-closing-bracket-newline': ['error', {
|
|
59
|
-
multiline: 'never',
|
|
60
|
-
singleline: 'never',
|
|
61
|
-
}],
|
|
62
|
-
'vue/html-end-tags': ['error'],
|
|
63
|
-
'vue/html-indent': ['error', 4],
|
|
64
|
-
'vue/html-quotes': ['error', 'double'],
|
|
65
|
-
'vue/html-self-closing': ['error'],
|
|
66
|
-
'vue/html-closing-bracket-spacing': ['error'],
|
|
67
|
-
'vue/key-spacing': ['error'],
|
|
68
|
-
'vue/keyword-spacing': ['error'],
|
|
69
|
-
'vue/max-attributes-per-line': ['error', {
|
|
70
|
-
multiline: {
|
|
71
|
-
max: 1,
|
|
72
|
-
},
|
|
73
|
-
singleline: 1,
|
|
74
|
-
}],
|
|
75
|
-
'vue/max-len': ['error', 120, {
|
|
76
|
-
ignoreComments: true,
|
|
77
|
-
ignoreRegExpLiterals: true,
|
|
78
|
-
ignoreTemplateLiterals: true,
|
|
79
|
-
ignoreTrailingComments: true,
|
|
80
|
-
ignoreUrls: true,
|
|
81
|
-
}],
|
|
82
|
-
'vue/multi-word-component-names': 'off',
|
|
83
|
-
'vue/multiline-ternary': ['error', 'always-multiline'],
|
|
84
|
-
'vue/mustache-interpolation-spacing': ['error', 'always'],
|
|
85
|
-
'vue/no-bare-strings-in-template': ['error'],
|
|
86
|
-
'vue/no-console': ['error'],
|
|
87
|
-
'vue/no-constant-condition': ['error'],
|
|
88
|
-
'vue/no-empty-component-block': ['error'],
|
|
89
|
-
'vue/no-empty-pattern': ['error'],
|
|
90
|
-
'vue/no-extra-parens': ['error'],
|
|
91
|
-
'vue/no-irregular-whitespace': ['error'],
|
|
92
|
-
'vue/no-multi-spaces': ['error'],
|
|
93
|
-
'vue/no-multiple-objects-in-class': ['error'],
|
|
94
|
-
'vue/no-potential-component-option-typo': ['error'],
|
|
95
|
-
'vue/no-reserved-component-names': ['error'],
|
|
96
|
-
'vue/no-restricted-syntax': ['error'],
|
|
97
|
-
'vue/no-spaces-around-equal-signs-in-attribute': ['error'],
|
|
98
|
-
'vue/no-sparse-arrays': ['error'],
|
|
99
|
-
'vue/no-undef-components': ['error'],
|
|
100
|
-
'vue/no-unsupported-features': ['error'],
|
|
101
|
-
'vue/no-unused-properties': ['error'],
|
|
102
|
-
'vue/no-unused-refs': ['error'],
|
|
103
|
-
'vue/no-use-computed-property-like-method': ['error'],
|
|
104
|
-
'vue/no-use-v-if-with-v-for': 'error',
|
|
105
|
-
'vue/no-useless-concat': ['error'],
|
|
106
|
-
'vue/no-useless-mustaches': ['error'],
|
|
107
|
-
'vue/no-useless-v-bind': ['error'],
|
|
108
|
-
'vue/no-v-text': ['error'],
|
|
109
|
-
'vue/object-curly-newline': ['error', {
|
|
110
|
-
consistent: true,
|
|
111
|
-
}],
|
|
112
|
-
'vue/object-curly-spacing': ['error', 'always'],
|
|
113
|
-
'vue/object-property-newline': ['error', {
|
|
114
|
-
allowAllPropertiesOnSameLine: true,
|
|
115
|
-
}],
|
|
116
|
-
'vue/object-shorthand': ['error', 'always'],
|
|
117
|
-
'vue/order-in-components': ['error', {
|
|
118
|
-
order: [
|
|
119
|
-
'el',
|
|
120
|
-
'name',
|
|
121
|
-
'parent',
|
|
122
|
-
'functional',
|
|
123
|
-
['delimiters', 'comments'],
|
|
124
|
-
['components', 'directives', 'filters'],
|
|
125
|
-
'extends',
|
|
126
|
-
'mixins',
|
|
127
|
-
'inheritAttrs',
|
|
128
|
-
'model',
|
|
129
|
-
['props', 'propsData'],
|
|
130
|
-
'data',
|
|
131
|
-
'computed',
|
|
132
|
-
'watch',
|
|
133
|
-
'LIFECYCLE_HOOKS',
|
|
134
|
-
'methods',
|
|
135
|
-
['template', 'render'],
|
|
136
|
-
'renderError',
|
|
137
|
-
],
|
|
138
|
-
}],
|
|
139
|
-
'vue/padding-line-between-blocks': ['error'],
|
|
140
|
-
'vue/prefer-separate-static-class': ['error'],
|
|
141
|
-
'vue/prefer-template': ['error'],
|
|
142
|
-
'vue/prefer-true-attribute-shorthand': ['error'],
|
|
143
|
-
'vue/prop-name-casing': ['error', 'camelCase'],
|
|
144
|
-
'vue/quote-props': ['error', 'as-needed'],
|
|
145
|
-
'vue/require-default-prop': ['error'],
|
|
146
|
-
'vue/require-prop-type-constructor': 'error',
|
|
147
|
-
'vue/require-prop-types': ['error'],
|
|
148
|
-
'vue/script-indent': ['error', 4, {
|
|
149
|
-
switchCase: 1,
|
|
150
|
-
}],
|
|
151
|
-
'vue/space-in-parens': ['error', 'never'],
|
|
152
|
-
'vue/space-infix-ops': ['error'],
|
|
153
|
-
'vue/space-unary-ops': ['error'],
|
|
154
|
-
'vue/template-curly-spacing': ['error'],
|
|
155
|
-
'vue/this-in-template': ['error', 'never'],
|
|
156
|
-
'vue/v-bind-style': ['error', 'shorthand'],
|
|
157
|
-
'vue/v-on-function-call': 'off',
|
|
158
|
-
'vue/v-on-style': ['error', 'shorthand'],
|
|
159
|
-
'vue/v-on-event-hyphenation': 'off',
|
|
160
|
-
'vue/no-setup-props-destructure': 'off',
|
|
161
|
-
'vue/block-tag-newline': ['error', {
|
|
162
|
-
singleline: 'always',
|
|
163
|
-
multiline: 'always',
|
|
164
|
-
}],
|
|
165
|
-
'vue/require-explicit-emits': ['error'],
|
|
166
|
-
'vue/no-required-prop-with-default': ['error'],
|
|
167
|
-
'vue/no-ref-object-destructure': ['error'],
|
|
168
|
-
'vue/no-template-target-blank': ['error'],
|
|
169
|
-
'vue/define-emits-declaration': ['error', 'type-based'],
|
|
170
|
-
'vue/define-props-declaration': ['error', 'type-based'],
|
|
171
|
-
},
|
|
172
|
-
};
|
package/src/typescript/README.md
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# @useinsider/eslint-config/typescript
|
|
2
|
-
|
|
3
|
-
This ESLint configuration is ideal for Node.js projects without front-end
|
|
4
|
-
elements or DOM libraries. For mixed back-end and front-end projects, separate
|
|
5
|
-
override blocks or a combined `node` and `dom` setup in a single block are
|
|
6
|
-
possible, but not recommended.
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
Before proceeding, ensure you have ESLint installed in your project.
|
|
11
|
-
If not, install it:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pnpm add -E -D eslint
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install -E -D eslint
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Then, install the ESLint plugins that our configuration extends. These are
|
|
22
|
-
necessary for the configuration to work correctly:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm add -E -D \
|
|
26
|
-
eslint-config-airbnb-base \
|
|
27
|
-
eslint-config-airbnb-typescript \
|
|
28
|
-
@cspell/eslint-plugin \
|
|
29
|
-
eslint-plugin-jsdoc \
|
|
30
|
-
@typescript-eslint/eslint-plugin
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm install -E -D \
|
|
35
|
-
eslint-config-airbnb-base \
|
|
36
|
-
eslint-config-airbnb-typescript \
|
|
37
|
-
@typescript-eslint/eslint-plugin
|
|
38
|
-
eslint-plugin-jsdoc \
|
|
39
|
-
@cspell/eslint-plugin \
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Usage
|
|
43
|
-
|
|
44
|
-
To integrate these rules into your project, modify your `.eslintrc` file as
|
|
45
|
-
follows:
|
|
46
|
-
|
|
47
|
-
```js
|
|
48
|
-
module.exports = {
|
|
49
|
-
root: true,
|
|
50
|
-
overrides: [
|
|
51
|
-
{
|
|
52
|
-
files: ['./src/**/*.ts'],
|
|
53
|
-
extends: [
|
|
54
|
-
'@useinsider/eslint-config/typescript',
|
|
55
|
-
],
|
|
56
|
-
parserOptions: {
|
|
57
|
-
// Required for '@typescript-eslint/parser'
|
|
58
|
-
project: ['./tsconfig.json'],
|
|
59
|
-
},
|
|
60
|
-
// Additional configuration here
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
};
|
|
64
|
-
```
|
package/src/typescript/index.cjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
extends: [
|
|
4
|
-
require.resolve('../base.cjs'),
|
|
5
|
-
'airbnb-base',
|
|
6
|
-
'airbnb-typescript/base',
|
|
7
|
-
'plugin:@cspell/recommended',
|
|
8
|
-
'plugin:jsdoc/recommended',
|
|
9
|
-
'plugin:jsdoc/recommended-typescript-error',
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
12
|
-
require.resolve('../rules/core.cjs'),
|
|
13
|
-
require.resolve('../rules/cspell.cjs'),
|
|
14
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
15
|
-
require.resolve('../rules/typescript.cjs'),
|
|
16
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
17
|
-
],
|
|
18
|
-
env: {
|
|
19
|
-
node: true,
|
|
20
|
-
es2021: true,
|
|
21
|
-
},
|
|
22
|
-
plugins: ['@typescript-eslint'],
|
|
23
|
-
parser: '@typescript-eslint/parser',
|
|
24
|
-
parserOptions: {
|
|
25
|
-
ecmaVersion: 'latest',
|
|
26
|
-
sourceType: 'module',
|
|
27
|
-
},
|
|
28
|
-
rules: {
|
|
29
|
-
'jsdoc/require-param': 'off',
|
|
30
|
-
'jsdoc/require-jsdoc': 'off',
|
|
31
|
-
'jsdoc/require-returns': 'off',
|
|
32
|
-
'jsdoc/require-param-type': 'off',
|
|
33
|
-
'jsdoc/check-param-names': 'off',
|
|
34
|
-
},
|
|
35
|
-
settings: {
|
|
36
|
-
jsdoc: {
|
|
37
|
-
mode: 'typescript',
|
|
38
|
-
tagNamePreference: {
|
|
39
|
-
callback: 'watch',
|
|
40
|
-
desc: 'use',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# @useinsider/eslint-config/dom
|
|
2
|
-
|
|
3
|
-
This configuration is designed for production source files typically located in
|
|
4
|
-
the `src` directory of your project. It provides ESLint rules specifically for
|
|
5
|
-
DOM-related code.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Before proceeding, ensure you have ESLint installed in your project.
|
|
10
|
-
If not, install it:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
pnpm add -E -D eslint
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install -E -D eslint
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Then, install the ESLint plugins that our configuration extends. These are
|
|
21
|
-
necessary for the configuration to work correctly:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
pnpm add -E -D \
|
|
25
|
-
eslint-config-airbnb-base \
|
|
26
|
-
eslint-config-airbnb-typescript \
|
|
27
|
-
@cspell/eslint-plugin \
|
|
28
|
-
eslint-plugin-jsdoc \
|
|
29
|
-
@typescript-eslint/eslint-plugin
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npm install -E -D \
|
|
34
|
-
eslint-config-airbnb-base \
|
|
35
|
-
eslint-config-airbnb-typescript \
|
|
36
|
-
@cspell/eslint-plugin \
|
|
37
|
-
eslint-plugin-jsdoc \
|
|
38
|
-
@typescript-eslint/eslint-plugin
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Usage
|
|
42
|
-
|
|
43
|
-
To integrate these rules into your project, modify your `.eslintrc` file as
|
|
44
|
-
follows:
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
/** @type {import("eslint").Linter.Config} */
|
|
48
|
-
module.exports = {
|
|
49
|
-
root: true,
|
|
50
|
-
overrides: [
|
|
51
|
-
{
|
|
52
|
-
files: ['./src/**/*.ts'],
|
|
53
|
-
extends: [
|
|
54
|
-
'@useinsider/eslint-config/typescript-dom',
|
|
55
|
-
],
|
|
56
|
-
parserOptions: {
|
|
57
|
-
// `project` is necessary for `@typescript-eslint/parser` to work
|
|
58
|
-
project: ['./tsconfig.json'],
|
|
59
|
-
},
|
|
60
|
-
// Add additional configuration settings as needed
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
};
|
|
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.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
extends: [
|
|
4
|
-
require.resolve('../base.cjs'),
|
|
5
|
-
'airbnb-base',
|
|
6
|
-
'airbnb-typescript/base',
|
|
7
|
-
'plugin:@cspell/recommended',
|
|
8
|
-
'plugin:jsdoc/recommended',
|
|
9
|
-
'plugin:jsdoc/recommended-typescript-error',
|
|
10
|
-
'plugin:@typescript-eslint/recommended',
|
|
11
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
12
|
-
require.resolve('../rules/core.cjs'),
|
|
13
|
-
require.resolve('../rules/cspell.cjs'),
|
|
14
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
15
|
-
require.resolve('../rules/typescript.cjs'),
|
|
16
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
17
|
-
],
|
|
18
|
-
env: {
|
|
19
|
-
browser: true,
|
|
20
|
-
es2021: true,
|
|
21
|
-
},
|
|
22
|
-
plugins: ['@typescript-eslint'],
|
|
23
|
-
parser: '@typescript-eslint/parser',
|
|
24
|
-
parserOptions: {
|
|
25
|
-
ecmaVersion: 'latest',
|
|
26
|
-
sourceType: 'module',
|
|
27
|
-
ecmaFeatures: {
|
|
28
|
-
jsx: true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
rules: {
|
|
32
|
-
'jsdoc/require-param': 'off',
|
|
33
|
-
'jsdoc/require-jsdoc': 'off',
|
|
34
|
-
'jsdoc/require-returns': 'off',
|
|
35
|
-
'jsdoc/require-param-type': 'off',
|
|
36
|
-
'jsdoc/check-param-names': 'off',
|
|
37
|
-
},
|
|
38
|
-
settings: {
|
|
39
|
-
jsdoc: {
|
|
40
|
-
mode: 'typescript',
|
|
41
|
-
tagNamePreference: {
|
|
42
|
-
callback: 'watch',
|
|
43
|
-
desc: 'use',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
package/src/vue3/README.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# @useinsider/eslint-config/vue3
|
|
2
|
-
|
|
3
|
-
This package provides a comprehensive ESLint configuration tailored for Vue 3
|
|
4
|
-
projects, ensuring code quality and consistency. It integrates best practices
|
|
5
|
-
from the Vue community and extends various ESLint plugins to cover aspects like
|
|
6
|
-
JSDoc conventions, and scoped CSS in Vue components.
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
Before proceeding, ensure you have ESLint installed in your project.
|
|
11
|
-
If not, install it:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pnpm add -E -D eslint
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install -E -D eslint
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Then, install the ESLint plugins and configurations that our Vue configuration
|
|
22
|
-
extends. These are necessary for the configuration to work correctly:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm add -E -D \
|
|
26
|
-
eslint-config-airbnb-base \
|
|
27
|
-
eslint-plugin-vue \
|
|
28
|
-
eslint-plugin-vue-scoped-css \
|
|
29
|
-
eslint-plugin-jsdoc \
|
|
30
|
-
@cspell/eslint-plugin \
|
|
31
|
-
vue-eslint-parser
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npm install -E -D \
|
|
36
|
-
eslint-config-airbnb-base \
|
|
37
|
-
eslint-plugin-vue \
|
|
38
|
-
eslint-plugin-vue-scoped-css \
|
|
39
|
-
eslint-plugin-jsdoc \
|
|
40
|
-
@cspell/eslint-plugin \
|
|
41
|
-
vue-eslint-parser
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Usage
|
|
45
|
-
|
|
46
|
-
To use this ESLint configuration in your Vue 3 project, update your `.eslintrc`
|
|
47
|
-
file as follows:
|
|
48
|
-
|
|
49
|
-
```js
|
|
50
|
-
/** @type {import("eslint").Linter.Config} */
|
|
51
|
-
module.exports = {
|
|
52
|
-
root: true,
|
|
53
|
-
overrides: [
|
|
54
|
-
{
|
|
55
|
-
files: ['./src/**/*.vue'],
|
|
56
|
-
extends: [
|
|
57
|
-
'@useinsider/eslint-config/vue3',
|
|
58
|
-
],
|
|
59
|
-
// Add additional configuration settings as needed
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
};
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Remember, you can always override specific rules or add additional plugins as
|
|
66
|
-
per your project's requirements.
|
|
67
|
-
|
|
68
|
-
## Reusable config limitation
|
|
69
|
-
|
|
70
|
-
Before [ESLint Flat Config] becomes stable, in order to work around a
|
|
71
|
-
[known limitation in ESLint], we recommend you to use this package alongside
|
|
72
|
-
[@rushstack/eslint-patch], so that you don't have to install too many
|
|
73
|
-
dependencies:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pnpm add -E -D @rushstack/eslint-patch
|
|
77
|
-
```
|
|
78
|
-
```bash
|
|
79
|
-
npm install -E -D @rushstack/eslint-patch
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
[ESLint Flat Config]: https://eslint.org/docs/latest/use/configure/configuration-files-new
|
|
83
|
-
[known limitation in ESLint]: https://github.com/eslint/eslint/issues/3458
|
|
84
|
-
[@rushstack/eslint-patch]: https://www.npmjs.com/package/@rushstack/eslint-patch
|