@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/README.md
CHANGED
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
- [Table of Contents](#table-of-contents)
|
|
6
6
|
- [Getting Started](#getting-started)
|
|
7
7
|
- [Installation](#installation)
|
|
8
|
-
- [
|
|
9
|
-
- [Available
|
|
8
|
+
- [Examples](#examples)
|
|
9
|
+
- [Available Presets](#available-presets)
|
|
10
10
|
- [Vanilla 🍦](#vanilla-)
|
|
11
11
|
- [Framework-specific](#framework-specific)
|
|
12
12
|
- [⏳ Upcoming Configurations](#-upcoming-configurations)
|
|
13
|
+
- [Vanilla 🍦](#vanilla--1)
|
|
14
|
+
- [Framework-specific](#framework-specific-1)
|
|
13
15
|
- [Contributing](#contributing)
|
|
14
16
|
|
|
15
17
|
## Getting Started
|
|
@@ -34,50 +36,75 @@ using the `-D` and `-E` flags in your package manager commands.
|
|
|
34
36
|
|
|
35
37
|
You can check the official [ESLint documentation] to get more details.
|
|
36
38
|
3. **Extend the Configuration:**
|
|
37
|
-
Add the following to your
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
Add the following to your `eslint.config.js` file to use the presets:
|
|
40
|
+
```js
|
|
41
|
+
import useInsider from '@useinsider/eslint-config';
|
|
42
|
+
|
|
43
|
+
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
44
|
+
export default [
|
|
45
|
+
await useInsider({
|
|
46
|
+
// See `Available Presets`
|
|
47
|
+
preset: ['dom'],
|
|
48
|
+
config: {
|
|
49
|
+
// Glob file path pattern to specify the target files of the
|
|
50
|
+
// selected presets
|
|
51
|
+
files: ['src/**/*'],
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
await useInsider({
|
|
55
|
+
preset: ['node', 'config'],
|
|
56
|
+
config: {
|
|
57
|
+
files: ['**/eslint.config.js'],
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
];
|
|
43
61
|
```
|
|
62
|
+
4. Adjust your `eslint.config.js` to your projects needs. Choose the right
|
|
63
|
+
preset for the right folder path
|
|
44
64
|
|
|
45
|
-
[ESLint documentation]: https://eslint.org/docs/
|
|
65
|
+
[ESLint documentation]: https://eslint.org/docs/next/use/configure/configuration-files
|
|
46
66
|
|
|
47
|
-
##
|
|
67
|
+
## Examples
|
|
48
68
|
|
|
49
|
-
|
|
69
|
+
Checkout the [examples directory](../../examples) to see various apps with the extended ESLint
|
|
70
|
+
configuration.
|
|
50
71
|
|
|
51
|
-
## Available
|
|
72
|
+
## Available Presets
|
|
52
73
|
|
|
53
74
|
We provide a variety of configurations to suit different environments and
|
|
54
|
-
frameworks. Here's a list of available
|
|
75
|
+
frameworks. Here's a list of available presets:
|
|
55
76
|
|
|
56
77
|
### Vanilla 🍦
|
|
57
78
|
|
|
58
|
-
| Environment | Browser (DOM)
|
|
59
|
-
| :---------------- |
|
|
60
|
-
| **EcmaScript/JS** | [
|
|
61
|
-
| **TypeScript** | [
|
|
62
|
-
| **Config files** |
|
|
79
|
+
| Environment | Browser (DOM) | Node |
|
|
80
|
+
| :---------------- | :------------------------------------------------------ | :---------------------------------------------------------------------------------------------- |
|
|
81
|
+
| **EcmaScript/JS** | [`dom`](./src/configs/dom#readme) | [`@useinsider/eslint-config`](./src/configs/node#readme)<br>[`node`](./src/configs/node#readme) |
|
|
82
|
+
| **TypeScript** | [`typescript-dom`](./src/configs/typescript-dom#readme) | [`typescript`](./src/configs/typescript#readme) |
|
|
83
|
+
| **Config files** | | [`config`](./src/configs/config#readme) |
|
|
63
84
|
|
|
64
85
|
### Framework-specific
|
|
65
86
|
|
|
66
|
-
| Environment | JavaScript
|
|
67
|
-
| :---------- |
|
|
68
|
-
| **Vue 3** | [
|
|
87
|
+
| Environment | JavaScript | TypeScript |
|
|
88
|
+
| :---------- | :---------------------------------- | :-------------------------------------------------------- |
|
|
89
|
+
| **Vue 3** | [`vue3`](./src/configs/vue3#readme) | [`vue3-typescript`](./src/configs/vue3-typescript#readme) |
|
|
90
|
+
|
|
91
|
+
---
|
|
69
92
|
|
|
70
93
|
### ⏳ Upcoming Configurations
|
|
71
94
|
|
|
72
|
-
|
|
95
|
+
Following presets are not available yet!
|
|
96
|
+
|
|
97
|
+
#### Vanilla 🍦
|
|
98
|
+
|
|
99
|
+
| Environment | Browser (DOM) | Node |
|
|
100
|
+
| :---------------- | :---------------------------------------------- | :-------------------------------------- |
|
|
101
|
+
| **Legacy ES5 💀** | [`legacy-dom`](./src/configs/legacy-dom#readme) | [`legacy`](./src/configs/legacy#readme) |
|
|
73
102
|
|
|
74
|
-
|
|
75
|
-
| :---------------- | :---------------------------------------------------------------- | :-------------------------------------------------------- |
|
|
76
|
-
| **Legacy ES5 💀** | [`@useinsider/eslint-config/legacy-dom`](./src/legacy-dom#readme) | [`@useinsider/eslint-config/legacy`](./src/legacy#readme) |
|
|
103
|
+
#### Framework-specific
|
|
77
104
|
|
|
78
|
-
| Environment | JavaScript
|
|
79
|
-
| :---------- |
|
|
80
|
-
| **Vue 2** | [
|
|
105
|
+
| Environment | JavaScript | TypeScript |
|
|
106
|
+
| :---------- | :---------------------------------- | :-------------------------------------------------------- |
|
|
107
|
+
| **Vue 2** | [`vue2`](./src/configs/vue2#readme) | [`vue2-typescript`](./src/configs/vue2-typescript#readme) |
|
|
81
108
|
|
|
82
109
|
## Contributing
|
|
83
110
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0-alpha.6",
|
|
5
5
|
"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.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"useinsider",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"vanilla",
|
|
13
13
|
"typescript",
|
|
14
14
|
"vue",
|
|
15
|
+
"vue2",
|
|
15
16
|
"vue3",
|
|
16
17
|
"node"
|
|
17
18
|
],
|
|
@@ -19,14 +20,20 @@
|
|
|
19
20
|
"license": "MIT",
|
|
20
21
|
"packageManager": "pnpm@8.11.0",
|
|
21
22
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "vite build",
|
|
25
|
+
"emit-types": "tsc --declaration -p tsconfig.lib.json",
|
|
26
|
+
"check-types": "tsc --noEmit -p tsconfig.json",
|
|
27
|
+
"prelint": "pnpm build",
|
|
28
|
+
"lint": "eslint .",
|
|
24
29
|
"lint:fix": "pnpm lint --fix",
|
|
30
|
+
"pretest": "pnpm build",
|
|
25
31
|
"test": "vitest",
|
|
26
32
|
"test:ci": "pnpm test",
|
|
27
|
-
"
|
|
33
|
+
"prerelease": "pnpm build",
|
|
34
|
+
"release": "semantic-release"
|
|
28
35
|
},
|
|
29
|
-
"homepage": "https://github.com/useinsider/config/tree/
|
|
36
|
+
"homepage": "https://github.com/useinsider/config/tree/main/packages/eslint-config#readme",
|
|
30
37
|
"repository": {
|
|
31
38
|
"type": "git",
|
|
32
39
|
"url": "https://github.com/useinsider/config",
|
|
@@ -35,46 +42,63 @@
|
|
|
35
42
|
"bugs": {
|
|
36
43
|
"url": "https://github.com/useinsider/config/issues"
|
|
37
44
|
},
|
|
45
|
+
"main": "./dist/main.js",
|
|
46
|
+
"types": "./dist/main.d.ts",
|
|
38
47
|
"exports": {
|
|
39
|
-
".":
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"./
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
".": {
|
|
49
|
+
"types": "./dist/main.d.ts",
|
|
50
|
+
"import": "./dist/main.js",
|
|
51
|
+
"require": "./dist/main.cjs"
|
|
52
|
+
},
|
|
53
|
+
"./rules/*": {
|
|
54
|
+
"import": "./dist/rules/*.js",
|
|
55
|
+
"require": "./dist/rules/*.cjs"
|
|
56
|
+
}
|
|
47
57
|
},
|
|
48
58
|
"files": [
|
|
49
|
-
"
|
|
59
|
+
"dist"
|
|
50
60
|
],
|
|
51
61
|
"engines": {
|
|
52
|
-
"node": "
|
|
62
|
+
"node": ">=16",
|
|
63
|
+
"pnpm": ">=8"
|
|
53
64
|
},
|
|
54
65
|
"dependencies": {
|
|
55
66
|
"@cspell/eslint-plugin": "6.19.2",
|
|
67
|
+
"@eslint/eslintrc": "3.0.0",
|
|
56
68
|
"@stylistic/eslint-plugin": "1.4.1",
|
|
57
69
|
"@stylistic/eslint-plugin-migrate": "1.4.1",
|
|
58
70
|
"eslint": "8.54.0",
|
|
59
71
|
"eslint-config-airbnb-base": "15.0.0",
|
|
60
72
|
"eslint-plugin-import": "2.29.0",
|
|
61
|
-
"eslint-plugin-jsdoc": "
|
|
73
|
+
"eslint-plugin-jsdoc": "48.0.2",
|
|
74
|
+
"tslib": "2.6.2"
|
|
62
75
|
},
|
|
63
76
|
"devDependencies": {
|
|
77
|
+
"@eslint/js": "8.56.0",
|
|
78
|
+
"@rollup/plugin-typescript": "11.1.5",
|
|
64
79
|
"@semantic-release/changelog": "6.0.3",
|
|
65
80
|
"@semantic-release/git": "10.0.1",
|
|
66
|
-
"@types/eslint": "8.
|
|
81
|
+
"@types/eslint": "8.56.2",
|
|
82
|
+
"@types/eslint__eslintrc": "2.1.1",
|
|
83
|
+
"@types/eslint__js": "8.42.3",
|
|
67
84
|
"@types/fs-extra": "11.0.4",
|
|
68
85
|
"@types/node": "20.10.2",
|
|
69
86
|
"@typescript-eslint/eslint-plugin": "6.13.2",
|
|
70
87
|
"@useinsider/release-config": "workspace:*",
|
|
71
88
|
"@vitest/coverage-v8": "0.34.6",
|
|
72
89
|
"@vue/eslint-config-typescript": "12.0.0",
|
|
90
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
73
91
|
"eslint-plugin-vue": "9.19.2",
|
|
74
92
|
"eslint-plugin-vue-scoped-css": "2.5.1",
|
|
75
93
|
"fs-extra": "11.2.0",
|
|
94
|
+
"globals": "13.24.0",
|
|
95
|
+
"rollup-plugin-typescript-paths": "1.5.0",
|
|
96
|
+
"rollup-plugin-visualizer": "5.11.0",
|
|
76
97
|
"semantic-release": "19.0.5",
|
|
77
98
|
"semantic-release-monorepo": "7.0.5",
|
|
99
|
+
"ts-deepmerge": "7.0.0",
|
|
100
|
+
"vite": "5.0.10",
|
|
101
|
+
"vite-plugin-dts": "3.7.0",
|
|
78
102
|
"vite-tsconfig-paths": "4.2.2",
|
|
79
103
|
"vitest": "0.34.6",
|
|
80
104
|
"vue": "3.3.13",
|
package/src/base.cjs
DELETED
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/config/index.cjs
DELETED
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,20 +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/cspell.cjs'),
|
|
10
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
11
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
12
|
-
],
|
|
13
|
-
env: {
|
|
14
|
-
browser: true,
|
|
15
|
-
es2021: true,
|
|
16
|
-
},
|
|
17
|
-
parserOptions: {
|
|
18
|
-
ecmaVersion: 'latest',
|
|
19
|
-
},
|
|
20
|
-
};
|
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,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/cspell.cjs'),
|
|
10
|
-
require.resolve('../rules/stylistic.cjs'),
|
|
11
|
-
require.resolve('../rules/jsdoc.cjs'),
|
|
12
|
-
],
|
|
13
|
-
env: {
|
|
14
|
-
node: true,
|
|
15
|
-
},
|
|
16
|
-
parserOptions: {
|
|
17
|
-
ecmaVersion: 'latest',
|
|
18
|
-
},
|
|
19
|
-
};
|
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/rules/core.cjs
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
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
|
-
'function-paren-newline': 'off',
|
|
14
|
-
'guard-for-in': 'error',
|
|
15
|
-
'handle-callback-err': ['error'],
|
|
16
|
-
'import/extensions': ['error', {
|
|
17
|
-
css: 'always',
|
|
18
|
-
js: 'never',
|
|
19
|
-
json: 'always',
|
|
20
|
-
jsx: 'never',
|
|
21
|
-
sass: 'always',
|
|
22
|
-
scss: 'always',
|
|
23
|
-
svg: 'always',
|
|
24
|
-
ts: 'never',
|
|
25
|
-
tsx: 'never',
|
|
26
|
-
vue: 'always',
|
|
27
|
-
}],
|
|
28
|
-
'import/no-cycle': 'off',
|
|
29
|
-
'import/no-unresolved': 'off',
|
|
30
|
-
'import/order': ['error', {
|
|
31
|
-
alphabetize: {
|
|
32
|
-
caseInsensitive: true,
|
|
33
|
-
order: 'asc',
|
|
34
|
-
},
|
|
35
|
-
groups: ['index', 'builtin', 'object', 'type', 'external', 'parent', 'internal', 'sibling'],
|
|
36
|
-
pathGroups: [{
|
|
37
|
-
group: 'internal',
|
|
38
|
-
pattern: '@/**',
|
|
39
|
-
}],
|
|
40
|
-
}],
|
|
41
|
-
'import/prefer-default-export': 'off',
|
|
42
|
-
indent: 'off',
|
|
43
|
-
'max-len': 'off',
|
|
44
|
-
'new-cap': ['error'],
|
|
45
|
-
'no-alert': ['error'],
|
|
46
|
-
'no-bitwise': ['error', {
|
|
47
|
-
allow: ['~'],
|
|
48
|
-
}],
|
|
49
|
-
'no-caller': ['error'],
|
|
50
|
-
'no-case-declarations': ['error'],
|
|
51
|
-
'no-confusing-arrow': ['error', {
|
|
52
|
-
allowParens: true,
|
|
53
|
-
}],
|
|
54
|
-
'no-console': ['error'],
|
|
55
|
-
'no-debugger': ['error'],
|
|
56
|
-
'no-div-regex': ['error'],
|
|
57
|
-
'no-dupe-args': ['error'],
|
|
58
|
-
'no-dupe-keys': ['error'],
|
|
59
|
-
'no-duplicate-case': ['error'],
|
|
60
|
-
'no-else-return': ['error'],
|
|
61
|
-
'no-empty': ['error'],
|
|
62
|
-
'no-extra-bind': ['error'],
|
|
63
|
-
'no-extra-boolean-cast': 'error',
|
|
64
|
-
'no-fallthrough': ['error'],
|
|
65
|
-
'no-implicit-coercion': ['error', {
|
|
66
|
-
boolean: true,
|
|
67
|
-
number: true,
|
|
68
|
-
string: true,
|
|
69
|
-
}],
|
|
70
|
-
'implicit-arrow-linebreak': 'off',
|
|
71
|
-
'no-invalid-regexp': ['error'],
|
|
72
|
-
'no-iterator': ['error'],
|
|
73
|
-
'no-mixed-operators': 'off',
|
|
74
|
-
'no-multi-spaces': 'off',
|
|
75
|
-
'no-multi-str': ['error'],
|
|
76
|
-
'no-multiple-empty-lines': 'off',
|
|
77
|
-
'no-native-reassign': 'error',
|
|
78
|
-
'no-nested-ternary': ['error'],
|
|
79
|
-
'no-new': 'off',
|
|
80
|
-
'no-new-object': ['error'],
|
|
81
|
-
'no-new-require': ['error'],
|
|
82
|
-
'no-param-reassign': ['error', {
|
|
83
|
-
props: false,
|
|
84
|
-
}],
|
|
85
|
-
'no-plusplus': 'off',
|
|
86
|
-
'no-process-exit': ['error'],
|
|
87
|
-
'no-promise-executor-return': ['error', {
|
|
88
|
-
allowVoid: true,
|
|
89
|
-
}],
|
|
90
|
-
'no-return-assign': ['error', 'except-parens'],
|
|
91
|
-
'no-self-compare': ['error'],
|
|
92
|
-
'no-sequences': ['error'],
|
|
93
|
-
'no-shadow': ['error', {
|
|
94
|
-
allow: ['state'],
|
|
95
|
-
}],
|
|
96
|
-
'no-undef': ['error'],
|
|
97
|
-
'no-underscore-dangle': 'off',
|
|
98
|
-
'no-unexpected-multiline': ['error'],
|
|
99
|
-
'no-unreachable': ['error'],
|
|
100
|
-
'no-unused-vars': ['error'],
|
|
101
|
-
'no-use-before-define': 'error',
|
|
102
|
-
'no-useless-call': ['error'],
|
|
103
|
-
'no-void': 'off',
|
|
104
|
-
'no-with': ['error'],
|
|
105
|
-
'object-curly-newline': 'off',
|
|
106
|
-
'object-shorthand': ['error', 'always'],
|
|
107
|
-
'padded-blocks': 'off',
|
|
108
|
-
'padding-line-between-statements': [
|
|
109
|
-
'error',
|
|
110
|
-
{
|
|
111
|
-
blankLine: 'always',
|
|
112
|
-
next: '*',
|
|
113
|
-
prev: ['const', 'let', 'var', 'if', 'block-like', 'directive'],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
blankLine: 'always',
|
|
117
|
-
next: ['const', 'let', 'var', 'if', 'directive', 'return', 'break', 'default', 'cjs-export', 'export'],
|
|
118
|
-
prev: '*',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
blankLine: 'any',
|
|
122
|
-
next: ['cjs-export', 'export'],
|
|
123
|
-
prev: ['cjs-export', 'export'],
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
blankLine: 'any',
|
|
127
|
-
next: ['const', 'let', 'var', 'directive'],
|
|
128
|
-
prev: ['const', 'let', 'var', 'directive'],
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
blankLine: 'never',
|
|
132
|
-
next: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
133
|
-
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
blankLine: 'always',
|
|
137
|
-
next: ['multiline-block-like'],
|
|
138
|
-
prev: ['*'],
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
blankLine: 'always',
|
|
142
|
-
next: ['*'],
|
|
143
|
-
prev: ['multiline-block-like'],
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
blankLine: 'any',
|
|
147
|
-
next: ['case'],
|
|
148
|
-
prev: ['case'],
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
blankLine: 'any',
|
|
152
|
-
next: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
153
|
-
prev: ['cjs-import'],
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
'prefer-const': ['error', {
|
|
157
|
-
destructuring: 'all',
|
|
158
|
-
}],
|
|
159
|
-
'prefer-destructuring': ['error'],
|
|
160
|
-
radix: ['error', 'as-needed'],
|
|
161
|
-
semi: 'off',
|
|
162
|
-
'space-before-function-paren': 'off',
|
|
163
|
-
'space-in-parens': 'off',
|
|
164
|
-
strict: ['error'],
|
|
165
|
-
'use-isnan': ['error'],
|
|
166
|
-
'valid-typeof': ['error'],
|
|
167
|
-
},
|
|
168
|
-
};
|