@ololoepepe/eslint-config-typescript 0.0.9 → 0.0.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ololoepepe/eslint-config-typescript",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "ESLint config for TypeScript",
5
5
  "main": "src/index.js",
6
6
  "imports": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "scripts": {
11
+ "find-rules": "eslint-find-rules --unused ./src/index.js",
11
12
  "lint": "eslint ./src",
12
13
  "test": "mocha ./test/*"
13
14
  },
@@ -30,15 +31,16 @@
30
31
  },
31
32
  "homepage": "https://gitea.void-walkers.com/libs/eslint-config-typescript#README",
32
33
  "dependencies": {
33
- "@typescript-eslint/eslint-plugin": "^8.47.0",
34
- "@typescript-eslint/parser": "^8.47.0",
35
- "eslint": ">=8.57.0",
34
+ "@typescript-eslint/eslint-plugin": "^8.50.1",
35
+ "@typescript-eslint/parser": "^8.50.1",
36
+ "eslint": "^8.57.1",
36
37
  "eslint-import-resolver-typescript": "^4.4.4",
37
38
  "eslint-plugin-import": "^2.32.0",
38
- "eslint-plugin-perfectionist": "^4.15.1",
39
+ "eslint-plugin-perfectionist": "^5.1.0",
39
40
  "eslint-plugin-sort-keys-shorthand": "^2.3.0"
40
41
  },
41
42
  "devDependencies": {
43
+ "eslint-find-rules": "^5.0.0",
42
44
  "mocha": "^11.7.5"
43
45
  }
44
46
  }
