@enormora/eslint-config-typescript 0.0.42 → 0.0.43

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,7 +1,10 @@
1
1
  {
2
2
  "author": "Mathias Schreck <schreck.mathias@gmail.com>",
3
3
  "contributors": [
4
- "Christian Rackerseder <github@echooff.de>"
4
+ {
5
+ "email": "github@echooff.de",
6
+ "name": "Christian Rackerseder"
7
+ }
5
8
  ],
6
9
  "dependencies": {
7
10
  "@typescript-eslint/eslint-plugin": "8.60.1",
@@ -20,12 +23,12 @@
20
23
  "license": "MIT",
21
24
  "name": "@enormora/eslint-config-typescript",
22
25
  "peerDependencies": {
23
- "@enormora/eslint-config-base": "0.0.36"
26
+ "@enormora/eslint-config-base": "0.0.37"
24
27
  },
25
28
  "repository": {
26
29
  "type": "git",
27
30
  "url": "git://github.com/enormora/eslint-config.git"
28
31
  },
29
32
  "type": "module",
30
- "version": "0.0.42"
33
+ "version": "0.0.43"
31
34
  }
@@ -43,9 +43,23 @@ export const noInlineSignatureTypeLiteralRestriction = {
43
43
  'Inline object type literals are not allowed in function parameters or return types — extract a named type.'
44
44
  };
45
45
 
46
+ const noPublicClassPropertySelector = [
47
+ 'PropertyDefinition[accessibility="public"]',
48
+ 'AccessorProperty[accessibility="public"]',
49
+ 'MethodDefinition[kind="get"][accessibility="public"]',
50
+ 'MethodDefinition[kind="set"][accessibility="public"]'
51
+ ]
52
+ .join(', ');
53
+
54
+ export const noPublicClassPropertyRestriction = {
55
+ selector: noPublicClassPropertySelector,
56
+ message: 'Class properties and accessors must be private or protected — only methods may be public.'
57
+ };
58
+
46
59
  const restrictedSyntaxTypescriptPlugin = createRestrictedSyntaxPlugin([
47
60
  'no-ts-enum-declaration',
48
- 'no-inline-signature-type-literal'
61
+ 'no-inline-signature-type-literal',
62
+ 'no-public-class-property'
49
63
  ]);
50
64
 
51
65
  function asArray(value) {
@@ -122,6 +136,7 @@ export const typescriptConfig = {
122
136
  'error',
123
137
  noInlineSignatureTypeLiteralRestriction
124
138
  ],
139
+ 'restricted-syntax-typescript/no-public-class-property': [ 'error', noPublicClassPropertyRestriction ],
125
140
 
126
141
  '@typescript-eslint/no-require-imports': 'error',
127
142
  '@typescript-eslint/adjacent-overload-signatures': 'error',
@@ -273,7 +288,7 @@ export const typescriptConfig = {
273
288
  '@typescript-eslint/consistent-type-definitions': [ 'error', 'type' ],
274
289
  ...configureWrappedCoreRule('default-param-last'),
275
290
  ...configureWrappedCoreRule('dot-notation'),
276
- '@typescript-eslint/explicit-member-accessibility': 'off',
291
+ '@typescript-eslint/explicit-member-accessibility': [ 'error', { accessibility: 'explicit' } ],
277
292
  '@typescript-eslint/explicit-module-boundary-types': 'off',
278
293
  '@typescript-eslint/init-declarations': 'off',
279
294
  '@typescript-eslint/method-signature-style': [ 'error', 'property' ],
@@ -347,7 +362,7 @@ export const typescriptConfig = {
347
362
  ],
348
363
  '@typescript-eslint/non-nullable-type-assertion-style': 'off',
349
364
  '@typescript-eslint/no-unsafe-argument': 'error',
350
- '@typescript-eslint/prefer-return-this-type': 'off',
365
+ '@typescript-eslint/prefer-return-this-type': 'error',
351
366
  '@typescript-eslint/no-meaningless-void-operator': 'error',
352
367
  '@typescript-eslint/no-restricted-imports': 'error',
353
368
  '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
@@ -356,7 +371,7 @@ export const typescriptConfig = {
356
371
  '@typescript-eslint/no-useless-empty-export': 'error',
357
372
  '@typescript-eslint/consistent-generic-constructors': [ 'error', 'constructor' ],
358
373
  '@typescript-eslint/no-duplicate-enum-values': 'error',
359
- '@typescript-eslint/parameter-properties': 'off',
374
+ '@typescript-eslint/parameter-properties': [ 'error', { prefer: 'class-property' } ],
360
375
  '@typescript-eslint/no-unsafe-declaration-merging': 'error',
361
376
  '@typescript-eslint/no-mixed-enums': 'error',
362
377
  '@typescript-eslint/no-import-type-side-effects': 'error',
@@ -372,7 +387,7 @@ export const typescriptConfig = {
372
387
  '@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error',
373
388
  '@typescript-eslint/no-unnecessary-type-parameters': 'error',
374
389
  '@typescript-eslint/no-unsafe-type-assertion': 'error',
375
- '@typescript-eslint/related-getter-setter-pairs': 'off',
390
+ '@typescript-eslint/related-getter-setter-pairs': 'error',
376
391
  '@typescript-eslint/no-misused-spread': 'error',
377
392
 
378
393
  'functional/functional-parameters': 'off',
package/sbom.cdx.json CHANGED
@@ -16,24 +16,24 @@
16
16
  "component": {
17
17
  "type": "library",
18
18
  "name": "@enormora/eslint-config-typescript",
19
- "version": "0.0.42",
20
- "bom-ref": "pkg:npm/@enormora/eslint-config-typescript@0.0.42",
21
- "purl": "pkg:npm/@enormora/eslint-config-typescript@0.0.42"
19
+ "version": "0.0.43",
20
+ "bom-ref": "pkg:npm/@enormora/eslint-config-typescript@0.0.43",
21
+ "purl": "pkg:npm/@enormora/eslint-config-typescript@0.0.43"
22
22
  }
23
23
  },
24
24
  "components": [
25
25
  {
26
26
  "type": "library",
27
27
  "name": "@enormora/eslint-config-base",
28
- "version": "0.0.36",
29
- "bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.36",
28
+ "version": "0.0.37",
29
+ "bom-ref": "pkg:npm/@enormora/eslint-config-base@0.0.37",
30
30
  "scope": "optional",
31
31
  "licenses": [
32
32
  {
33
33
  "expression": "MIT"
34
34
  }
35
35
  ],
36
- "purl": "pkg:npm/@enormora/eslint-config-base@0.0.36"
36
+ "purl": "pkg:npm/@enormora/eslint-config-base@0.0.37"
37
37
  },
38
38
  {
39
39
  "type": "library",
@@ -116,12 +116,12 @@
116
116
  ],
117
117
  "dependencies": [
118
118
  {
119
- "ref": "pkg:npm/@enormora/eslint-config-base@0.0.36"
119
+ "ref": "pkg:npm/@enormora/eslint-config-base@0.0.37"
120
120
  },
121
121
  {
122
- "ref": "pkg:npm/@enormora/eslint-config-typescript@0.0.42",
122
+ "ref": "pkg:npm/@enormora/eslint-config-typescript@0.0.43",
123
123
  "dependsOn": [
124
- "pkg:npm/@enormora/eslint-config-base@0.0.36",
124
+ "pkg:npm/@enormora/eslint-config-base@0.0.37",
125
125
  "pkg:npm/@typescript-eslint/eslint-plugin@8.60.1",
126
126
  "pkg:npm/@typescript-eslint/parser@8.60.1",
127
127
  "pkg:npm/eslint-import-resolver-typescript@4.4.5",