@useinsider/eslint-config 1.0.0-beta.2 → 1.0.0
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 +19 -44
- package/src/dom.cjs +15 -0
- package/src/node.cjs +12 -0
- package/src/rules/{core.cjs → agnostic.cjs} +3 -11
- package/src/rules/stylistic.cjs +0 -5
- package/src/rules/typescript.cjs +11 -1
- package/src/{typescript-dom/index.cjs → typescript.cjs} +8 -10
- package/src/{vue3-typescript/index.cjs → vue3.cjs} +6 -22
- package/README.md +0 -85
- package/src/config/README.md +0 -56
- package/src/dom/README.md +0 -56
- package/src/dom/index.cjs +0 -19
- package/src/node/README.md +0 -56
- package/src/node/index.cjs +0 -18
- package/src/rules/README.md +0 -6
- package/src/typescript/README.md +0 -64
- package/src/typescript/index.cjs +0 -43
- package/src/typescript-dom/README.md +0 -64
- package/src/vue3/README.md +0 -84
- package/src/vue3/index.cjs +0 -28
- package/src/vue3-typescript/README.md +0 -93
- /package/src/{config/index.cjs → config.cjs} +0 -0
package/package.json
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/eslint-config",
|
|
3
|
-
"version": "1.0.0-beta.2",
|
|
4
|
-
"keywords": [
|
|
5
|
-
"useinsider",
|
|
6
|
-
"eslint",
|
|
7
|
-
"eslint-config"
|
|
8
|
-
],
|
|
9
3
|
"author": "Sahin Deniz <sahin.deniz@useinsider.com>",
|
|
10
4
|
"license": "MIT",
|
|
5
|
+
"version": "1.0.0",
|
|
11
6
|
"packageManager": "pnpm@8.11.0",
|
|
12
7
|
"scripts": {
|
|
13
|
-
"lint": "eslint ./",
|
|
14
|
-
"lint:
|
|
15
|
-
"lint:fix": "pnpm lint --fix",
|
|
16
|
-
"release": "semantic-release -e semantic-release-monorepo"
|
|
8
|
+
"lint": "eslint --ext .js,.cjs ./",
|
|
9
|
+
"lint:fix": "pnpm lint --fix"
|
|
17
10
|
},
|
|
18
11
|
"homepage": "https://github.com/useinsider/eslint-config#readme",
|
|
19
12
|
"repository": {
|
|
@@ -24,48 +17,30 @@
|
|
|
24
17
|
"url": "https://github.com/useinsider/eslint-config/issues"
|
|
25
18
|
},
|
|
26
19
|
"exports": {
|
|
27
|
-
".": "./src/node
|
|
28
|
-
"./
|
|
29
|
-
"./
|
|
30
|
-
"./dom": "./src/dom
|
|
31
|
-
"./
|
|
32
|
-
"./
|
|
33
|
-
"./
|
|
34
|
-
"./vue3-typescript": "./src/vue3-typescript/index.cjs"
|
|
20
|
+
".": "./src/node.cjs",
|
|
21
|
+
"./dom": "./src/dom.cjs",
|
|
22
|
+
"./typescript": "./src/typescript.cjs",
|
|
23
|
+
"./typescript-dom": "./src/typescript-dom.cjs",
|
|
24
|
+
"./vue3": "./src/vue3.cjs",
|
|
25
|
+
"./node": "./src/node.cjs",
|
|
26
|
+
"./config": "./src/config.cjs"
|
|
35
27
|
},
|
|
36
28
|
"files": [
|
|
37
29
|
"src/**/*"
|
|
38
30
|
],
|
|
39
|
-
"engines": {
|
|
40
|
-
"node": "^16.0.0 || >=18.0.0"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@cspell/eslint-plugin": "6.19.2",
|
|
44
|
-
"@stylistic/eslint-plugin": "1.4.1",
|
|
45
|
-
"@stylistic/eslint-plugin-migrate": "1.4.1",
|
|
46
|
-
"eslint-config-airbnb-base": "15.0.0",
|
|
47
|
-
"eslint-plugin-import": "2.29.0",
|
|
48
|
-
"eslint-plugin-jsdoc": "46.9.0"
|
|
49
|
-
},
|
|
50
31
|
"devDependencies": {
|
|
32
|
+
"@cspell/eslint-plugin": "8.0.0",
|
|
51
33
|
"@semantic-release/changelog": "6.0.3",
|
|
52
34
|
"@semantic-release/git": "10.0.1",
|
|
35
|
+
"@stylistic/eslint-plugin": "1.4.1",
|
|
36
|
+
"@stylistic/eslint-plugin-migrate": "1.4.1",
|
|
53
37
|
"@types/eslint": "8.44.8",
|
|
54
|
-
"@types/node": "20.10.
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"@rushstack/eslint-patch": ">=1.6.0",
|
|
61
|
-
"@stylistic/eslint-plugin": ">=1.4.1",
|
|
62
|
-
"@stylistic/eslint-plugin-migrate": ">=1.4.1",
|
|
63
|
-
"@typescript-eslint/eslint-plugin": ">=6.13.1",
|
|
64
|
-
"@vue/eslint-config-typescript": ">=12.0.0",
|
|
65
|
-
"eslint": ">=8.54.0",
|
|
66
|
-
"eslint-plugin-vue": ">=9.19.2",
|
|
67
|
-
"eslint-plugin-vue-scoped-css": ">=2.5.1",
|
|
68
|
-
"vue-eslint-parser": ">=9.3.2"
|
|
38
|
+
"@types/node": "20.10.1",
|
|
39
|
+
"eslint": "8.54.0",
|
|
40
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
41
|
+
"eslint-plugin-import": "2.29.0",
|
|
42
|
+
"eslint-plugin-jsdoc": "46.9.0",
|
|
43
|
+
"semantic-release": "22.0.8"
|
|
69
44
|
},
|
|
70
45
|
"publishConfig": {
|
|
71
46
|
"access": "restricted"
|
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
|
+
};
|
|
@@ -13,13 +13,7 @@ module.exports = {
|
|
|
13
13
|
'guard-for-in': 'error',
|
|
14
14
|
'handle-callback-err': ['error'],
|
|
15
15
|
'import/extensions': ['error', {
|
|
16
|
-
css: 'always',
|
|
17
16
|
js: 'never',
|
|
18
|
-
json: 'always',
|
|
19
|
-
jsx: 'never',
|
|
20
|
-
sass: 'always',
|
|
21
|
-
scss: 'always',
|
|
22
|
-
svg: 'always',
|
|
23
17
|
ts: 'never',
|
|
24
18
|
tsx: 'never',
|
|
25
19
|
vue: 'always',
|
|
@@ -68,7 +62,6 @@ module.exports = {
|
|
|
68
62
|
}],
|
|
69
63
|
'no-invalid-regexp': ['error'],
|
|
70
64
|
'no-iterator': ['error'],
|
|
71
|
-
'no-mixed-operators': 'off',
|
|
72
65
|
'no-multi-str': ['error'],
|
|
73
66
|
'no-native-reassign': 'error',
|
|
74
67
|
'no-nested-ternary': ['error'],
|
|
@@ -127,18 +120,18 @@ module.exports = {
|
|
|
127
120
|
},
|
|
128
121
|
{
|
|
129
122
|
blankLine: 'always',
|
|
130
|
-
next: ['multiline-block-like'],
|
|
131
123
|
prev: ['*'],
|
|
124
|
+
next: ['multiline-block-like'],
|
|
132
125
|
},
|
|
133
126
|
{
|
|
134
127
|
blankLine: 'always',
|
|
135
|
-
next: ['*'],
|
|
136
128
|
prev: ['multiline-block-like'],
|
|
129
|
+
next: ['*'],
|
|
137
130
|
},
|
|
138
131
|
{
|
|
139
132
|
blankLine: 'any',
|
|
140
|
-
next: ['case'],
|
|
141
133
|
prev: ['case'],
|
|
134
|
+
next: ['case'],
|
|
142
135
|
},
|
|
143
136
|
{
|
|
144
137
|
blankLine: 'any',
|
|
@@ -151,7 +144,6 @@ module.exports = {
|
|
|
151
144
|
}],
|
|
152
145
|
'prefer-destructuring': ['error'],
|
|
153
146
|
radix: ['error', 'as-needed'],
|
|
154
|
-
semi: 'off',
|
|
155
147
|
'space-before-function-paren': 'off',
|
|
156
148
|
strict: ['error'],
|
|
157
149
|
'use-isnan': ['error'],
|
package/src/rules/stylistic.cjs
CHANGED
|
@@ -24,10 +24,6 @@ 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
|
-
],
|
|
31
27
|
}],
|
|
32
28
|
'@stylistic/key-spacing': ['error'],
|
|
33
29
|
'@stylistic/keyword-spacing': ['error'],
|
|
@@ -57,7 +53,6 @@ module.exports = {
|
|
|
57
53
|
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
58
54
|
'@stylistic/new-parens': ['error', 'always'],
|
|
59
55
|
'@stylistic/no-extra-parens': ['error', 'all', {
|
|
60
|
-
allowParensAfterCommentPattern: '@type',
|
|
61
56
|
enforceForArrowConditionals: false,
|
|
62
57
|
nestedBinaryExpressions: false,
|
|
63
58
|
returnAssign: false,
|
package/src/rules/typescript.cjs
CHANGED
|
@@ -24,7 +24,13 @@ 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': '
|
|
27
|
+
'@typescript-eslint/indent': ['error', 4, {
|
|
28
|
+
SwitchCase: 1,
|
|
29
|
+
ignoredNodes: [
|
|
30
|
+
'PropertyDefinition[decorators]',
|
|
31
|
+
'TSUnionType',
|
|
32
|
+
],
|
|
33
|
+
}],
|
|
28
34
|
semi: 'off',
|
|
29
35
|
'@typescript-eslint/semi': ['error', 'always'],
|
|
30
36
|
'@typescript-eslint/no-misused-promises': ['error', {
|
|
@@ -36,5 +42,9 @@ module.exports = {
|
|
|
36
42
|
'@typescript-eslint/lines-between-class-members': ['error', 'always', {
|
|
37
43
|
exceptAfterSingleLine: true,
|
|
38
44
|
}],
|
|
45
|
+
|
|
46
|
+
// TODO enable after SD-80950
|
|
47
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
48
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
39
49
|
},
|
|
40
50
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
/** @type {import("eslint").Linter.Config} */
|
|
2
2
|
module.exports = {
|
|
3
3
|
extends: [
|
|
4
|
-
require.resolve('
|
|
5
|
-
'airbnb-base',
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
6
5
|
'airbnb-typescript/base',
|
|
7
|
-
'plugin:@cspell/recommended',
|
|
8
6
|
'plugin:jsdoc/recommended',
|
|
7
|
+
'plugin:@cspell/recommended',
|
|
9
8
|
'plugin:jsdoc/recommended-typescript-error',
|
|
10
9
|
'plugin:@typescript-eslint/recommended',
|
|
11
10
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
12
|
-
require.resolve('
|
|
13
|
-
require.resolve('
|
|
14
|
-
require.resolve('
|
|
15
|
-
require.resolve('
|
|
11
|
+
require.resolve('./rules/agnostic.cjs'),
|
|
12
|
+
require.resolve('./rules/stylistic.cjs'),
|
|
13
|
+
require.resolve('./rules/jsdoc.cjs'),
|
|
14
|
+
require.resolve('./rules/typescript.cjs'),
|
|
16
15
|
],
|
|
16
|
+
plugins: ['@typescript-eslint'],
|
|
17
17
|
env: {
|
|
18
18
|
browser: true,
|
|
19
19
|
es2021: true,
|
|
20
20
|
},
|
|
21
|
-
plugins: ['@typescript-eslint'],
|
|
22
21
|
parser: '@typescript-eslint/parser',
|
|
23
22
|
parserOptions: {
|
|
24
23
|
ecmaVersion: 'latest',
|
|
@@ -26,13 +25,12 @@ module.exports = {
|
|
|
26
25
|
ecmaFeatures: {
|
|
27
26
|
jsx: true,
|
|
28
27
|
},
|
|
28
|
+
extraFileExtensions: ['.vue', 'gs'],
|
|
29
29
|
},
|
|
30
30
|
rules: {
|
|
31
31
|
'jsdoc/require-param': 'off',
|
|
32
32
|
'jsdoc/require-jsdoc': 'off',
|
|
33
33
|
'jsdoc/require-returns': 'off',
|
|
34
|
-
'jsdoc/require-param-type': 'off',
|
|
35
|
-
'jsdoc/check-param-names': 'off',
|
|
36
34
|
},
|
|
37
35
|
settings: {
|
|
38
36
|
jsdoc: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @type {import("eslint").Linter.Config} */
|
|
2
2
|
module.exports = {
|
|
3
3
|
extends: [
|
|
4
|
-
require.resolve('
|
|
4
|
+
require.resolve('./base.cjs'),
|
|
5
5
|
'airbnb-typescript/base',
|
|
6
6
|
'plugin:vue/vue3-recommended',
|
|
7
7
|
'plugin:vue-scoped-css/vue3-recommended',
|
|
@@ -10,11 +10,11 @@ module.exports = {
|
|
|
10
10
|
'plugin:@cspell/recommended',
|
|
11
11
|
'@vue/eslint-config-typescript',
|
|
12
12
|
'plugin:@typescript-eslint/recommended',
|
|
13
|
-
require.resolve('
|
|
14
|
-
require.resolve('
|
|
15
|
-
require.resolve('
|
|
16
|
-
require.resolve('
|
|
17
|
-
require.resolve('
|
|
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
18
|
],
|
|
19
19
|
plugins: ['@typescript-eslint'],
|
|
20
20
|
env: {
|
|
@@ -30,20 +30,4 @@ 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
|
-
},
|
|
49
33
|
};
|
package/README.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# ESLint Config
|
|
2
|
-
|
|
3
|
-
## Table of Contents
|
|
4
|
-
- [ESLint Config](#eslint-config)
|
|
5
|
-
- [Table of Contents](#table-of-contents)
|
|
6
|
-
- [Getting Started](#getting-started)
|
|
7
|
-
- [Installation](#installation)
|
|
8
|
-
- [Versioning Policy](#versioning-policy)
|
|
9
|
-
- [Available Configurations](#available-configurations)
|
|
10
|
-
- [Vanilla 🍦](#vanilla-)
|
|
11
|
-
- [Framework-specific](#framework-specific)
|
|
12
|
-
- [⏳ Upcoming Configurations](#-upcoming-configurations)
|
|
13
|
-
- [Contributing](#contributing)
|
|
14
|
-
|
|
15
|
-
## Getting Started
|
|
16
|
-
|
|
17
|
-
To ensure consistency and prevent version conflicts, we recommend adding this
|
|
18
|
-
library as a development dependency with a fixed version. This can be achieved
|
|
19
|
-
using the `-D` and `-E` flags in your package manager commands.
|
|
20
|
-
|
|
21
|
-
### Installation
|
|
22
|
-
|
|
23
|
-
1. **Install as a Development Dependency:**
|
|
24
|
-
- For npm users:
|
|
25
|
-
```bash
|
|
26
|
-
npm install -D -E @useinsider/eslint-config
|
|
27
|
-
```
|
|
28
|
-
- For pnpm users:
|
|
29
|
-
```bash
|
|
30
|
-
pnpm add -D -E @useinsider/eslint-config
|
|
31
|
-
```
|
|
32
|
-
2. **Create an ESLint config file:**
|
|
33
|
-
You'll need an ESLint config file in your projects root directory.
|
|
34
|
-
|
|
35
|
-
You can check the official [ESLint documentation] to get more details.
|
|
36
|
-
3. **Extend the Configuration:**
|
|
37
|
-
Add the following to your `.eslintrc` file to extend the configuration:
|
|
38
|
-
```json5
|
|
39
|
-
{
|
|
40
|
-
"extends": ["@useinsider/eslint-config/dom"],
|
|
41
|
-
// Add the rest of your configuration here
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
[ESLint documentation]: https://eslint.org/docs/latest/use/configure/configuration-files
|
|
46
|
-
|
|
47
|
-
## Versioning Policy
|
|
48
|
-
|
|
49
|
-
This project follows the [Semantic Versioning](https://semver.org) policy.
|
|
50
|
-
|
|
51
|
-
## Available Configurations
|
|
52
|
-
|
|
53
|
-
We provide a variety of configurations to suit different environments and
|
|
54
|
-
frameworks. Here's a list of available configurations:
|
|
55
|
-
|
|
56
|
-
### Vanilla 🍦
|
|
57
|
-
|
|
58
|
-
| Environment | Browser (DOM) | Node |
|
|
59
|
-
| :---------------- | :------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------- |
|
|
60
|
-
| **EcmaScript/JS** | [`@useinsider/eslint-config/dom`](./src/dom#readme) | [`@useinsider/eslint-config`](./src/node#readme)<br>[`@useinsider/eslint-config/node`](./src/node#readme) |
|
|
61
|
-
| **TypeScript** | [`@useinsider/eslint-config/typescript-dom`](./src/typescript-dom#readme) | [`@useinsider/eslint-config/typescript`](./src/typescript#readme) |
|
|
62
|
-
| **Config files** | | [`@useinsider/eslint-config/config`](./src/config#readme) |
|
|
63
|
-
|
|
64
|
-
### Framework-specific
|
|
65
|
-
|
|
66
|
-
| Environment | JavaScript | TypeScript |
|
|
67
|
-
| :---------- | :---------------------------------------------------- | :-------------------------------------------------------------------------- |
|
|
68
|
-
| **Vue 3** | [`@useinsider/eslint-config/vue3`](./src/vue3#readme) | [`@useinsider/eslint-config/vue3-typescript`](./src/vue3-typescript#readme) |
|
|
69
|
-
|
|
70
|
-
### ⏳ Upcoming Configurations
|
|
71
|
-
|
|
72
|
-
Not available yet!
|
|
73
|
-
|
|
74
|
-
| Environment | Browser (DOM) | Node |
|
|
75
|
-
| :---------------- | :---------------------------------------------------------------- | :-------------------------------------------------------- |
|
|
76
|
-
| **Legacy ES5 💀** | [`@useinsider/eslint-config/legacy-dom`](./src/legacy-dom#readme) | [`@useinsider/eslint-config/legacy`](./src/legacy#readme) |
|
|
77
|
-
|
|
78
|
-
| Environment | JavaScript | TypeScript |
|
|
79
|
-
| :---------- | :---------------------------------------------------- | :-------------------------------------------------------------------------- |
|
|
80
|
-
| **Vue 2** | [`@useinsider/eslint-config/vue2`](./src/vue2#readme) | [`@useinsider/eslint-config/vue2-typescript`](./src/vue2-typescript#readme) |
|
|
81
|
-
|
|
82
|
-
## Contributing
|
|
83
|
-
|
|
84
|
-
Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines on
|
|
85
|
-
how to contribute to this project.
|
package/src/config/README.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# @useinsider/eslint-config/config
|
|
2
|
-
|
|
3
|
-
This rule set specifically targets configuration files typically placed at the
|
|
4
|
-
root level of your project. These files are not part of your production build
|
|
5
|
-
but are crucial for maintaining consistent coding standards across your
|
|
6
|
-
development environment.
|
|
7
|
-
|
|
8
|
-
**Examples of such files include:**
|
|
9
|
-
- `.eslintrc.js`
|
|
10
|
-
- `vite.config.ts`
|
|
11
|
-
- `scripts/.../watch-build.js`
|
|
12
|
-
- ...and more.
|
|
13
|
-
|
|
14
|
-
## How to Use
|
|
15
|
-
|
|
16
|
-
To integrate these rules into your project, modify your `.eslintrc` file as
|
|
17
|
-
follows:
|
|
18
|
-
|
|
19
|
-
```js
|
|
20
|
-
/** @type {import("eslint").Linter.Config} */
|
|
21
|
-
module.exports = {
|
|
22
|
-
root: true,
|
|
23
|
-
overrides: [
|
|
24
|
-
{
|
|
25
|
-
// For JavaScript configuration files at root level
|
|
26
|
-
files: ['./*.js', './*.cjs'],
|
|
27
|
-
extends: [
|
|
28
|
-
'@useinsider/eslint-config',
|
|
29
|
-
'@useinsider/eslint-config/config',
|
|
30
|
-
],
|
|
31
|
-
// Add additional configurations here
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
// For TypeScript configuration files, including those in 'scripts' directory
|
|
36
|
-
files: ['./*.ts', './scripts/**/*.ts'],
|
|
37
|
-
extends: [
|
|
38
|
-
'@useinsider/eslint-config',
|
|
39
|
-
'@useinsider/eslint-config/typescript',
|
|
40
|
-
'@useinsider/eslint-config/config',
|
|
41
|
-
],
|
|
42
|
-
parserOptions: {
|
|
43
|
-
// Required for '@typescript-eslint/parser'
|
|
44
|
-
project: ['./tsconfig.json'],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
};
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
<blockquote>
|
|
52
|
-
<p>[!NOTE]<br>
|
|
53
|
-
Ensure that the <code>parserOptions.project</code> path correctly points to
|
|
54
|
-
your <code>tsconfig.json</code> file to enable TypeScript linting.
|
|
55
|
-
</p>
|
|
56
|
-
</blockquote>
|
package/src/dom/README.md
DELETED
|
@@ -1,56 +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-plugin-jsdoc \
|
|
27
|
-
@cspell/eslint-plugin
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install -E -D \
|
|
32
|
-
eslint-config-airbnb-base \
|
|
33
|
-
eslint-plugin-jsdoc \
|
|
34
|
-
@cspell/eslint-plugin
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
To integrate these rules into your project, modify your `.eslintrc` file as
|
|
40
|
-
follows:
|
|
41
|
-
|
|
42
|
-
```js
|
|
43
|
-
/** @type {import("eslint").Linter.Config} */
|
|
44
|
-
module.exports = {
|
|
45
|
-
root: true,
|
|
46
|
-
overrides: [
|
|
47
|
-
{
|
|
48
|
-
files: ['./src/**/*.js'],
|
|
49
|
-
extends: [
|
|
50
|
-
'@useinsider/eslint-config/dom',
|
|
51
|
-
],
|
|
52
|
-
// Add additional configuration settings as needed
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
};
|
|
56
|
-
```
|
package/src/dom/index.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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/core.cjs'),
|
|
9
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
10
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
11
|
-
],
|
|
12
|
-
env: {
|
|
13
|
-
browser: true,
|
|
14
|
-
es2021: true,
|
|
15
|
-
},
|
|
16
|
-
parserOptions: {
|
|
17
|
-
ecmaVersion: 'latest',
|
|
18
|
-
},
|
|
19
|
-
};
|
package/src/node/README.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# @useinsider/eslint-config/node
|
|
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-plugin-jsdoc \
|
|
28
|
-
@cspell/eslint-plugin
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install -E -D \
|
|
33
|
-
eslint-config-airbnb-base \
|
|
34
|
-
eslint-plugin-jsdoc \
|
|
35
|
-
@cspell/eslint-plugin
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Usage
|
|
39
|
-
|
|
40
|
-
To integrate these rules into your project, modify your `.eslintrc` file as
|
|
41
|
-
follows:
|
|
42
|
-
|
|
43
|
-
```js
|
|
44
|
-
module.exports = {
|
|
45
|
-
root: true,
|
|
46
|
-
overrides: [
|
|
47
|
-
{
|
|
48
|
-
files: ['./src/**/*.{js,cjs,mjs}'],
|
|
49
|
-
extends: [
|
|
50
|
-
'@useinsider/eslint-config',
|
|
51
|
-
],
|
|
52
|
-
// Additional configuration here
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
};
|
|
56
|
-
```
|
package/src/node/index.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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/core.cjs'),
|
|
9
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
10
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
11
|
-
],
|
|
12
|
-
env: {
|
|
13
|
-
node: true,
|
|
14
|
-
},
|
|
15
|
-
parserOptions: {
|
|
16
|
-
ecmaVersion: 'latest',
|
|
17
|
-
},
|
|
18
|
-
};
|
package/src/rules/README.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# Rules
|
|
2
|
-
|
|
3
|
-
Each file contains only the rules that are specific to its name.
|
|
4
|
-
When a new plugin is introduced, its rule file must be named after the plugin
|
|
5
|
-
and it should only contain rules that are specific to it. Even if it suppresses
|
|
6
|
-
a core rule, oppressed rule must be declared inside the `core.cjs` file.
|
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
|
-
@cspell/eslint-plugin \
|
|
38
|
-
eslint-plugin-jsdoc \
|
|
39
|
-
@typescript-eslint/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,43 +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/stylistic.cjs'),
|
|
14
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
15
|
-
require.resolve('../rules/typescript.cjs'),
|
|
16
|
-
],
|
|
17
|
-
env: {
|
|
18
|
-
node: true,
|
|
19
|
-
es2021: true,
|
|
20
|
-
},
|
|
21
|
-
plugins: ['@typescript-eslint'],
|
|
22
|
-
parser: '@typescript-eslint/parser',
|
|
23
|
-
parserOptions: {
|
|
24
|
-
ecmaVersion: 'latest',
|
|
25
|
-
sourceType: 'module',
|
|
26
|
-
},
|
|
27
|
-
rules: {
|
|
28
|
-
'jsdoc/require-param': 'off',
|
|
29
|
-
'jsdoc/require-jsdoc': 'off',
|
|
30
|
-
'jsdoc/require-returns': 'off',
|
|
31
|
-
'jsdoc/require-param-type': 'off',
|
|
32
|
-
'jsdoc/check-param-names': 'off',
|
|
33
|
-
},
|
|
34
|
-
settings: {
|
|
35
|
-
jsdoc: {
|
|
36
|
-
mode: 'typescript',
|
|
37
|
-
tagNamePreference: {
|
|
38
|
-
callback: 'watch',
|
|
39
|
-
desc: 'use',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
@@ -1,64 +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
|
-
```
|
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
|
package/src/vue3/index.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
extends: [
|
|
4
|
-
require.resolve('../base.cjs'),
|
|
5
|
-
'airbnb-base',
|
|
6
|
-
'plugin:vue/vue3-recommended',
|
|
7
|
-
'plugin:vue-scoped-css/vue3-recommended',
|
|
8
|
-
'plugin:jsdoc/recommended',
|
|
9
|
-
'plugin:@cspell/recommended',
|
|
10
|
-
require.resolve('../rules/core.cjs'),
|
|
11
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
12
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
13
|
-
require.resolve('../rules/vue.cjs'),
|
|
14
|
-
],
|
|
15
|
-
env: {
|
|
16
|
-
browser: true,
|
|
17
|
-
es2021: true,
|
|
18
|
-
},
|
|
19
|
-
parser: 'vue-eslint-parser',
|
|
20
|
-
parserOptions: {
|
|
21
|
-
ecmaVersion: 'latest',
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
ecmaFeatures: {
|
|
24
|
-
jsx: true,
|
|
25
|
-
},
|
|
26
|
-
extraFileExtensions: ['.vue'],
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# @useinsider/eslint-config/vue3-typescript
|
|
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
|
-
TypeScript support, 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-config-airbnb-typescript \
|
|
28
|
-
eslint-plugin-vue \
|
|
29
|
-
eslint-plugin-vue-scoped-css \
|
|
30
|
-
eslint-plugin-jsdoc \
|
|
31
|
-
@cspell/eslint-plugin \
|
|
32
|
-
@vue/eslint-config-typescript \
|
|
33
|
-
@typescript-eslint/eslint-plugin \
|
|
34
|
-
vue-eslint-parser
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm install -E -D \
|
|
39
|
-
eslint-config-airbnb-base \
|
|
40
|
-
eslint-config-airbnb-typescript \
|
|
41
|
-
eslint-plugin-vue \
|
|
42
|
-
eslint-plugin-vue-scoped-css \
|
|
43
|
-
eslint-plugin-jsdoc \
|
|
44
|
-
@cspell/eslint-plugin \
|
|
45
|
-
@vue/eslint-config-typescript \
|
|
46
|
-
@typescript-eslint/eslint-plugin \
|
|
47
|
-
vue-eslint-parser
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Usage
|
|
51
|
-
|
|
52
|
-
To use this ESLint configuration in your Vue 3 project, update your `.eslintrc`
|
|
53
|
-
file as follows:
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
/** @type {import("eslint").Linter.Config} */
|
|
57
|
-
module.exports = {
|
|
58
|
-
root: true,
|
|
59
|
-
overrides: [
|
|
60
|
-
{
|
|
61
|
-
files: ['./src/**/*.vue'],
|
|
62
|
-
extends: [
|
|
63
|
-
'@useinsider/eslint-config/vue3',
|
|
64
|
-
],
|
|
65
|
-
parserOptions: {
|
|
66
|
-
project: ['./tsconfig.json'],
|
|
67
|
-
},
|
|
68
|
-
// Add additional configuration settings as needed
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
};
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Remember, you can always override specific rules or add additional plugins as
|
|
75
|
-
per your project's requirements.
|
|
76
|
-
|
|
77
|
-
## Reusable config limitation
|
|
78
|
-
|
|
79
|
-
Before [ESLint Flat Config] becomes stable, in order to work around a
|
|
80
|
-
[known limitation in ESLint], we recommend you to use this package alongside
|
|
81
|
-
[@rushstack/eslint-patch], so that you don't have to install too many
|
|
82
|
-
dependencies:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
pnpm add -E -D @rushstack/eslint-patch
|
|
86
|
-
```
|
|
87
|
-
```bash
|
|
88
|
-
npm install -E -D @rushstack/eslint-patch
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
[ESLint Flat Config]: https://eslint.org/docs/latest/use/configure/configuration-files-new
|
|
92
|
-
[known limitation in ESLint]: https://github.com/eslint/eslint/issues/3458
|
|
93
|
-
[@rushstack/eslint-patch]: https://www.npmjs.com/package/@rushstack/eslint-patch
|
|
File without changes
|