@remcohaszing/eslint 11.0.0 → 11.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/lib/config.js +35 -57
- package/package.json +2 -2
- package/types/config.d.ts +10 -1
- package/types/config.d.ts.map +1 -1
package/lib/config.js
CHANGED
|
@@ -42,9 +42,23 @@ const restrictedImports = [
|
|
|
42
42
|
}
|
|
43
43
|
]
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Move a character in an alphabet string up to the first position.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} string
|
|
49
|
+
* The string to modify
|
|
50
|
+
* @param {string} char
|
|
51
|
+
* The character to unshift.
|
|
52
|
+
* @returns {string}
|
|
53
|
+
* The string, but with the char moved to the first position.
|
|
54
|
+
*/
|
|
55
|
+
function unshiftChar(string, char) {
|
|
56
|
+
const index = string.indexOf(char)
|
|
57
|
+
return `${char}${string.slice(0, index)}${string.slice(index + 1)}`
|
|
58
|
+
}
|
|
59
|
+
|
|
45
60
|
const characters = Alphabet.generateRecommendedAlphabet().getCharacters()
|
|
46
|
-
const
|
|
47
|
-
const alphabet = `/${characters.slice(0, slashIndex)}${characters.slice(slashIndex + 1)}`
|
|
61
|
+
const alphabet = unshiftChar(unshiftChar(characters, '.'), '/')
|
|
48
62
|
|
|
49
63
|
/**
|
|
50
64
|
* Any function declaration whose name starts woth a lower case character.
|
|
@@ -478,7 +492,7 @@ const config = defineConfig([
|
|
|
478
492
|
'jsdoc/check-access': 'error',
|
|
479
493
|
'jsdoc/check-indentation': [
|
|
480
494
|
'error',
|
|
481
|
-
{ excludeTags: ['example', 'param', 'returns', 'throws', 'todo'] }
|
|
495
|
+
{ excludeTags: ['example', 'param', 'property', 'returns', 'throws', 'todo'] }
|
|
482
496
|
],
|
|
483
497
|
'jsdoc/check-line-alignment': ['error', 'never', { wrapIndent: ' ' }],
|
|
484
498
|
'jsdoc/check-param-names': ['error', { checkDestructured: false }],
|
|
@@ -579,25 +593,20 @@ const config = defineConfig([
|
|
|
579
593
|
|
|
580
594
|
// https://perfectionist.dev
|
|
581
595
|
'perfectionist/sort-array-includes': 'error',
|
|
582
|
-
'perfectionist/sort-classes': 'error',
|
|
583
|
-
'perfectionist/sort-exports': [
|
|
584
|
-
'error',
|
|
585
|
-
{
|
|
586
|
-
type: 'custom',
|
|
587
|
-
alphabet
|
|
588
|
-
}
|
|
589
|
-
],
|
|
596
|
+
'perfectionist/sort-classes': ['error', { type: 'unsorted' }],
|
|
597
|
+
'perfectionist/sort-exports': ['error', { type: 'custom', alphabet }],
|
|
590
598
|
'perfectionist/sort-heritage-clauses': 'error',
|
|
591
599
|
'perfectionist/sort-imports': [
|
|
592
600
|
'error',
|
|
593
601
|
{
|
|
594
602
|
type: 'custom',
|
|
595
603
|
alphabet,
|
|
596
|
-
internalPattern: [
|
|
604
|
+
internalPattern: [],
|
|
597
605
|
groups: [
|
|
598
606
|
'side-effect',
|
|
599
607
|
'builtin',
|
|
600
608
|
'external',
|
|
609
|
+
'subpath',
|
|
601
610
|
'internal',
|
|
602
611
|
'parent',
|
|
603
612
|
{ newlinesBetween: 'never' },
|
|
@@ -811,51 +820,6 @@ const config = defineConfig([
|
|
|
811
820
|
'@typescript-eslint/default-param-last': 'error',
|
|
812
821
|
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
|
|
813
822
|
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
|
|
814
|
-
'@typescript-eslint/member-ordering': [
|
|
815
|
-
'error',
|
|
816
|
-
{
|
|
817
|
-
default: [
|
|
818
|
-
'public-static-field',
|
|
819
|
-
'protected-static-field',
|
|
820
|
-
'private-static-field',
|
|
821
|
-
'#private-static-field',
|
|
822
|
-
|
|
823
|
-
'public-decorated-field',
|
|
824
|
-
'protected-decorated-field',
|
|
825
|
-
'private-decorated-field',
|
|
826
|
-
|
|
827
|
-
'public-instance-field',
|
|
828
|
-
'protected-instance-field',
|
|
829
|
-
'private-instance-field',
|
|
830
|
-
'#private-instance-field',
|
|
831
|
-
|
|
832
|
-
'public-abstract-field',
|
|
833
|
-
|
|
834
|
-
'signature',
|
|
835
|
-
|
|
836
|
-
'public-static-method',
|
|
837
|
-
'protected-static-method',
|
|
838
|
-
'private-static-method',
|
|
839
|
-
'#private-static-method',
|
|
840
|
-
|
|
841
|
-
'public-constructor',
|
|
842
|
-
'protected-constructor',
|
|
843
|
-
'private-constructor',
|
|
844
|
-
|
|
845
|
-
'public-decorated-method',
|
|
846
|
-
'protected-decorated-method',
|
|
847
|
-
'private-decorated-method',
|
|
848
|
-
|
|
849
|
-
'public-instance-method',
|
|
850
|
-
'protected-instance-method',
|
|
851
|
-
'private-instance-method',
|
|
852
|
-
'#private-instance-method',
|
|
853
|
-
|
|
854
|
-
'public-abstract-method',
|
|
855
|
-
'protected-abstract-method'
|
|
856
|
-
]
|
|
857
|
-
}
|
|
858
|
-
],
|
|
859
823
|
'@typescript-eslint/method-signature-style': 'error',
|
|
860
824
|
'@typescript-eslint/naming-convention': [
|
|
861
825
|
'error',
|
|
@@ -1040,6 +1004,7 @@ const config = defineConfig([
|
|
|
1040
1004
|
|
|
1041
1005
|
'jsdoc/require-jsdoc': 'off',
|
|
1042
1006
|
|
|
1007
|
+
'n/no-extraneous-import': 'off',
|
|
1043
1008
|
'n/no-unpublished-import': 'off',
|
|
1044
1009
|
'n/no-unpublished-require': 'off',
|
|
1045
1010
|
|
|
@@ -1085,6 +1050,7 @@ export const typechecking = defineConfig([
|
|
|
1085
1050
|
'@typescript-eslint/no-unnecessary-template-expression': 'error',
|
|
1086
1051
|
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
1087
1052
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
1053
|
+
'@typescript-eslint/no-unnecessary-type-conversion': 'error',
|
|
1088
1054
|
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
1089
1055
|
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
1090
1056
|
'@typescript-eslint/no-unsafe-call': 'error',
|
|
@@ -1127,3 +1093,15 @@ export const typechecking = defineConfig([
|
|
|
1127
1093
|
}
|
|
1128
1094
|
}
|
|
1129
1095
|
])
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Define an ESLint configuration that extends the default export.
|
|
1099
|
+
*
|
|
1100
|
+
* @param {Linter.Config | Linter.Config[]} overrides
|
|
1101
|
+
* ESLint configuration overrides.
|
|
1102
|
+
* @returns {Linter.Config[]}
|
|
1103
|
+
* The full ESLint configuration.
|
|
1104
|
+
*/
|
|
1105
|
+
export function define(overrides) {
|
|
1106
|
+
return [...config, ...defineConfig(overrides)]
|
|
1107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remcohaszing/eslint",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "A strict ESLint configuration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"test": "node --test"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.0.0",
|
|
32
33
|
"@eslint/compat": "^1.0.0",
|
|
33
34
|
"@eslint/markdown": "^6.0.0",
|
|
34
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.0.0",
|
|
35
35
|
"@stylistic/eslint-plugin": "^4.0.0",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
37
37
|
"@typescript-eslint/parser": "^8.0.0",
|
package/types/config.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define an ESLint configuration that extends the default export.
|
|
3
|
+
*
|
|
4
|
+
* @param {Linter.Config | Linter.Config[]} overrides
|
|
5
|
+
* ESLint configuration overrides.
|
|
6
|
+
* @returns {Linter.Config[]}
|
|
7
|
+
* The full ESLint configuration.
|
|
8
|
+
*/
|
|
9
|
+
export function define(overrides: Linter.Config | Linter.Config[]): Linter.Config[];
|
|
1
10
|
export default config;
|
|
2
11
|
export const typechecking: Linter.Config<Linter.RulesRecord>[];
|
|
3
|
-
declare const config: Linter.Config<Linter.RulesRecord>[];
|
|
4
12
|
import type { Linter } from 'eslint';
|
|
13
|
+
declare const config: Linter.Config<Linter.RulesRecord>[];
|
|
5
14
|
//# sourceMappingURL=config.d.ts.map
|
package/types/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.js"],"names":[],"mappings":"AAwkCA;;;;;;;GAOG;AACH,kCALW,aAAa,GAAG,aAAa,EAAE,GAE7B,aAAa,EAAE,CAK3B;;AAvFD,+DA2EE;4BArkCuB,QAAQ;AAmEjC,0DAm7BE"}
|