@remcohaszing/eslint 11.2.0 → 13.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/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  > A strict ESLint configuration
4
4
 
5
- [![build status](https://github.com/remcohaszing/@remcohaszing/eslint/workflows/ci/badge.svg)](https://github.com/remcohaszing/@remcohaszing/eslint/actions)
6
- [![codecov](https://codecov.io/gh/remcohaszing/@remcohaszing/eslint/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/@remcohaszing/eslint)
5
+ [![build status](https://github.com/remcohaszing/eslint/workflows/ci/badge.svg)](https://github.com/remcohaszing/eslint/actions)
6
+ [![codecov](https://codecov.io/gh/remcohaszing/eslint/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/eslint)
7
7
  [![npm](https://img.shields.io/npm/v/@remcohaszing/eslint)](https://www.npmjs.com/package/@remcohaszing/eslint)
8
8
  [![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
9
9
 
@@ -74,9 +74,9 @@ enabled. Unfortunately, this makes ESLint slow. Enabling these rules is recommen
74
74
  projects only. To enable this, add the following to `eslint.config.js`:
75
75
 
76
76
  ```js
77
- import config, { typechecking } from '@remcohaszing/eslint'
77
+ import { define, typechecking } from '@remcohaszing/eslint'
78
78
 
79
- export default [...config, ...typechecking]
79
+ export default define(typechecking)
80
80
  ```
81
81
 
82
82
  ### Markdown
@@ -96,16 +96,15 @@ Rules can be disabled by adding an extra ESLint configuration item to the config
96
96
  example:
97
97
 
98
98
  ```js
99
- import config from '@remcohaszing/eslint'
99
+ import { define } from '@remcohaszing/eslint'
100
100
 
101
- export default [
102
- ...config,
101
+ export default define([
103
102
  {
104
103
  rules: {
105
104
  'no-console': 'off'
106
105
  }
107
106
  }
108
- ]
107
+ ])
109
108
  ```
110
109
 
111
110
  ## Ignored files
@@ -115,7 +114,7 @@ the patterns from `.gitignore`.
115
114
 
116
115
  ## Warnings
117
116
 
118
- All ESLint that are turned on will trigger error, not warnings. The notable exceptions is
117
+ All ESLint that are turned on will trigger error, not warnings. The notable exception is
119
118
  `@typescript-eslint/no-deprecated`.
120
119
 
121
120
  This is to allow a smooth migration if a dependency decides to deprecate an API. To turn make
package/lib/config.js CHANGED
@@ -2,6 +2,9 @@
2
2
  * @import {Linter} from 'eslint'
3
3
  */
4
4
 
5
+ import { dirname, join } from 'node:path'
6
+
7
+ import { includeIgnoreFile } from '@eslint/compat'
5
8
  import markdown from '@eslint/markdown'
6
9
  // @ts-expect-error
7
10
  import eslintCommunityEslintComments from '@eslint-community/eslint-plugin-eslint-comments'
@@ -19,11 +22,68 @@ import perfectionist from 'eslint-plugin-perfectionist'
19
22
  import { Alphabet } from 'eslint-plugin-perfectionist/alphabet'
20
23
  import prettier from 'eslint-plugin-prettier'
21
24
  import unicorn from 'eslint-plugin-unicorn'
25
+ import findUp from 'find-up'
22
26
  import globals from 'globals'
23
27
 
24
- import { allowedProperties } from './allowedProperties.js'
25
- import { typesOnlyPackages } from './constants.js'
26
- import { getIgnorePatterns } from './getIgnorePatterns.js'
28
+ /**
29
+ * These property names are allowed, because exist in commonly used specifications.
30
+ */
31
+ const allowedProperties = [
32
+ // OAuth2
33
+ 'access_token',
34
+ 'client_id',
35
+ 'client_secret',
36
+ 'error_description',
37
+ 'error_uri',
38
+ 'expires_in',
39
+ 'grant_type',
40
+ 'redirect_uri',
41
+ 'refresh_token',
42
+ 'response_type',
43
+ 'token_type',
44
+
45
+ // OpenID
46
+ 'email_verified',
47
+ 'id_token',
48
+
49
+ // Web app manifest
50
+ 'background_color',
51
+ 'iarc_rating_id',
52
+ 'short_name',
53
+ 'prefer_related_applications',
54
+ 'related_applications',
55
+ 'start_url',
56
+ 'theme_color',
57
+
58
+ // React
59
+ '__html'
60
+ ]
61
+
62
+ /**
63
+ * Known packages that export only type definitions, but which don’t contain a JavaScript file.
64
+ */
65
+ const typesOnlyPackages = ['@fortawesome/fontawesome-common-types']
66
+
67
+ /**
68
+ * Determine the default ignore pattern based on `.gitignore`.
69
+ *
70
+ * @returns {Linter.Config}
71
+ * An array of ignore patterns accepted in an ESLint configuration.
72
+ */
73
+ function getIgnorePatterns() {
74
+ const gitDir = findUp.sync('.git', { type: 'directory' })
75
+
76
+ if (!gitDir) {
77
+ return {}
78
+ }
79
+
80
+ const gitIgnorePath = join(dirname(gitDir), '.gitignore')
81
+ try {
82
+ return includeIgnoreFile(gitIgnorePath)
83
+ } catch {
84
+ return {}
85
+ }
86
+ }
27
87
 
28
88
  const restrictedImports = [
29
89
  { name: 'node:assert', message: 'Use node:assert/strict instead.' },
@@ -67,7 +127,7 @@ const NON_COMPONENT_FUNCTION = 'FunctionDeclaration[id.name=/^[a-z]/]'
67
127
  const METHOD_DEFINITION = 'MethodDefinition'
68
128
 
69
129
  const config = defineConfig([
70
- getIgnorePatterns() ?? {},
130
+ getIgnorePatterns(),
71
131
  {
72
132
  name: 'base',
73
133
  languageOptions: {
@@ -198,7 +258,7 @@ const config = defineConfig([
198
258
  'always',
199
259
  {
200
260
  ignoreConsecutiveComments: true,
201
- ignorePattern: /^\s*(c8|type-coverage:|webpack\w)/.source
261
+ ignorePattern: /^\s*(c8|type-coverage:|webpack\w|([\w.-]+\.\w+$))/.source
202
262
  }
203
263
  ],
204
264
  'class-methods-use-this': 'error',
@@ -238,7 +298,7 @@ const config = defineConfig([
238
298
  'no-dupe-else-if': 'error',
239
299
  'no-dupe-keys': 'error',
240
300
  'no-duplicate-case': 'error',
241
- 'no-duplicate-imports': ['error', { includeExports: true }],
301
+ 'no-duplicate-imports': ['error', { allowSeparateTypeImports: true, includeExports: true }],
242
302
  'no-else-return': ['error', { allowElseIf: false }],
243
303
  'no-empty': 'error',
244
304
  'no-empty-character-class': 'error',
@@ -303,10 +363,6 @@ const config = defineConfig([
303
363
  selector:
304
364
  'CallExpression[callee.property.name="toString"][callee.optional=false][arguments.length=0][optional=false]',
305
365
  message: 'Use String() instead.'
306
- },
307
- {
308
- selector: '[returnType.type="TSTypeAnnotation"]>TSTypeAnnotation>TSVoidKeyword',
309
- message: 'Use undefined for non-returning functions of unknown for callbacks'
310
366
  }
311
367
  ],
312
368
  'no-return-assign': ['error', 'always'],
@@ -320,6 +376,7 @@ const config = defineConfig([
320
376
  'no-shadow-restricted-names': 'error',
321
377
  'no-this-before-super': 'error',
322
378
  'no-throw-literal': 'error',
379
+ 'no-unassigned-vars': 'error',
323
380
  'no-undef': 'error',
324
381
  'no-undef-init': 'error',
325
382
  'no-underscore-dangle': 'error',
@@ -367,6 +424,7 @@ const config = defineConfig([
367
424
  'prefer-rest-params': 'error',
368
425
  'prefer-spread': 'error',
369
426
  'prefer-template': 'error',
427
+ 'preserve-caught-error': ['error', { requireCatchParameter: true }],
370
428
  radix: ['error', 'as-needed'],
371
429
  'require-await': 'error',
372
430
  'require-yield': 'error',
@@ -420,7 +478,30 @@ const config = defineConfig([
420
478
  ],
421
479
  '@stylistic/multiline-comment-style': ['error', 'separate-lines'],
422
480
  '@stylistic/no-tabs': ['error', { allowIndentationTabs: true }],
423
- '@stylistic/padding-line-between-statements': 'error',
481
+ '@stylistic/padding-line-between-statements': [
482
+ 'error',
483
+ {
484
+ blankLine: 'always',
485
+ prev: ['cjs-import', 'import'],
486
+ next: '*'
487
+ },
488
+ {
489
+ blankLine: 'any',
490
+ prev: ['cjs-import', 'import'],
491
+ next: ['cjs-import', 'import']
492
+ },
493
+
494
+ {
495
+ blankLine: 'always',
496
+ prev: 'function',
497
+ next: '*'
498
+ },
499
+ {
500
+ blankLine: 'always',
501
+ prev: '*',
502
+ next: 'function'
503
+ }
504
+ ],
424
505
  '@stylistic/quotes': ['error', 'single', { avoidEscape: true, ignoreStringLiterals: true }],
425
506
  '@stylistic/spaced-comment': [
426
507
  'error',
@@ -432,15 +513,11 @@ const config = defineConfig([
432
513
  ],
433
514
 
434
515
  // https://github.com/un-ts/eslint-plugin-import-x
435
- 'import-x/consistent-type-specifier-style': ['error', 'prefer-inline'],
516
+ 'import-x/consistent-type-specifier-style': 'error',
436
517
  'import-x/export': 'error',
437
518
  'import-x/extensions': ['error', 'ignorePackages'],
438
519
  'import-x/first': 'error',
439
- 'import-x/named': 'error',
440
- 'import-x/namespace': 'error',
441
- 'import-x/newline-after-import': 'error',
442
520
  'import-x/no-absolute-path': 'error',
443
- 'import-x/no-amd': 'error',
444
521
  'import-x/no-anonymous-default-export': [
445
522
  'error',
446
523
  {
@@ -454,7 +531,6 @@ const config = defineConfig([
454
531
  allowObject: true
455
532
  }
456
533
  ],
457
- 'import-x/no-duplicates': ['error', { 'prefer-inline': true }],
458
534
  'import-x/no-extraneous-dependencies': [
459
535
  'error',
460
536
  {
@@ -478,7 +554,6 @@ const config = defineConfig([
478
554
  }
479
555
  ],
480
556
  'import-x/no-useless-path-segments': 'error',
481
- 'import-x/no-webpack-loader-syntax': 'error',
482
557
 
483
558
  // https://github.com/dangreenisrael/eslint-plugin-jest-formatting
484
559
  'jest-formatting/padding-around-after-all-blocks': 'error',
@@ -492,13 +567,14 @@ const config = defineConfig([
492
567
  'jsdoc/check-access': 'error',
493
568
  'jsdoc/check-indentation': [
494
569
  'error',
495
- { excludeTags: ['example', 'param', 'property', 'returns', 'throws', 'todo'] }
570
+ { excludeTags: ['example', 'param', 'property', 'returns', 'template', 'throws', 'todo'] }
496
571
  ],
497
572
  'jsdoc/check-line-alignment': ['error', 'never', { wrapIndent: ' ' }],
498
573
  'jsdoc/check-param-names': ['error', { checkDestructured: false }],
499
574
  'jsdoc/check-tag-names': ['error', { jsxTags: true }],
500
575
  'jsdoc/check-template-names': 'error',
501
576
  'jsdoc/empty-tags': 'error',
577
+ 'jsdoc/escape-inline-tags': 'error',
502
578
  'jsdoc/match-name': [
503
579
  'error',
504
580
  {
@@ -530,12 +606,39 @@ const config = defineConfig([
530
606
  contexts: [
531
607
  {
532
608
  comment: 'JsdocBlock:has(JsdocTag[tag=typedef][parsedType.value=/object/i])',
533
- message: 'Omit the object type from typedef'
609
+ message: 'Omit the object type from @typedef'
610
+ },
611
+
612
+ // https://github.com/gajus/eslint-plugin-jsdoc/issues/1314
613
+ {
614
+ comment: 'JsdocBlock:has(JsdocTag:has(JsdocTypeImport))',
615
+ context: 'any',
616
+ message: 'Use @import tag over import() statements'
617
+ },
618
+
619
+ // https://github.com/gajus/eslint-plugin-jsdoc/issues/1445
620
+ {
621
+ comment: 'JsdocBlock:has(JsdocTag[tag=typedef]):has(JsdocTag[tag=callback])',
622
+ context: 'any',
623
+ message: 'Use separate blocks for @typedef and @callback'
624
+ },
625
+ {
626
+ comment: 'JsdocBlock:has(JsdocTag[tag=typedef] ~ JsdocTag[tag=typedef])',
627
+ context: 'any',
628
+ message: 'Use separate blocks for multiple @typedef tags'
629
+ },
630
+ {
631
+ comment: 'JsdocBlock:has(JsdocTag[tag=callback] ~ JsdocTag[tag=callback])',
632
+ context: 'any',
633
+ message: 'Use separate blocks for multiple @typedef tags'
534
634
  }
535
635
  ]
536
636
  }
537
637
  ],
538
638
  'jsdoc/no-undefined-types': 'error',
639
+ 'jsdoc/prefer-import-tag': ['error', { exemptTypedefs: false, outputType: 'named-import' }],
640
+ 'jsdoc/reject-any-type': 'error',
641
+ 'jsdoc/reject-function-type': 'error',
539
642
  'jsdoc/require-asterisk-prefix': 'error',
540
643
  'jsdoc/require-description': 'error',
541
644
  'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
@@ -567,8 +670,14 @@ const config = defineConfig([
567
670
  'jsdoc/require-returns-check': 'error',
568
671
  'jsdoc/require-returns-description': 'error',
569
672
  'jsdoc/require-returns-type': 'error',
673
+ 'jsdoc/require-template-description': 'error',
674
+ 'jsdoc/require-throws-description': 'error',
675
+ 'jsdoc/require-throws-type': 'error',
570
676
  'jsdoc/sort-tags': ['error', { alphabetizeExtras: true }],
571
677
  'jsdoc/tag-lines': ['error', 'never', { applyToEndTag: false, startLines: 1, endLines: 0 }],
678
+ 'jsdoc/ts-method-signature-style': 'error',
679
+ 'jsdoc/ts-no-unnecessary-template-expression': 'error',
680
+ 'jsdoc/ts-prefer-function-type': 'error',
572
681
 
573
682
  // https://github.com/eslint-community/eslint-plugin-n
574
683
  'n/callback-return': ['error', ['callback', 'cb']],
@@ -594,8 +703,10 @@ const config = defineConfig([
594
703
  // https://perfectionist.dev
595
704
  'perfectionist/sort-array-includes': 'error',
596
705
  'perfectionist/sort-classes': ['error', { type: 'unsorted' }],
706
+ 'perfectionist/sort-export-attributes': 'error',
597
707
  'perfectionist/sort-exports': ['error', { type: 'custom', alphabet }],
598
708
  'perfectionist/sort-heritage-clauses': 'error',
709
+ 'perfectionist/sort-import-attributes': 'error',
599
710
  'perfectionist/sort-imports': [
600
711
  'error',
601
712
  {
@@ -604,15 +715,21 @@ const config = defineConfig([
604
715
  internalPattern: [],
605
716
  groups: [
606
717
  'side-effect',
718
+ 'type-builtin',
719
+ 'type-external',
720
+ 'type-subpath',
721
+ 'type-internal',
722
+ 'type-parent',
723
+ { newlinesBetween: 0 },
724
+ ['type-sibling', 'type-index'],
607
725
  'builtin',
608
726
  'external',
609
727
  'subpath',
610
728
  'internal',
611
729
  'parent',
612
- { newlinesBetween: 'never' },
730
+ { newlinesBetween: 0 },
613
731
  ['sibling', 'index'],
614
- 'unknown',
615
- 'object'
732
+ 'unknown'
616
733
  ]
617
734
  }
618
735
  ],
@@ -627,7 +744,10 @@ const config = defineConfig([
627
744
  'perfectionist/sort-maps': 'error',
628
745
  'perfectionist/sort-named-exports': 'error',
629
746
  'perfectionist/sort-named-imports': 'error',
630
- 'perfectionist/sort-objects': ['error', { objectDeclarations: false }],
747
+ 'perfectionist/sort-objects': [
748
+ 'error',
749
+ { type: 'unsorted', useConfigurationIf: { objectType: 'non-destructured' } }
750
+ ],
631
751
  'perfectionist/sort-union-types': 'error',
632
752
 
633
753
  // https://github.com/prettier/eslint-plugin-prettier
@@ -635,7 +755,7 @@ const config = defineConfig([
635
755
 
636
756
  // https://github.com/sindresorhus/eslint-plugin-unicorn
637
757
  'unicorn/better-regex': 'error',
638
- 'unicorn/catch-error-name': ['error', { name: 'error', ignore: ['err', /Error^/] }],
758
+ 'unicorn/catch-error-name': ['error', { name: 'error', ignore: ['cause', 'err', /Error$/] }],
639
759
  'unicorn/consistent-assert': 'error',
640
760
  'unicorn/consistent-date-clone': 'error',
641
761
  'unicorn/consistent-destructuring': 'error',
@@ -657,6 +777,7 @@ const config = defineConfig([
657
777
  'node:fs/promises': { named: true },
658
778
  'node:os': { named: true },
659
779
  'node:path': { named: true },
780
+ 'node:test': { named: true },
660
781
  'node:url': { named: true },
661
782
  'node:util': { named: true },
662
783
  'node:zlib': { named: true },
@@ -672,18 +793,18 @@ const config = defineConfig([
672
793
  'unicorn/no-accessor-recursion': 'error',
673
794
  'unicorn/no-array-for-each': 'error',
674
795
  'unicorn/no-array-method-this-argument': 'error',
675
- 'unicorn/no-array-push-push': 'error',
676
796
  'unicorn/no-array-reduce': 'error',
797
+ 'unicorn/no-array-sort': 'error',
677
798
  'unicorn/no-await-in-promise-methods': 'error',
678
799
  'unicorn/no-console-spaces': 'error',
679
800
  'unicorn/no-document-cookie': 'error',
680
801
  'unicorn/no-empty-file': 'error',
681
802
  'unicorn/no-for-loop': 'error',
682
803
  'unicorn/no-hex-escape': 'error',
804
+ 'unicorn/no-immediate-mutation': 'error',
683
805
  'unicorn/no-instanceof-builtins': 'error',
684
806
  'unicorn/no-invalid-fetch-options': 'error',
685
807
  'unicorn/no-invalid-remove-event-listener': 'error',
686
- 'unicorn/no-length-as-slice-end': 'error',
687
808
  'unicorn/no-lonely-if': 'error',
688
809
  'unicorn/no-named-default': 'error',
689
810
  'unicorn/no-negated-condition': 'error',
@@ -694,9 +815,14 @@ const config = defineConfig([
694
815
  'unicorn/no-static-only-class': 'error',
695
816
  'unicorn/no-this-assignment': 'error',
696
817
  'unicorn/no-typeof-undefined': 'error',
818
+ 'unicorn/no-unnecessary-array-flat-depth': 'error',
819
+ 'unicorn/no-unnecessary-array-splice-count': 'error',
697
820
  'unicorn/no-unnecessary-await': 'error',
821
+ 'unicorn/no-unnecessary-slice-end': 'error',
698
822
  'unicorn/no-unreadable-iife': 'error',
699
823
  'unicorn/no-unused-properties': 'error',
824
+ 'unicorn/no-useless-collection-argument': 'error',
825
+ 'unicorn/no-useless-error-capture-stack-trace': 'error',
700
826
  'unicorn/no-useless-fallback-in-spread': 'error',
701
827
  'unicorn/no-useless-length-check': 'error',
702
828
  'unicorn/no-useless-promise-resolve-reject': 'error',
@@ -711,7 +837,10 @@ const config = defineConfig([
711
837
  'unicorn/prefer-array-index-of': 'error',
712
838
  'unicorn/prefer-array-some': 'error',
713
839
  'unicorn/prefer-at': 'error',
840
+ 'unicorn/prefer-bigint-literals': 'error',
714
841
  'unicorn/prefer-blob-reading-methods': 'error',
842
+ 'unicorn/prefer-class-fields': 'error',
843
+ 'unicorn/prefer-classlist-toggle': 'error',
715
844
  'unicorn/prefer-date-now': 'error',
716
845
  'unicorn/prefer-default-parameters': 'error',
717
846
  'unicorn/prefer-dom-node-append': 'error',
@@ -721,6 +850,7 @@ const config = defineConfig([
721
850
  'unicorn/prefer-event-target': 'error',
722
851
  'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }],
723
852
  'unicorn/prefer-global-this': 'error',
853
+ 'unicorn/prefer-import-meta-properties': 'error',
724
854
  'unicorn/prefer-includes': 'error',
725
855
  'unicorn/prefer-json-parse-buffer': 'error',
726
856
  'unicorn/prefer-keyboard-event-key': 'error',
@@ -738,8 +868,10 @@ const config = defineConfig([
738
868
  'unicorn/prefer-prototype-methods': 'error',
739
869
  'unicorn/prefer-reflect-apply': 'error',
740
870
  'unicorn/prefer-regexp-test': 'error',
871
+ 'unicorn/prefer-response-static-json': 'error',
741
872
  'unicorn/prefer-set-has': 'error',
742
873
  'unicorn/prefer-set-size': 'error',
874
+ 'unicorn/prefer-single-call': 'error',
743
875
  'unicorn/prefer-string-replace-all': 'error',
744
876
  'unicorn/prefer-string-slice': 'error',
745
877
  'unicorn/prefer-string-starts-ends-with': 'error',
@@ -749,6 +881,8 @@ const config = defineConfig([
749
881
  'unicorn/prefer-top-level-await': 'error',
750
882
  'unicorn/prefer-type-error': 'error',
751
883
  'unicorn/relative-url-style': 'error',
884
+ 'unicorn/require-module-attributes': 'error',
885
+ 'unicorn/require-module-specifiers': 'error',
752
886
  'unicorn/require-post-message-target-origin': 'error',
753
887
  'unicorn/switch-case-braces': ['error', 'avoid'],
754
888
  'unicorn/template-indent': 'error',
@@ -1058,6 +1192,7 @@ export const typechecking = defineConfig([
1058
1192
  '@typescript-eslint/no-unsafe-member-access': 'error',
1059
1193
  '@typescript-eslint/no-unsafe-return': 'error',
1060
1194
  '@typescript-eslint/no-unsafe-unary-minus': 'error',
1195
+ '@typescript-eslint/no-useless-default-assignment': 'error',
1061
1196
  '@typescript-eslint/non-nullable-type-assertion-style': 'error',
1062
1197
  '@typescript-eslint/only-throw-error': 'error',
1063
1198
  '@typescript-eslint/prefer-destructuring': [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remcohaszing/eslint",
3
- "version": "11.2.0",
3
+ "version": "13.0.0",
4
4
  "description": "A strict ESLint configuration.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -30,19 +30,19 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@eslint-community/eslint-plugin-eslint-comments": "^4.0.0",
33
- "@eslint/compat": "^1.0.0",
34
- "@eslint/markdown": "^6.0.0",
35
- "@stylistic/eslint-plugin": "^4.0.0",
33
+ "@eslint/compat": "^2.0.0",
34
+ "@eslint/markdown": "^7.0.0",
35
+ "@stylistic/eslint-plugin": "^5.0.0",
36
36
  "@typescript-eslint/eslint-plugin": "^8.0.0",
37
37
  "@typescript-eslint/parser": "^8.0.0",
38
38
  "confusing-browser-globals": "^1.0.0",
39
39
  "eslint-plugin-import-x": "^4.0.0",
40
40
  "eslint-plugin-jest-formatting": "^3.0.0",
41
- "eslint-plugin-jsdoc": "^50.0.0",
41
+ "eslint-plugin-jsdoc": "^61.0.0",
42
42
  "eslint-plugin-n": "^17.0.0",
43
- "eslint-plugin-perfectionist": "^4.0.0",
43
+ "eslint-plugin-perfectionist": "^5.0.0",
44
44
  "eslint-plugin-prettier": "^5.0.0",
45
- "eslint-plugin-unicorn": "^58.0.0",
45
+ "eslint-plugin-unicorn": "^62.0.0",
46
46
  "find-up": "^5.0.0"
47
47
  },
48
48
  "devDependencies": {
@@ -50,6 +50,7 @@
50
50
  "prettier-plugin-packagejson": "^2.0.0",
51
51
  "remark-cli": "^12.0.0",
52
52
  "remark-preset-remcohaszing": "^3.0.0",
53
+ "type-fest": "^5.0.0",
53
54
  "typescript": "^5.0.0"
54
55
  },
55
56
  "peerDependencies": {
package/types/config.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export function define(overrides: Linter.Config | Linter.Config[]): Linter.Config[];
10
10
  export default config;
11
- export const typechecking: Linter.Config<Linter.RulesRecord>[];
11
+ export const typechecking: import("eslint/config").Config[];
12
12
  import type { Linter } from 'eslint';
13
- declare const config: Linter.Config<Linter.RulesRecord>[];
13
+ declare const config: import("eslint/config").Config[];
14
14
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.js"],"names":[],"mappings":"AA+sCA;;;;;;;GAOG;AACH,kCALW,aAAa,GAAG,aAAa,EAAE,GAE7B,aAAa,EAAE,CAK3B;;AAxFD,4DA4EE;4BA5sCuB,QAAQ;AA+HjC,uDA6/BE"}
@@ -1,33 +0,0 @@
1
- /**
2
- * These property names are allowed, because exist in commonly used specifications.
3
- */
4
- export const allowedProperties = [
5
- // OAuth2
6
- 'access_token',
7
- 'client_id',
8
- 'client_secret',
9
- 'error_description',
10
- 'error_uri',
11
- 'expires_in',
12
- 'grant_type',
13
- 'redirect_uri',
14
- 'refresh_token',
15
- 'response_type',
16
- 'token_type',
17
-
18
- // OpenID
19
- 'email_verified',
20
- 'id_token',
21
-
22
- // Web app manifest
23
- 'background_color',
24
- 'iarc_rating_id',
25
- 'short_name',
26
- 'prefer_related_applications',
27
- 'related_applications',
28
- 'start_url',
29
- 'theme_color',
30
-
31
- // React
32
- '__html'
33
- ]
package/lib/constants.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Known packages in on DefinitelyTyped that don’t describe an npm package.
3
- */
4
- export const dtOnlyPackages = [
5
- 'estree',
6
- 'estree-jsx',
7
- 'hast',
8
- 'mdast',
9
- 'unist',
10
- 'web-app-manifest',
11
- 'xast'
12
- ]
13
-
14
- /**
15
- * Known packages that export only type definitions, but which don’t contain a JavaScript file.
16
- */
17
- export const typesOnlyPackages = ['@fortawesome/fontawesome-common-types']
@@ -1,27 +0,0 @@
1
- /**
2
- * @import { Linter } from 'eslint'
3
- */
4
-
5
- import { dirname, join } from 'node:path'
6
-
7
- import { includeIgnoreFile } from '@eslint/compat'
8
- import findUp from 'find-up'
9
-
10
- /**
11
- * Determine the default ignore pattern based on `.gitignore`.
12
- *
13
- * @returns {Linter.Config | undefined}
14
- * An array of ignore patterns accepted in an ESLint configuration.
15
- */
16
- export function getIgnorePatterns() {
17
- const gitDir = findUp.sync('.git', { type: 'directory' })
18
-
19
- if (gitDir) {
20
- const gitIgnorePath = join(dirname(gitDir), '.gitignore')
21
- try {
22
- return includeIgnoreFile(gitIgnorePath)
23
- } catch {
24
- // Do nothing
25
- }
26
- }
27
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * These property names are allowed, because exist in commonly used specifications.
3
- */
4
- export const allowedProperties: string[];
5
- //# sourceMappingURL=allowedProperties.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"allowedProperties.d.ts","sourceRoot":"","sources":["../lib/allowedProperties.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,yCA6BC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Known packages in on DefinitelyTyped that don’t describe an npm package.
3
- */
4
- export const dtOnlyPackages: string[];
5
- /**
6
- * Known packages that export only type definitions, but which don’t contain a JavaScript file.
7
- */
8
- export const typesOnlyPackages: string[];
9
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../lib/constants.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,sCAQC;AAED;;GAEG;AACH,yCAA0E"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Determine the default ignore pattern based on `.gitignore`.
3
- *
4
- * @returns {Linter.Config | undefined}
5
- * An array of ignore patterns accepted in an ESLint configuration.
6
- */
7
- export function getIgnorePatterns(): Linter.Config | undefined;
8
- import type { Linter } from 'eslint';
9
- //# sourceMappingURL=getIgnorePatterns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getIgnorePatterns.d.ts","sourceRoot":"","sources":["../lib/getIgnorePatterns.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,qCAHa,aAAa,GAAG,SAAS,CAcrC;4BAzB0B,QAAQ"}