@@ -3,6 +3,7 @@ export default {
3
3
  'import/consistent-type-specifier-style': 'off', // TODO: Reconsider if use TS/Flow
4
4
  'import/default': 'error',
5
5
  'import/dynamic-import-chunkname': ['error'],
6
+ 'import/enforce-node-protocol-usage': ['error', 'always'],
6
7
  'import/export': 'error',
7
8
  'import/exports-last': 'off',
8
9
  'import/extensions': 'off',
@@ -1,30 +1,34 @@
1
+ const SORT_OPTIONS = {
2
+ fallbackSort: {
3
+ type: 'unsorted'
4
+ },
5
+ ignoreCase: true,
6
+ locales: 'en-US',
7
+ newlinesBetween: 1,
8
+ order: 'asc',
9
+ partitionByComment: true,
10
+ partitionByNewLine: false,
11
+ specialCharacters: 'keep',
12
+ type: 'natural'
13
+ };
14
+
1
15
  export default {
2
16
  rules: {
3
- 'perfectionist/sort-intersection-types': ['error', {
4
- fallbackSort: {
5
- type: 'unsorted'
6
- },
7
- ignoreCase: true,
8
- locales: 'en-US',
9
- newlinesBetween: 1,
10
- order: 'asc',
11
- partitionByComment: true,
12
- partitionByNewLine: false,
13
- specialCharacters: 'keep',
14
- type: 'alphabetical'
15
- }],
16
- 'perfectionist/sort-union-types': ['error', {
17
- fallbackSort: {
18
- type: 'unsorted'
19
- },
20
- ignoreCase: true,
21
- locales: 'en-US',
22
- newlinesBetween: 1,
23
- order: 'asc',
24
- partitionByComment: true,
25
- partitionByNewLine: false,
26
- specialCharacters: 'keep',
27
- type: 'alphabetical'
28
- }]
17
+ 'perfectionist/sort-array-includes': ['error', SORT_OPTIONS],
18
+ 'perfectionist/sort-enums': ['error', SORT_OPTIONS],
19
+ 'perfectionist/sort-export-attributes': ['error', SORT_OPTIONS],
20
+ 'perfectionist/sort-exports': ['error', SORT_OPTIONS],
21
+ 'perfectionist/sort-heritage-clauses': ['error', SORT_OPTIONS],
22
+ 'perfectionist/sort-import-attributes': ['error', SORT_OPTIONS],
23
+ 'perfectionist/sort-imports': ['error', SORT_OPTIONS],
24
+ 'perfectionist/sort-interfaces': ['error', SORT_OPTIONS],
25
+ 'perfectionist/sort-intersection-types': ['error', SORT_OPTIONS],
26
+ 'perfectionist/sort-maps': ['error', SORT_OPTIONS],
27
+ 'perfectionist/sort-named-exports': ['error', SORT_OPTIONS],
28
+ 'perfectionist/sort-named-imports': ['error', SORT_OPTIONS],
29
+ 'perfectionist/sort-object-types': ['error', SORT_OPTIONS],
30
+ 'perfectionist/sort-objects': ['error', SORT_OPTIONS],
31
+ 'perfectionist/sort-sets': ['error', SORT_OPTIONS],
32
+ 'perfectionist/sort-union-types': ['error', SORT_OPTIONS]
29
33
  }
30
34
  };
@@ -6,7 +6,7 @@ export default {
6
6
  'signature',
7
7
  'readonly-signature',
8
8
 
9
- // Fields
9
+ // Static
10
10
  'public-static-field',
11
11
  'static-field',
12
12
  'public-static-readonly-field',
@@ -20,6 +20,26 @@ export default {
20
20
  '#private-static-field',
21
21
  '#private-static-readonly-field',
22
22
 
23
+ 'static-initialization',
24
+
25
+ 'public-static-get',
26
+ 'static-get',
27
+ 'protected-static-get',
28
+ 'private-static-get',
29
+ '#private-static-get',
30
+
31
+ 'public-static-set',
32
+ 'static-set',
33
+ 'protected-static-set',
34
+ 'private-static-set',
35
+ '#private-static-set',
36
+
37
+ 'public-static-method',
38
+ 'protected-static-method',
39
+ 'private-static-method',
40
+ '#private-static-method',
41
+
42
+ // Fields
23
43
  'public-abstract-field',
24
44
  'abstract-field',
25
45
  'public-abstract-readonly-field',
@@ -59,21 +79,12 @@ export default {
59
79
  '#private-instance-readonly-field',
60
80
  '#private-readonly-field',
61
81
 
62
- // Static initialization
63
- 'static-initialization',
64
-
65
82
  // Constructors
66
83
  'public-constructor',
67
84
  'protected-constructor',
68
85
  'private-constructor',
69
86
 
70
87
  // Getters
71
- 'public-static-get',
72
- 'static-get',
73
- 'protected-static-get',
74
- 'private-static-get',
75
- '#private-static-get',
76
-
77
88
  'public-abstract-get',
78
89
  'abstract-get',
79
90
 
@@ -97,12 +108,6 @@ export default {
97
108
  '#private-get',
98
109
 
99
110
  // Setters
100
- 'public-static-set',
101
- 'static-set',
102
- 'protected-static-set',
103
- 'private-static-set',
104
- '#private-static-set',
105
-
106
111
  'public-abstract-set',
107
112
  'abstract-set',
108
113
 
@@ -126,11 +131,6 @@ export default {
126
131
  '#private-set',
127
132
 
128
133
  // Methods
129
- 'public-static-method',
130
- 'protected-static-method',
131
- 'private-static-method',
132
- '#private-static-method',
133
-
134
134
  'public-abstract-method',
135
135
 
136
136
  'public-decorated-method',
@@ -96,6 +96,10 @@ export default {
96
96
  allowDestructuring: true,
97
97
  allowedNames: []
98
98
  }],
99
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': ['error', {
100
+ allowComparingNullableBooleansToFalse: true,
101
+ allowComparingNullableBooleansToTrue: true
102
+ }],
99
103
  '@typescript-eslint/no-unnecessary-condition': ['error', {
100
104
  allowConstantLoopConditions: 'only-allowed-literals',
101
105
  checkTypePredicates: false
@@ -145,6 +149,7 @@ export default {
145
149
  variables: true
146
150
  }],
147
151
  '@typescript-eslint/no-useless-constructor': 'error',
152
+ '@typescript-eslint/no-useless-default-assignment': 'error',
148
153
  '@typescript-eslint/no-useless-empty-export': 'error',
149
154
  '@typescript-eslint/no-wrapper-object-types': 'error'
150
155
  };
package/src/rules/no.js CHANGED
@@ -129,6 +129,7 @@ export default {
129
129
  'no-new-wrappers': 'error',
130
130
  'no-nonoctal-decimal-escape': 'error',
131
131
  'no-obj-calls': 'error',
132
+ 'no-object-constructor': 'error',
132
133
  'no-octal': 'error',
133
134
  'no-octal-escape': 'error',
134
135
  'no-param-reassign': 'off',