eslint-config-final 1.0.0 → 1.2.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/README.md +21 -2
- package/index.js +32 -6
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# eslint-config
|
|
2
2
|
|
|
3
3
|
```bash
|
|
4
|
-
npm install eslint-config-final
|
|
4
|
+
npm install -D eslint-config-final
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
## Quickstart
|
|
@@ -12,6 +12,7 @@ const tseslint = require('typescript-eslint');
|
|
|
12
12
|
const config = require('eslint-config-final');
|
|
13
13
|
|
|
14
14
|
module.exports = tseslint.config(
|
|
15
|
+
// Javascript
|
|
15
16
|
{
|
|
16
17
|
files: ['**/*.js'],
|
|
17
18
|
|
|
@@ -19,13 +20,31 @@ module.exports = tseslint.config(
|
|
|
19
20
|
...config.javascript,
|
|
20
21
|
],
|
|
21
22
|
},
|
|
23
|
+
|
|
24
|
+
// Typescript
|
|
22
25
|
{
|
|
23
26
|
files: ['**/*.ts'],
|
|
24
27
|
|
|
25
28
|
extends: [
|
|
26
29
|
...config.typescript,
|
|
27
30
|
],
|
|
28
|
-
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
// Angular
|
|
34
|
+
{
|
|
35
|
+
files: ['**/*.ts'],
|
|
36
|
+
|
|
37
|
+
extends: [
|
|
38
|
+
...config.typescript,
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
files: ['**/*.html'],
|
|
43
|
+
|
|
44
|
+
extends: [
|
|
45
|
+
...config.angular,
|
|
46
|
+
],
|
|
47
|
+
},
|
|
29
48
|
);
|
|
30
49
|
|
|
31
50
|
```
|
package/index.js
CHANGED
|
@@ -4,11 +4,11 @@ const tseslint = require('typescript-eslint');
|
|
|
4
4
|
const tsPlugin = require('@typescript-eslint/eslint-plugin');
|
|
5
5
|
const stylistic = require('@stylistic/eslint-plugin');
|
|
6
6
|
const noImplicitAnyFunctionArgs = require('eslint-plugin-no-implicit-any-function-args');
|
|
7
|
+
const angularPlugin = require('angular-eslint');
|
|
8
|
+
const rxjs = require('eslint-plugin-rxjs-updated');
|
|
9
|
+
const rxjsAngular = require('eslint-plugin-rxjs-angular-updated');
|
|
7
10
|
|
|
8
|
-
/** @type {import('typescript-eslint').ConfigWithExtends} */
|
|
9
11
|
const javascript = {
|
|
10
|
-
files: ['**/*.js'],
|
|
11
|
-
|
|
12
12
|
extends: [
|
|
13
13
|
eslint.configs.recommended,
|
|
14
14
|
stylistic.configs.customize({
|
|
@@ -30,6 +30,7 @@ const javascript = {
|
|
|
30
30
|
arrays: 'always-multiline',
|
|
31
31
|
objects: 'always-multiline',
|
|
32
32
|
}],
|
|
33
|
+
'@stylistic/max-statements-per-line': ['off'],
|
|
33
34
|
'@stylistic/quote-props': ['error', 'as-needed'],
|
|
34
35
|
|
|
35
36
|
'sort-imports': ['error', {
|
|
@@ -39,10 +40,7 @@ const javascript = {
|
|
|
39
40
|
},
|
|
40
41
|
};
|
|
41
42
|
|
|
42
|
-
/** @type {import('typescript-eslint').ConfigWithExtends} */
|
|
43
43
|
const typescript = {
|
|
44
|
-
files: ['**/*.ts'],
|
|
45
|
-
|
|
46
44
|
extends: [
|
|
47
45
|
...javascript.extends,
|
|
48
46
|
...tseslint.configs.recommended,
|
|
@@ -77,7 +75,35 @@ const typescript = {
|
|
|
77
75
|
},
|
|
78
76
|
};
|
|
79
77
|
|
|
78
|
+
const angularTypescript = {
|
|
79
|
+
extends: [
|
|
80
|
+
...angularPlugin.configs.tsRecommended,
|
|
81
|
+
rxjs.configs.recommended,
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
plugins: {
|
|
85
|
+
rxjs,
|
|
86
|
+
'rxjs-angular': rxjsAngular,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
rules: {
|
|
90
|
+
'rxjs/no-nested-subscribe': 'off',
|
|
91
|
+
'rxjs/no-unsafe-catch': 'error',
|
|
92
|
+
'rxjs/no-unsafe-switchmap': 'error',
|
|
93
|
+
'rxjs/no-unsafe-takeuntil': 'error',
|
|
94
|
+
|
|
95
|
+
'rxjs-angular/prefer-takeuntil': 'error',
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const angularHtml = {
|
|
100
|
+
extends: [
|
|
101
|
+
...angularPlugin.configs.templateRecommended,
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
|
|
80
105
|
module.exports = {
|
|
81
106
|
javascript: tseslint.config(javascript),
|
|
82
107
|
typescript: tseslint.config(typescript),
|
|
108
|
+
angular: tseslint.config(angularTypescript, angularHtml),
|
|
83
109
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-final",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
"@eslint/js": "^9.11.0",
|
|
17
17
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
18
18
|
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
|
19
|
+
"angular-eslint": "^18.3.1",
|
|
19
20
|
"eslint-plugin-no-implicit-any-function-args": "^1.4.1",
|
|
21
|
+
"eslint-plugin-rxjs-angular-updated": "^1.0.7",
|
|
22
|
+
"eslint-plugin-rxjs-updated": "^1.0.7",
|
|
20
23
|
"typescript-eslint": "^8.6.0"
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|