lint-rules-alvin 1.0.0 → 1.0.2

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # lint-rules-alvin
2
2
 
3
+ See the [npm package](https://www.npmjs.com/package/lint-rules-alvin)!
4
+
3
5
  [My](https://github.com/Ctrl-Shift-Alvin) personal repo containing configs for code linters. Some of my public repos use this, so it's public. A generalized config makes managaing configs much easier (once they're working, of course).
4
6
 
5
7
  All dependencies are optional, but you need to install the correct ones depending on which files you use.
@@ -1,8 +1,17 @@
1
1
  import eslintTs from 'typescript-eslint';
2
2
 
3
+ /**
4
+ * @type {import('eslint').Linter.Config}
5
+ */
3
6
  export const typescript = {
4
7
  name: 'typescript',
5
- extends: [ eslintTs.configs.recommendedTypeChecked ],
8
+ files: [
9
+ '**/*.ts',
10
+ '**/*.tsx',
11
+ '**/*.mts',
12
+ '**/*.cts'
13
+ ],
14
+ ...eslintTs.configs.base,
6
15
  languageOptions: { parserOptions: { projectService: true } },
7
16
  rules: {
8
17
  '@typescript-eslint/array-type': [
@@ -392,7 +401,104 @@ export const typescript = {
392
401
  '@typescript-eslint/no-unnecessary-type-assertion': 'error',
393
402
  '@typescript-eslint/no-unnecessary-type-constraint': 'error',
394
403
  '@typescript-eslint/no-unnecessary-type-conversion': 'error',
395
- '@typescript-eslint/no-unnecessary-type-parameters': 'error'
404
+ '@typescript-eslint/no-unnecessary-type-parameters': 'error',
405
+ '@typescript-eslint/no-unsafe-argument': 'warn',
406
+ '@typescript-eslint/no-unsafe-assignment': 'warn',
407
+ '@typescript-eslint/no-unsafe-call': 'warn',
408
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
409
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
410
+ '@typescript-eslint/no-unsafe-function-type': 'error',
411
+ '@typescript-eslint/no-unsafe-member-access': [
412
+ 'warn',
413
+ { allowOptionalChaining: false }
414
+ ],
415
+ '@typescript-eslint/no-unsafe-return': 'error',
416
+ '@typescript-eslint/no-unsafe-type-assertion': 'warn',
417
+ '@typescript-eslint/no-unsafe-unary-minus': 'warn',
418
+ '@typescript-eslint/no-unused-expressions': 'warn',
419
+ 'no-unused-vars': 'off',
420
+ '@typescript-eslint/no-unused-vars': 'warn',
421
+ 'no-use-before-define': 'off',
422
+ '@typescript-eslint/no-use-before-define': 'error',
423
+ 'no-useless-constructor': 'off',
424
+ '@typescript-eslint/no-useless-constructor': 'error',
425
+ '@typescript-eslint/no-useless-empty-export': 'error',
426
+ '@typescript-eslint/no-var-requires': 'off', // Deprecated in favor of 'no-require-imports'
427
+ '@typescript-eslint/no-wrapper-object-types': 'warn',
428
+ '@typescript-eslint/non-nullable-type-assertion-style': 'error',
429
+ '@typescript-eslint/only-throw-error': 'error',
430
+ '@typescript-eslint/parameter-properties': 'off',
431
+ '@typescript-eslint/prefer-as-const': 'error',
432
+ '@typescript-eslint/prefer-destructing': 'off',
433
+ '@typescript-eslint/prefer-enum-initializers': 'off',
434
+ '@typescript-eslint/prefer-find': 'error',
435
+ '@typescript-eslint/prefer-for-of': 'error',
436
+ '@typescript-eslint/prefer-function-type': 'error',
437
+ '@typescript-eslint/prefer-includes': 'error',
438
+ '@typescript-eslint/prefer-literal-enum-member': 'off',
439
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
440
+ '@typescript-eslint/prefer-nullish-coalescing': 'error',
441
+ '@typescript-eslint/prefer-optional-chain': 'error',
442
+ '@typescript-eslint/prefer-promise-reject-errors': 'error',
443
+ '@typescript-eslint/prefer-readonly': 'error',
444
+ '@typescript-eslint/prefer-readonly-parameter-types': 'off',
445
+ '@typescript-eslint/prefer-reduce-type-parameter': 'error',
446
+ '@typescript-eslint/prefer-regexp-exec': 'error',
447
+ '@typescript-eslint/prefer-return-this-type': 'error',
448
+ '@typescript-eslint/prefer-string-starts-ends-with': 'error',
449
+ '@typescript-eslint/prefer-ts-expect-error': 'off', // Deprecated in favor of ban-ts-comment
450
+ '@typescript-eslint/promise-function-async': 'off',
451
+ '@typescript-eslint/related-getter-setter-pairs': 'error',
452
+ '@typescript-eslint/require-array-sort-compare': 'error',
453
+ '@typescript-eslint/require-await': 'warn',
454
+ '@typescript-eslint/restrict-plus-operands': 'error',
455
+ '@typescript-eslint/restrict-template-expressions': 'warn',
456
+ '@typescript-eslint/return-await': [
457
+ 'error',
458
+ 'always'
459
+ ],
460
+ '@typescript-eslint/sort-type-constituents': 'off', // Deprecated in favor of sort-intersection-types, etc.
461
+ '@typescript-eslint/strict-boolean-expressions': 'off',
462
+ '@typescript-eslint/strict-boolean-expressions': [
463
+ 'error',
464
+ {
465
+ allowAny: false,
466
+ allowNullableBoolean: false,
467
+ allowNullableEnum: false,
468
+ allowNullableNumber: true,
469
+ allowNullableObject: true,
470
+ allowNullableString: true,
471
+ allowNumber: false,
472
+ allowString: false
473
+
474
+ // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
475
+ }
476
+ ],
477
+ '@typescript-eslint/strict-boolean-expressions': [
478
+ 'error',
479
+ {
480
+ allowDefaultCaseForExhaustiveSwitch: true,
481
+ considerDefaultExhaustiveForUnions: false,
482
+ requireDefaultForNonUnion: false
483
+ }
484
+ ],
485
+ '@typescript-eslint/triple-slash-reference': [
486
+ 'error',
487
+ {
488
+ lib: 'never',
489
+ path: 'never',
490
+ types: 'never'
491
+ }
492
+ ],
493
+ '@typescript-eslint/unbound-method': 'error',
494
+ '@typescript-eslint/unified-signatures': [
495
+ 'error',
496
+ {
497
+ ignoreDifferentlyNamedParameters: true,
498
+ ignoreOverloadsWithDifferentJSDoc: true
499
+ }
500
+ ],
501
+ '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off'
396
502
 
397
503
  }
398
504
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "lint-rules-alvin",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "My own personal linting ruleset for a bunch of different plugins. Includes a few custom rules. Used in a few of my repos.",
5
5
  "keywords": [
6
6
  "eslint"
7
7
  ],
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "xxx"
10
+ "url": "https://github.com/Ctrl-Shift-Alvin/lint-rules-alvin"
11
11
  },
12
12
  "license": "MIT",
13
13
  "author": "Alvin Raul Szőke",
@@ -30,28 +30,48 @@
30
30
  "./eslint/configs/typescript": "./eslint/configs/typescript.js"
31
31
  },
32
32
  "peerDependencies": {
33
+ "eslint": "^9.37.0",
33
34
  "@eslint/compat": "^1.4.0",
34
35
  "@stylistic/eslint-plugin": "^5.4.0",
35
36
  "astro-eslint-parser": "^1.2.2",
36
- "eslint": "^9.37.0",
37
37
  "eslint-plugin-astro": "^1.3.1",
38
38
  "eslint-plugin-import-x": "^4.16.1",
39
- "eslint-import-resolver-typescript": "^4.4.4",
39
+ "eslint-import-resolver-typescript": "^4.4.4",
40
40
  "eslint-plugin-jsonc": "^2.21.0",
41
41
  "eslint-plugin-markdown": "^5.1.0",
42
42
  "eslint-plugin-react-hooks": "^6.1.1",
43
43
  "typescript-eslint": "^8.46.0"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
- "@eslint/compat": { "optional": true },
47
- "@stylistic/eslint-plugin": { "optional": true },
48
- "astro-eslint-parser": { "optional": true },
49
- "eslint-plugin-astro": { "optional": true },
50
- "eslint-plugin-import-x": { "optional": true },
51
- "eslint-import-resolver-typescript": { "optional": true },
52
- "eslint-plugin-jsonc": { "optional": true },
53
- "eslint-plugin-markdown": { "optional": true },
54
- "eslint-plugin-react-hooks": { "optional": true },
55
- "typescript-eslint": { "optional": true }
46
+ "@eslint/compat": {
47
+ "optional": true
48
+ },
49
+ "@stylistic/eslint-plugin": {
50
+ "optional": true
51
+ },
52
+ "astro-eslint-parser": {
53
+ "optional": true
54
+ },
55
+ "eslint-plugin-astro": {
56
+ "optional": true
57
+ },
58
+ "eslint-plugin-import-x": {
59
+ "optional": true
60
+ },
61
+ "eslint-import-resolver-typescript": {
62
+ "optional": true
63
+ },
64
+ "eslint-plugin-jsonc": {
65
+ "optional": true
66
+ },
67
+ "eslint-plugin-markdown": {
68
+ "optional": true
69
+ },
70
+ "eslint-plugin-react-hooks": {
71
+ "optional": true
72
+ },
73
+ "typescript-eslint": {
74
+ "optional": true
75
+ }
56
76
  }
57
77
  }