@jeroenpol/eslint-config 1.0.14 → 2.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/CHANGELOG.md +4 -0
- package/configurations/{best-practices.js → best-practices.mjs} +19 -18
- package/configurations/stylistic.mjs +51 -0
- package/eslint.config.mjs +3 -0
- package/index.mjs +24 -0
- package/package.json +14 -14
- package/.eslintrc +0 -7
- package/configurations/stylistic.js +0 -48
- package/index.js +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import sonarjs from 'eslint-plugin-sonarjs';
|
|
2
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
3
|
+
import unusedImports from 'eslint-plugin-unused-imports';
|
|
4
|
+
import tseslint from 'typescript-eslint';
|
|
5
|
+
|
|
6
|
+
export default tseslint.config(tseslint.configs.recommendedTypeChecked,
|
|
7
|
+
{
|
|
8
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.js'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
plugins: { 'sonarjs': sonarjs, 'simple-import-sort': simpleImportSort, 'unused-imports': unusedImports, '@typescript-eslint': tseslint.plugin },
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parserOptions: {
|
|
14
|
+
projectService: true,
|
|
15
|
+
tsconfigRootDir: import.meta.dirname,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
9
18
|
rules: {
|
|
10
19
|
// GENERAL
|
|
11
20
|
'no-unreachable': 'error',
|
|
@@ -41,6 +50,7 @@ module.exports = {
|
|
|
41
50
|
'@typescript-eslint/no-require-imports': 'error',
|
|
42
51
|
'simple-import-sort/imports': 'error',
|
|
43
52
|
'simple-import-sort/exports': 'error',
|
|
53
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
44
54
|
'unused-imports/no-unused-imports': 'error',
|
|
45
55
|
'no-duplicate-imports': 'error',
|
|
46
56
|
'no-useless-constructor': 'off', // duplicate of @typescript-eslint/no-useless-constructor
|
|
@@ -138,14 +148,5 @@ module.exports = {
|
|
|
138
148
|
// ASYNCHRONOUS
|
|
139
149
|
'@typescript-eslint/no-misused-promises': 'error',
|
|
140
150
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
141
|
-
'rxjs-angular/prefer-takeuntil': [ // check if this one is needed (first, take(1))
|
|
142
|
-
'error',
|
|
143
|
-
{
|
|
144
|
-
alias: ['takeUntilDestroyed'],
|
|
145
|
-
checkComplete: true,
|
|
146
|
-
checkDecorators: ['Component'],
|
|
147
|
-
checkDestroy: true,
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
151
|
},
|
|
151
|
-
};
|
|
152
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
2
|
+
|
|
3
|
+
const customized = stylistic.configs.customize({
|
|
4
|
+
semi: true,
|
|
5
|
+
jsx: false,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
{
|
|
10
|
+
plugins: {
|
|
11
|
+
'@stylistic': stylistic,
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
...customized.rules,
|
|
15
|
+
'@stylistic/arrow-parens': ['error', 'always'],
|
|
16
|
+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
17
|
+
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
18
|
+
'@stylistic/brace-style': ['error', '1tbs'],
|
|
19
|
+
'@stylistic/comma-dangle': [
|
|
20
|
+
'error',
|
|
21
|
+
{
|
|
22
|
+
arrays: 'always-multiline',
|
|
23
|
+
objects: 'always-multiline',
|
|
24
|
+
imports: 'always-multiline',
|
|
25
|
+
exports: 'never',
|
|
26
|
+
functions: 'never',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
30
|
+
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
31
|
+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
32
|
+
'@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
|
|
33
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
34
|
+
'@stylistic/max-len': [
|
|
35
|
+
'error',
|
|
36
|
+
{
|
|
37
|
+
code: 120,
|
|
38
|
+
ignoreRegExpLiterals: true,
|
|
39
|
+
ignoreStrings: true,
|
|
40
|
+
ignoreTemplateLiterals: true,
|
|
41
|
+
ignoreUrls: true,
|
|
42
|
+
ignoreComments: true,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
'@stylistic/no-extra-semi': 'error',
|
|
46
|
+
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
|
|
47
|
+
'@stylistic/semi-style': 'error',
|
|
48
|
+
'@stylistic/switch-colon-spacing': 'error',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
];
|
package/index.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import tseslint from 'typescript-eslint';
|
|
2
|
+
import bestPractices from './configurations/best-practices.mjs';
|
|
3
|
+
import stylistic from './configurations/stylistic.mjs';
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
ignores: [
|
|
8
|
+
'**/*.mjs',
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
...bestPractices,
|
|
12
|
+
...stylistic,
|
|
13
|
+
{
|
|
14
|
+
files: ['*.spec.ts'],
|
|
15
|
+
plugins: { '@typescript-eslint': tseslint.plugin },
|
|
16
|
+
rules: {
|
|
17
|
+
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
18
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
19
|
+
'max-lines-per-function': 'off',
|
|
20
|
+
'no-unused-vars': 'error',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
];
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeroenpol/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "ES Lint config made for Angular, configured by Polware",
|
|
5
|
-
"main": "index.
|
|
5
|
+
"main": "index.mjs",
|
|
6
6
|
"exports": {
|
|
7
|
-
".": "./index.
|
|
7
|
+
".": "./index.mjs",
|
|
8
8
|
"./package.json": "./package.json"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {},
|
|
@@ -35,27 +35,27 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/jeroenpol/eslint-config",
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@eslint/eslintrc": "^3.3.0",
|
|
39
|
+
"@eslint/js": "^9.21.0",
|
|
40
|
+
"@stylistic/eslint-plugin": "^4.2.0",
|
|
41
|
+
"@stylistic/eslint-plugin-ts": "^4.2.0",
|
|
40
42
|
"@typescript-eslint/eslint-plugin": "8.8.1",
|
|
41
43
|
"@typescript-eslint/parser": "^8.8.1",
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint-plugin-rxjs-angular": "2.0.1",
|
|
44
|
+
"eslint": "^9.21.0",
|
|
44
45
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
45
|
-
"eslint-plugin-sonarjs": "
|
|
46
|
+
"eslint-plugin-sonarjs": "3.0.2",
|
|
46
47
|
"eslint-plugin-unused-imports": "4.1.4",
|
|
47
48
|
"typescript": "^5.5.4",
|
|
48
49
|
"typescript-eslint": "^8.8.1"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@stylistic/eslint-plugin": ">=
|
|
52
|
-
"@stylistic/eslint-plugin-ts": ">=
|
|
52
|
+
"@stylistic/eslint-plugin": ">=4",
|
|
53
|
+
"@stylistic/eslint-plugin-ts": ">=4",
|
|
53
54
|
"@typescript-eslint/eslint-plugin": ">=8",
|
|
54
55
|
"@typescript-eslint/parser": ">=8",
|
|
55
|
-
"eslint": ">=
|
|
56
|
-
"eslint-plugin-rxjs-angular": ">=2",
|
|
56
|
+
"eslint": ">=9",
|
|
57
57
|
"eslint-plugin-simple-import-sort": ">=12",
|
|
58
|
-
"eslint-plugin-sonarjs": ">=
|
|
58
|
+
"eslint-plugin-sonarjs": ">=3",
|
|
59
59
|
"eslint-plugin-unused-imports": ">=4",
|
|
60
60
|
"typescript": ">=5",
|
|
61
61
|
"typescript-eslint": ">=8"
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": "20"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|
package/.eslintrc
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
2
|
-
const stylistic = require('@stylistic/eslint-plugin');
|
|
3
|
-
|
|
4
|
-
const customized = stylistic.configs.customize({
|
|
5
|
-
semi: true,
|
|
6
|
-
jsx: false,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
plugins: ['@stylistic'],
|
|
11
|
-
rules: {
|
|
12
|
-
...customized.rules,
|
|
13
|
-
'@stylistic/arrow-parens': ['error', 'always'],
|
|
14
|
-
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
15
|
-
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
16
|
-
'@stylistic/brace-style': ['error', '1tbs'],
|
|
17
|
-
'@stylistic/comma-dangle': [
|
|
18
|
-
'error',
|
|
19
|
-
{
|
|
20
|
-
arrays: 'always-multiline',
|
|
21
|
-
objects: 'always-multiline',
|
|
22
|
-
imports: 'always-multiline',
|
|
23
|
-
exports: 'never',
|
|
24
|
-
functions: 'never',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
'@stylistic/dot-location': ['error', 'property'],
|
|
28
|
-
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
29
|
-
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
|
|
30
|
-
'@stylistic/function-paren-newline': ['error', 'multiline-arguments'],
|
|
31
|
-
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
32
|
-
'@stylistic/max-len': [
|
|
33
|
-
'error',
|
|
34
|
-
{
|
|
35
|
-
code: 120,
|
|
36
|
-
ignoreRegExpLiterals: true,
|
|
37
|
-
ignoreStrings: true,
|
|
38
|
-
ignoreTemplateLiterals: true,
|
|
39
|
-
ignoreUrls: true,
|
|
40
|
-
ignoreComments: true,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
'@stylistic/no-extra-semi': 'error',
|
|
44
|
-
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
|
|
45
|
-
'@stylistic/semi-style': 'error',
|
|
46
|
-
'@stylistic/switch-colon-spacing': 'error',
|
|
47
|
-
},
|
|
48
|
-
};
|
package/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: ['@typescript-eslint'],
|
|
3
|
-
rules: { '@typescript-eslint/explicit-member-accessibility': 'off' },
|
|
4
|
-
overrides: [
|
|
5
|
-
{
|
|
6
|
-
files: ['*.ts', '*.tsx', '*.js'],
|
|
7
|
-
parser: '@typescript-eslint/parser',
|
|
8
|
-
parserOptions: {
|
|
9
|
-
ecmaVersion: 2020,
|
|
10
|
-
sourceType: 'module',
|
|
11
|
-
project: ['tsconfig.json'],
|
|
12
|
-
},
|
|
13
|
-
extends: ['./configurations/stylistic.js', './configurations/best-practices.js'],
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
files: ['*.spec.ts'],
|
|
17
|
-
parser: '@typescript-eslint/parser',
|
|
18
|
-
parserOptions: {
|
|
19
|
-
ecmaVersion: 2020,
|
|
20
|
-
sourceType: 'module',
|
|
21
|
-
},
|
|
22
|
-
plugins: [],
|
|
23
|
-
rules: {
|
|
24
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
25
|
-
'max-lines-per-function': 'off',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
};
|