@perfective/eslint-config 0.29.2 → 0.31.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.
Files changed (200) hide show
  1. package/LICENSE +1 -1
  2. package/README.adoc +198 -67
  3. package/README.md +62 -45
  4. package/config/array-func/array-func-config.d.ts +2 -0
  5. package/config/array-func/array-func-config.js +16 -0
  6. package/config/cypress/cypress-config.d.ts +10 -0
  7. package/config/cypress/cypress-config.js +38 -0
  8. package/config/cypress/index.d.ts +1 -0
  9. package/config/cypress/index.js +1 -0
  10. package/config/eslint/eslint-config.d.ts +2 -0
  11. package/config/eslint/eslint-config.js +8 -0
  12. package/config/eslint/layout-formatting-rules.d.ts +2 -0
  13. package/config/eslint/layout-formatting-rules.js +64 -0
  14. package/config/eslint/possible-problems-rules.d.ts +2 -0
  15. package/config/eslint/possible-problems-rules.js +96 -0
  16. package/config/eslint/suggestions-rules.d.ts +2 -0
  17. package/config/eslint/suggestions-rules.js +181 -0
  18. package/config/eslint-comments/best-practices-rules.d.ts +2 -0
  19. package/config/eslint-comments/best-practices-rules.js +8 -0
  20. package/config/eslint-comments/eslint-comments-config.d.ts +2 -0
  21. package/config/eslint-comments/eslint-comments-config.js +11 -0
  22. package/config/eslint-comments/stylistic-issues-rules.d.ts +2 -0
  23. package/config/eslint-comments/stylistic-issues-rules.js +9 -0
  24. package/config/import/helpful-warnings-rules.d.ts +2 -0
  25. package/config/import/helpful-warnings-rules.js +11 -0
  26. package/config/import/import-config.d.ts +4 -0
  27. package/config/import/import-config.js +46 -0
  28. package/config/import/index.d.ts +1 -0
  29. package/config/import/index.js +1 -0
  30. package/config/import/module-systems-rules.d.ts +2 -0
  31. package/config/import/module-systems-rules.js +10 -0
  32. package/config/import/rules/no-extraneous-dependencies.d.ts +15 -0
  33. package/config/import/rules/no-extraneous-dependencies.js +8 -0
  34. package/config/import/static-analysis-rules.d.ts +2 -0
  35. package/config/import/static-analysis-rules.js +26 -0
  36. package/config/import/style-guide-rules.d.ts +2 -0
  37. package/config/import/style-guide-rules.js +33 -0
  38. package/config/jest/index.d.ts +1 -0
  39. package/config/jest/index.js +1 -0
  40. package/config/jest/jest-config.d.ts +8 -0
  41. package/config/jest/jest-config.js +128 -0
  42. package/config/jest/typescript-eslint-jest-rules.d.ts +2 -0
  43. package/config/jest/typescript-eslint-jest-rules.js +5 -0
  44. package/config/jest-dom/index.d.ts +1 -0
  45. package/config/jest-dom/index.js +1 -0
  46. package/config/jest-dom/jest-dom-config.d.ts +8 -0
  47. package/config/jest-dom/jest-dom-config.js +23 -0
  48. package/config/jsdoc/jsdoc-config.d.ts +3 -0
  49. package/config/jsdoc/jsdoc-config.js +179 -0
  50. package/config/node/node-config.d.ts +2 -0
  51. package/config/node/node-config.js +66 -0
  52. package/config/perfective-eslint-config.d.ts +6 -0
  53. package/config/perfective-eslint-config.js +45 -0
  54. package/config/prefer-arrow/prefer-arrow-config.d.ts +2 -0
  55. package/config/prefer-arrow/prefer-arrow-config.js +16 -0
  56. package/config/promise/promise-config.d.ts +2 -0
  57. package/config/promise/promise-config.js +37 -0
  58. package/config/rxjs/index.d.ts +1 -0
  59. package/config/rxjs/index.js +1 -0
  60. package/config/rxjs/rxjs-config.d.ts +8 -0
  61. package/config/rxjs/rxjs-config.js +67 -0
  62. package/config/security/security-config.d.ts +2 -0
  63. package/config/security/security-config.js +24 -0
  64. package/config/simple-import-sort/index.d.ts +1 -0
  65. package/config/simple-import-sort/index.js +1 -0
  66. package/config/simple-import-sort/rules/imports.d.ts +28 -0
  67. package/config/simple-import-sort/rules/imports.js +32 -0
  68. package/config/simple-import-sort/simple-import-sort-config.d.ts +2 -0
  69. package/config/simple-import-sort/simple-import-sort-config.js +13 -0
  70. package/config/stylistic/js/stylistic-js-config.d.ts +2 -0
  71. package/config/stylistic/js/stylistic-js-config.js +200 -0
  72. package/config/stylistic/jsx/stylistic-jsx-config.d.ts +2 -0
  73. package/config/stylistic/jsx/stylistic-jsx-config.js +87 -0
  74. package/config/stylistic/plus/stylistic-plus-config.d.ts +2 -0
  75. package/config/stylistic/plus/stylistic-plus-config.js +16 -0
  76. package/config/stylistic/ts/stylistic-ts-config.d.ts +2 -0
  77. package/config/stylistic/ts/stylistic-ts-config.js +141 -0
  78. package/config/testing-library/index.d.ts +1 -0
  79. package/config/testing-library/index.js +1 -0
  80. package/config/testing-library/testing-library-config.d.ts +8 -0
  81. package/config/testing-library/testing-library-config.js +45 -0
  82. package/config/typescript-eslint/extension-rules.d.ts +2 -0
  83. package/config/typescript-eslint/extension-rules.js +113 -0
  84. package/config/typescript-eslint/index.d.ts +1 -0
  85. package/config/typescript-eslint/index.js +1 -0
  86. package/{rules → config}/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +39 -0
  87. package/config/typescript-eslint/rules/typescript-eslint-naming-convention.js +26 -0
  88. package/config/typescript-eslint/supported-rules.d.ts +2 -0
  89. package/config/typescript-eslint/supported-rules.js +260 -0
  90. package/config/typescript-eslint/typescript-eslint-config.d.ts +2 -0
  91. package/config/typescript-eslint/typescript-eslint-config.js +15 -0
  92. package/config/unicorn/index.d.ts +1 -0
  93. package/config/unicorn/index.js +1 -0
  94. package/{rules → config}/unicorn/rules/prevent-abbreviations.d.ts +20 -0
  95. package/config/unicorn/rules/prevent-abbreviations.js +30 -0
  96. package/config/unicorn/unicorn-config.d.ts +2 -0
  97. package/config/unicorn/unicorn-config.js +185 -0
  98. package/index.d.ts +5 -1732
  99. package/index.js +5 -146
  100. package/linter/glob.d.ts +59 -0
  101. package/linter/glob.js +8 -0
  102. package/linter/language-options.d.ts +25 -0
  103. package/linter/language-options.js +45 -0
  104. package/linter/linter-config.d.ts +13 -0
  105. package/linter/linter-config.js +6 -0
  106. package/linter/node.d.ts +10 -0
  107. package/linter/node.js +7 -0
  108. package/linter/plugin.d.ts +15 -0
  109. package/linter/plugin.js +26 -0
  110. package/package.json +45 -45
  111. package/config/node.d.ts +0 -1
  112. package/config/node.js +0 -11
  113. package/config/plugin.d.ts +0 -2
  114. package/config/plugin.js +0 -30
  115. package/config.d.ts +0 -1
  116. package/config.js +0 -6
  117. package/cypress.d.ts +0 -1
  118. package/cypress.js +0 -56
  119. package/jest-dom.d.ts +0 -1
  120. package/jest-dom.js +0 -11
  121. package/jest.d.ts +0 -1
  122. package/jest.js +0 -24
  123. package/rules/array-func/index.d.ts +0 -14
  124. package/rules/array-func/index.js +0 -50
  125. package/rules/cypress/index.d.ts +0 -21
  126. package/rules/cypress/index.js +0 -57
  127. package/rules/eslint/index.d.ts +0 -339
  128. package/rules/eslint/index.js +0 -9
  129. package/rules/eslint/layout-formatting.d.ts +0 -64
  130. package/rules/eslint/layout-formatting.js +0 -67
  131. package/rules/eslint/possible-problems.d.ts +0 -96
  132. package/rules/eslint/possible-problems.js +0 -99
  133. package/rules/eslint/suggestions.d.ts +0 -181
  134. package/rules/eslint/suggestions.js +0 -182
  135. package/rules/eslint-comments/best-practices.d.ts +0 -8
  136. package/rules/eslint-comments/best-practices.js +0 -11
  137. package/rules/eslint-comments/index.d.ts +0 -21
  138. package/rules/eslint-comments/index.js +0 -45
  139. package/rules/eslint-comments/stylistic-issues.d.ts +0 -9
  140. package/rules/eslint-comments/stylistic-issues.js +0 -18
  141. package/rules/import/helpful-warnings.d.ts +0 -10
  142. package/rules/import/helpful-warnings.js +0 -14
  143. package/rules/import/index.d.ts +0 -78
  144. package/rules/import/index.js +0 -14
  145. package/rules/import/module-systems.d.ts +0 -10
  146. package/rules/import/module-systems.js +0 -13
  147. package/rules/import/rules/no-extraneous-dependencies.d.ts +0 -11
  148. package/rules/import/rules/no-extraneous-dependencies.js +0 -24
  149. package/rules/import/static-analysis.d.ts +0 -26
  150. package/rules/import/static-analysis.js +0 -29
  151. package/rules/import/style-guide.d.ts +0 -33
  152. package/rules/import/style-guide.js +0 -36
  153. package/rules/jest/index.d.ts +0 -124
  154. package/rules/jest/index.js +0 -72
  155. package/rules/jest/typescript-eslint.d.ts +0 -5
  156. package/rules/jest/typescript-eslint.js +0 -8
  157. package/rules/jest-dom/index.d.ts +0 -32
  158. package/rules/jest-dom/index.js +0 -55
  159. package/rules/jsdoc/index.d.ts +0 -134
  160. package/rules/jsdoc/index.js +0 -347
  161. package/rules/n/index.d.ts +0 -66
  162. package/rules/n/index.js +0 -98
  163. package/rules/prefer-arrow/index.d.ts +0 -14
  164. package/rules/prefer-arrow/index.js +0 -50
  165. package/rules/promise/index.d.ts +0 -35
  166. package/rules/promise/index.js +0 -73
  167. package/rules/rxjs/index.d.ts +0 -60
  168. package/rules/rxjs/index.js +0 -96
  169. package/rules/security/index.d.ts +0 -22
  170. package/rules/security/index.js +0 -58
  171. package/rules/simple-import-sort/index.d.ts +0 -10
  172. package/rules/simple-import-sort/index.js +0 -48
  173. package/rules/simple-import-sort/rules/imports.d.ts +0 -8
  174. package/rules/simple-import-sort/rules/imports.js +0 -46
  175. package/rules/stylistic/js/index.d.ts +0 -197
  176. package/rules/stylistic/js/index.js +0 -236
  177. package/rules/stylistic/jsx/index.d.ts +0 -81
  178. package/rules/stylistic/jsx/index.js +0 -117
  179. package/rules/stylistic/plus/index.d.ts +0 -14
  180. package/rules/stylistic/plus/index.js +0 -50
  181. package/rules/stylistic/ts/index.d.ts +0 -135
  182. package/rules/stylistic/ts/index.js +0 -169
  183. package/rules/testing-library/index.d.ts +0 -62
  184. package/rules/testing-library/index.js +0 -77
  185. package/rules/typescript-eslint/extension-rules.d.ts +0 -113
  186. package/rules/typescript-eslint/extension-rules.js +0 -116
  187. package/rules/typescript-eslint/index.d.ts +0 -369
  188. package/rules/typescript-eslint/index.js +0 -45
  189. package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.js +0 -32
  190. package/rules/typescript-eslint/supported-rules.d.ts +0 -253
  191. package/rules/typescript-eslint/supported-rules.js +0 -319
  192. package/rules/unicorn/index.d.ts +0 -178
  193. package/rules/unicorn/index.js +0 -209
  194. package/rules/unicorn/rules/prevent-abbreviations.js +0 -8
  195. package/rules.d.ts +0 -4
  196. package/rules.js +0 -14
  197. package/rxjs.d.ts +0 -1
  198. package/rxjs.js +0 -58
  199. package/testing-library.d.ts +0 -1
  200. package/testing-library.js +0 -11
@@ -1,8 +1,40 @@
1
+ /**
2
+ * Values for the `@typescript-eslint/naming-convention` rule `format` option.
3
+ *
4
+ * @since v0.11.0
5
+ */
1
6
  export type TypescriptEslintNamingConventionFormat = 'camelCase' | 'strictCamelCase' | 'PascalCase' | 'StrictPascalCase' | 'snake_case' | 'UPPER_CASE';
7
+ /**
8
+ * Values for individual selectors for the `@typescript-eslint/naming-convention` rule `selector` option.
9
+ *
10
+ * @since v0.11.0
11
+ */
2
12
  export type TypescriptEslintNamingConventionIndividualSelector = 'variable' | 'function' | 'parameter' | 'classProperty' | 'objectLiteralProperty' | 'typeProperty' | 'parameterProperty' | 'classMethod' | 'objectLiteralMethod' | 'typeMethod' | 'accessor' | 'enumMember' | 'class' | 'interface' | 'typeAlias' | 'enum' | 'typeParameter';
13
+ /**
14
+ * Values for grouped of individual selectors for the `@typescript-eslint/naming-convention` rule `selector` option.
15
+ *
16
+ * @since v0.11.0
17
+ */
3
18
  export type TypescriptEslintNamingConventionGroupSelector = 'default' | 'variableLike' | 'memberLike' | 'typeLike' | 'property' | 'method';
19
+ /**
20
+ * Values for the `@typescript-eslint/naming-convention` rule `selector` option.
21
+ *
22
+ * @since v0.11.0
23
+ */
4
24
  export type TypescriptEslintNamingConventionSelector = TypescriptEslintNamingConventionIndividualSelector | TypescriptEslintNamingConventionGroupSelector;
25
+ /**
26
+ * Values for the `@typescript-eslint/naming-convention` rule `leadingUnderscore` and `trailingUnderscore` options.
27
+ *
28
+ * @since v0.11.0
29
+ */
5
30
  export type TypescriptEslintNamingConventionUnderscore = 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
31
+ /**
32
+ * Configuration options for the `@typescript-eslint/naming-convention` rule.
33
+ *
34
+ * @see https://typescript-eslint.io/rules/naming-convention/
35
+ *
36
+ * @since v0.11.0
37
+ */
6
38
  export interface TypescriptEslintNamingConvention {
7
39
  selector: TypescriptEslintNamingConventionSelector | TypescriptEslintNamingConventionSelector[];
8
40
  format: TypescriptEslintNamingConventionFormat[] | null;
@@ -16,4 +48,11 @@ export interface TypescriptEslintNamingConvention {
16
48
  match: boolean;
17
49
  };
18
50
  }
51
+ /**
52
+ * Creates configuration with the given extensions for the `@typescript-eslint/naming-convention` rule.
53
+ *
54
+ * @see https://typescript-eslint.io/rules/naming-convention/
55
+ *
56
+ * @since v0.11.0
57
+ */
19
58
  export declare function typescriptEslintNamingConvention(extensions?: TypescriptEslintNamingConvention[]): TypescriptEslintNamingConvention[];
@@ -0,0 +1,26 @@
1
+ export function typescriptEslintNamingConvention(extensions = []) {
2
+ return typescriptEslintNamingConventionDefaults().concat(extensions);
3
+ }
4
+ function typescriptEslintNamingConventionDefaults() {
5
+ return [{
6
+ selector: ['enumMember', 'typeLike'],
7
+ format: ['StrictPascalCase']
8
+ }, {
9
+ selector: ['memberLike', 'variableLike'],
10
+ format: ['strictCamelCase']
11
+ }, {
12
+ selector: ['objectLiteralProperty'],
13
+ modifiers: ['requiresQuotes'],
14
+ format: null
15
+ }, {
16
+ selector: ['parameter'],
17
+ modifiers: ['unused'],
18
+ format: ['strictCamelCase'],
19
+ leadingUnderscore: 'allow'
20
+ }, {
21
+ selector: ['classProperty'],
22
+ modifiers: ['private'],
23
+ format: ['strictCamelCase'],
24
+ leadingUnderscore: 'allow'
25
+ }];
26
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare const supportedRules: Linter.RulesRecord;
@@ -0,0 +1,260 @@
1
+ import { typescriptEslintNamingConvention } from "./rules/typescript-eslint-naming-convention.js";
2
+ export const supportedRules = {
3
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
4
+ '@typescript-eslint/array-type': ['warn', {
5
+ default: 'array',
6
+ readonly: 'array'
7
+ }],
8
+ '@typescript-eslint/await-thenable': 'error',
9
+ '@typescript-eslint/ban-ts-comment': 'error',
10
+ '@typescript-eslint/ban-tslint-comment': 'warn',
11
+ '@typescript-eslint/ban-types': 'off',
12
+ '@typescript-eslint/class-literal-property-style': 'off',
13
+ '@typescript-eslint/consistent-generic-constructors': ['warn', 'type-annotation'],
14
+ '@typescript-eslint/consistent-indexed-object-style': ['warn', 'record'],
15
+ '@typescript-eslint/consistent-type-assertions': ['error', {
16
+ assertionStyle: 'as',
17
+ arrayLiteralTypeAssertions: 'allow-as-parameter',
18
+ objectLiteralTypeAssertions: 'allow'
19
+ }],
20
+ '@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
21
+ '@typescript-eslint/consistent-type-exports': ['off', {
22
+ fixMixedExportsWithInlineTypeSpecifier: true
23
+ }],
24
+ '@typescript-eslint/consistent-type-imports': ['warn', {
25
+ prefer: 'no-type-imports',
26
+ disallowTypeAnnotations: true
27
+ }],
28
+ '@typescript-eslint/explicit-function-return-type': ['error', {
29
+ allowConciseArrowFunctionExpressionsStartingWithVoid: true,
30
+ allowDirectConstAssertionInArrowFunctions: true,
31
+ allowExpressions: false,
32
+ allowFunctionsWithoutTypeParameters: false,
33
+ allowHigherOrderFunctions: true,
34
+ allowIIFEs: false,
35
+ allowTypedFunctionExpressions: true,
36
+ allowedNames: []
37
+ }],
38
+ '@typescript-eslint/explicit-member-accessibility': 'warn',
39
+ '@typescript-eslint/explicit-module-boundary-types': 'error',
40
+ '@typescript-eslint/member-delimiter-style': 'off',
41
+ '@typescript-eslint/member-ordering': ['error', {
42
+ default: ['signature', 'call-signature', 'public-static-field', 'public-abstract-field', 'public-decorated-field', 'public-instance-field', 'protected-static-field', 'protected-abstract-field', 'protected-decorated-field', 'protected-instance-field', 'private-static-field', '#private-static-field', 'private-decorated-field', 'private-instance-field', '#private-instance-field', 'field', 'static-initialization', 'constructor', 'public-static-method', 'public-static-set', 'public-static-get', 'public-abstract-method', 'public-abstract-set', 'public-abstract-get', 'public-decorated-method', 'public-decorated-set', 'public-decorated-get', 'public-instance-method', 'public-instance-set', 'public-instance-get', 'protected-static-method', 'protected-static-set', 'protected-static-get', 'protected-abstract-method', 'protected-abstract-set', 'protected-abstract-get', 'protected-decorated-method', 'protected-decorated-set', 'protected-decorated-get', 'protected-instance-method', 'protected-instance-set', 'protected-instance-get', 'private-static-method', '#private-static-method', 'private-static-set', 'private-static-get', '#private-static-set', '#private-static-get', 'private-decorated-method', 'private-decorated-set', 'private-decorated-get', 'private-instance-method', '#private-instance-method', 'private-instance-set', 'private-instance-get', '#private-instance-set', '#private-instance-get', 'method']
43
+ }],
44
+ '@typescript-eslint/method-signature-style': ['warn', 'property'],
45
+ '@typescript-eslint/naming-convention': ['error', ...typescriptEslintNamingConvention()],
46
+ '@typescript-eslint/no-array-delete': 'error',
47
+ '@typescript-eslint/no-base-to-string': 'error',
48
+ '@typescript-eslint/no-confusing-non-null-assertion': 'warn',
49
+ '@typescript-eslint/no-confusing-void-expression': ['warn', {
50
+ ignoreArrowShorthand: true,
51
+ ignoreVoidOperator: false
52
+ }],
53
+ '@typescript-eslint/no-deprecated': 'error',
54
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
55
+ '@typescript-eslint/no-duplicate-type-constituents': ['error', {
56
+ ignoreIntersections: false,
57
+ ignoreUnions: false
58
+ }],
59
+ '@typescript-eslint/no-dynamic-delete': 'warn',
60
+ '@typescript-eslint/no-empty-interface': ['off', {
61
+ allowSingleExtends: true
62
+ }],
63
+ '@typescript-eslint/no-empty-object-type': ['error', {
64
+ allowInterfaces: 'always',
65
+ allowObjectTypes: 'never'
66
+ }],
67
+ '@typescript-eslint/no-explicit-any': ['error', {
68
+ fixToUnknown: false,
69
+ ignoreRestArgs: false
70
+ }],
71
+ '@typescript-eslint/no-extra-non-null-assertion': 'warn',
72
+ '@typescript-eslint/no-extraneous-class': ['error', {
73
+ allowConstructorOnly: false,
74
+ allowEmpty: false,
75
+ allowStaticOnly: false,
76
+ allowWithDecorator: true
77
+ }],
78
+ '@typescript-eslint/no-floating-promises': ['error', {
79
+ allowForKnownSafeCalls: [],
80
+ allowForKnownSafePromises: [],
81
+ checkThenables: true,
82
+ ignoreIIFE: false,
83
+ ignoreVoid: true
84
+ }],
85
+ '@typescript-eslint/no-for-in-array': 'error',
86
+ '@typescript-eslint/no-import-type-side-effects': 'warn',
87
+ '@typescript-eslint/no-inferrable-types': 'off',
88
+ '@typescript-eslint/no-invalid-void-type': ['error', {
89
+ allowInGenericTypeArguments: true
90
+ }],
91
+ '@typescript-eslint/no-meaningless-void-operator': ['warn', {
92
+ checkNever: true
93
+ }],
94
+ '@typescript-eslint/no-misused-new': 'error',
95
+ '@typescript-eslint/no-misused-promises': ['error', {
96
+ checksConditionals: true,
97
+ checksVoidReturn: true
98
+ }],
99
+ '@typescript-eslint/no-misused-spread': 'error',
100
+ '@typescript-eslint/no-mixed-enums': 'error',
101
+ '@typescript-eslint/no-namespace': 'error',
102
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
103
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
104
+ '@typescript-eslint/no-non-null-assertion': 'error',
105
+ '@typescript-eslint/no-redundant-type-constituents': 'error',
106
+ '@typescript-eslint/no-unnecessary-type-parameters': 'error',
107
+ '@typescript-eslint/no-require-imports': ['error', {
108
+ allow: []
109
+ }],
110
+ '@typescript-eslint/no-restricted-types': ['error', {
111
+ types: {
112
+ object: {
113
+ message: ['The `object` type is currently hard to use', '(https://github.com/microsoft/TypeScript/issues/21732).'].join(' '),
114
+ suggest: ['Record<string, unknown>']
115
+ }
116
+ }
117
+ }],
118
+ '@typescript-eslint/no-this-alias': 'error',
119
+ '@typescript-eslint/no-type-alias': 'off',
120
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': ['warn', {
121
+ allowComparingNullableBooleansToTrue: true,
122
+ allowComparingNullableBooleansToFalse: true
123
+ }],
124
+ '@typescript-eslint/no-unnecessary-condition': ['error', {
125
+ allowConstantLoopConditions: false,
126
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
127
+ checkTypePredicates: true
128
+ }],
129
+ '@typescript-eslint/no-unnecessary-parameter-property-assignment': 'error',
130
+ '@typescript-eslint/no-unnecessary-qualifier': 'warn',
131
+ '@typescript-eslint/no-unnecessary-template-expression': 'error',
132
+ '@typescript-eslint/no-unnecessary-type-arguments': 'warn',
133
+ '@typescript-eslint/no-unnecessary-type-assertion': ['warn', {
134
+ checkLiteralConstAssertions: true,
135
+ typesToIgnore: []
136
+ }],
137
+ '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
138
+ '@typescript-eslint/no-unsafe-argument': 'error',
139
+ '@typescript-eslint/no-unsafe-assignment': 'error',
140
+ '@typescript-eslint/no-unsafe-call': 'error',
141
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
142
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
143
+ '@typescript-eslint/no-unsafe-function-type': 'warn',
144
+ '@typescript-eslint/no-unsafe-member-access': 'error',
145
+ '@typescript-eslint/no-unsafe-return': 'error',
146
+ '@typescript-eslint/no-unsafe-type-assertion': 'off',
147
+ '@typescript-eslint/no-unsafe-unary-minus': 'error',
148
+ '@typescript-eslint/no-useless-empty-export': 'warn',
149
+ '@typescript-eslint/no-useless-template-literal': 'off',
150
+ '@typescript-eslint/no-var-requires': ['error', {
151
+ allow: []
152
+ }],
153
+ '@typescript-eslint/no-wrapper-object-types': 'warn',
154
+ '@typescript-eslint/non-nullable-type-assertion-style': 'error',
155
+ '@typescript-eslint/parameter-properties': ['error', {
156
+ prefer: 'parameter-property'
157
+ }],
158
+ '@typescript-eslint/prefer-as-const': 'warn',
159
+ '@typescript-eslint/prefer-enum-initializers': 'error',
160
+ '@typescript-eslint/prefer-find': 'error',
161
+ '@typescript-eslint/prefer-for-of': 'error',
162
+ '@typescript-eslint/prefer-function-type': 'warn',
163
+ '@typescript-eslint/prefer-includes': 'warn',
164
+ '@typescript-eslint/prefer-literal-enum-member': ['error', {
165
+ allowBitwiseExpressions: true
166
+ }],
167
+ '@typescript-eslint/prefer-namespace-keyword': 'warn',
168
+ '@typescript-eslint/prefer-nullish-coalescing': ['error', {
169
+ ignoreBooleanCoercion: false,
170
+ ignoreIfStatements: false,
171
+ ignoreTernaryTests: false,
172
+ ignoreConditionalTests: true,
173
+ ignoreMixedLogicalExpressions: true,
174
+ ignorePrimitives: {
175
+ bigint: false,
176
+ boolean: false,
177
+ number: false,
178
+ string: false
179
+ }
180
+ }],
181
+ '@typescript-eslint/prefer-optional-chain': ['error', {
182
+ checkAny: true,
183
+ checkUnknown: true,
184
+ checkString: true,
185
+ checkNumber: true,
186
+ checkBoolean: true,
187
+ checkBigInt: true,
188
+ requireNullish: false
189
+ }],
190
+ '@typescript-eslint/prefer-readonly': 'warn',
191
+ '@typescript-eslint/prefer-readonly-parameter-types': 'off',
192
+ '@typescript-eslint/prefer-reduce-type-parameter': 'warn',
193
+ '@typescript-eslint/prefer-regexp-exec': 'warn',
194
+ '@typescript-eslint/prefer-return-this-type': 'warn',
195
+ '@typescript-eslint/prefer-string-starts-ends-with': ['warn', {
196
+ allowSingleElementEquality: 'never'
197
+ }],
198
+ '@typescript-eslint/prefer-ts-expect-error': 'off',
199
+ '@typescript-eslint/promise-function-async': ['warn', {
200
+ checkArrowFunctions: false
201
+ }],
202
+ '@typescript-eslint/require-array-sort-compare': ['error', {
203
+ ignoreStringArrays: true
204
+ }],
205
+ '@typescript-eslint/restrict-plus-operands': ['error', {
206
+ allowAny: false,
207
+ allowBoolean: false,
208
+ allowNullish: false,
209
+ allowNumberAndString: false,
210
+ allowRegExp: false,
211
+ skipCompoundAssignments: false
212
+ }],
213
+ '@typescript-eslint/restrict-template-expressions': ['error', {
214
+ allowAny: false,
215
+ allowArray: false,
216
+ allowBoolean: false,
217
+ allowNullish: false,
218
+ allowNumber: false,
219
+ allowRegExp: false,
220
+ allowNever: false
221
+ }],
222
+ '@typescript-eslint/sort-type-constituents': 'off',
223
+ '@typescript-eslint/strict-boolean-expressions': ['error', {
224
+ allowString: false,
225
+ allowNumber: false,
226
+ allowNullableEnum: false,
227
+ allowNullableObject: true,
228
+ allowNullableBoolean: false,
229
+ allowNullableString: false,
230
+ allowNullableNumber: false,
231
+ allowAny: false
232
+ }],
233
+ '@typescript-eslint/switch-exhaustiveness-check': ['error', {
234
+ allowDefaultCaseForExhaustiveSwitch: false,
235
+ requireDefaultForNonUnion: true
236
+ }],
237
+ '@typescript-eslint/triple-slash-reference': ['error', {
238
+ path: 'never',
239
+ types: 'always',
240
+ lib: 'never'
241
+ }],
242
+ '@typescript-eslint/type-annotation-spacing': 'off',
243
+ '@typescript-eslint/typedef': ['error', {
244
+ arrayDestructuring: false,
245
+ arrowParameter: false,
246
+ memberVariableDeclaration: true,
247
+ objectDestructuring: false,
248
+ parameter: true,
249
+ propertyDeclaration: true,
250
+ variableDeclaration: false,
251
+ variableDeclarationIgnoreFunction: false
252
+ }],
253
+ '@typescript-eslint/unbound-method': ['error', {
254
+ ignoreStatic: false
255
+ }],
256
+ '@typescript-eslint/unified-signatures': ['error', {
257
+ ignoreDifferentlyNamedParameters: true
258
+ }],
259
+ '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error'
260
+ };
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function typescriptEslintConfig(): Linter.Config;
@@ -0,0 +1,15 @@
1
+ import { plugin } from 'typescript-eslint';
2
+ import { typescriptFiles } from "../../linter/glob.js";
3
+ import { typescriptLanguageOptions } from "../../linter/language-options.js";
4
+ import { extensionRules } from "./extension-rules.js";
5
+ import { supportedRules } from "./supported-rules.js";
6
+ export function typescriptEslintConfig() {
7
+ return {
8
+ files: typescriptFiles,
9
+ languageOptions: typescriptLanguageOptions(),
10
+ plugins: {
11
+ '@typescript-eslint': plugin
12
+ },
13
+ rules: Object.assign(Object.assign({}, supportedRules), extensionRules)
14
+ };
15
+ }
@@ -0,0 +1 @@
1
+ export { UnicornPreventAbbreviationReplacements, UnicornPreventAbbreviations, unicornPreventAbbreviations, } from './rules/prevent-abbreviations';
@@ -0,0 +1 @@
1
+ export { unicornPreventAbbreviations } from "./rules/prevent-abbreviations.js";
@@ -1,4 +1,14 @@
1
+ /**
2
+ * Nominal type for the `replacements` option of the `unicorn/prevent-abbreviation` rule.
3
+ */
1
4
  export type UnicornPreventAbbreviationReplacements = Record<string, boolean | Record<string, boolean>>;
5
+ /**
6
+ * Configuration options for the `unicorn/prevent-abbreviation` rule.
7
+ *
8
+ * @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
9
+ *
10
+ * @since v0.11.0
11
+ */
2
12
  export interface UnicornPreventAbbreviations {
3
13
  replacements: UnicornPreventAbbreviationReplacements;
4
14
  extendDefaultReplacements: boolean;
@@ -12,4 +22,14 @@ export interface UnicornPreventAbbreviations {
12
22
  checkFilenames: boolean;
13
23
  ignore: RegExp[];
14
24
  }
25
+ /**
26
+ * Creates configuration for the `unicorn/prevent-abbreviation` rule with the given replacements and options.
27
+ *
28
+ * @param replacements - List of additional replacements.
29
+ * @param options - Additional properties to override.
30
+ *
31
+ * @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
32
+ *
33
+ * @since v0.11.0
34
+ */
15
35
  export declare function unicornPreventAbbreviations(replacements?: UnicornPreventAbbreviationReplacements, options?: Partial<Pick<UnicornPreventAbbreviations, 'checkProperties'>>): UnicornPreventAbbreviations;
@@ -0,0 +1,30 @@
1
+ export function unicornPreventAbbreviations(replacements = {}, options = {}) {
2
+ return Object.assign(Object.assign({
3
+ replacements: Object.assign({
4
+ arg: false,
5
+ args: false,
6
+ db: false,
7
+ doc: false,
8
+ docs: false,
9
+ dev: false,
10
+ env: false,
11
+ i: false,
12
+ j: false,
13
+ lib: false,
14
+ libs: false,
15
+ param: false,
16
+ params: false
17
+ }, replacements),
18
+ extendDefaultReplacements: true,
19
+ allowList: {},
20
+ extendDefaultAllowList: true,
21
+ checkDefaultAndNamespaceImports: 'internal',
22
+ checkShorthandImports: 'internal',
23
+ checkShorthandProperties: false,
24
+ checkProperties: false,
25
+ checkVariables: true,
26
+ checkFilenames: true
27
+ }, options), {
28
+ ignore: [/e2e/u]
29
+ });
30
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function unicornConfig(): Linter.Config;
@@ -0,0 +1,185 @@
1
+ import eslintPluginUnicorn from 'eslint-plugin-unicorn';
2
+ import { unicornPreventAbbreviations } from "./rules/prevent-abbreviations.js";
3
+ export function unicornConfig() {
4
+ return {
5
+ plugins: {
6
+ unicorn: eslintPluginUnicorn
7
+ },
8
+ rules: {
9
+ 'unicorn/better-regex': 'warn',
10
+ 'unicorn/catch-error-name': 'warn',
11
+ 'unicorn/consistent-assert': 'warn',
12
+ 'unicorn/consistent-date-clone': 'warn',
13
+ 'unicorn/consistent-destructuring': 'warn',
14
+ 'unicorn/consistent-empty-array-spread': 'warn',
15
+ 'unicorn/consistent-existence-index-check': 'warn',
16
+ 'unicorn/consistent-function-scoping': ['error', {
17
+ checkArrowFunctions: true
18
+ }],
19
+ 'unicorn/custom-error-definition': 'warn',
20
+ 'unicorn/empty-brace-spaces': 'warn',
21
+ 'unicorn/error-message': 'error',
22
+ 'unicorn/escape-case': ['warn', 'uppercase'],
23
+ 'unicorn/expiring-todo-comments': 'error',
24
+ 'unicorn/explicit-length-check': 'warn',
25
+ 'unicorn/filename-case': ['error', {
26
+ case: 'kebabCase'
27
+ }],
28
+ 'unicorn/import-index': 'off',
29
+ 'unicorn/import-style': 'off',
30
+ 'unicorn/new-for-builtins': 'warn',
31
+ 'unicorn/no-abusive-eslint-disable': 'error',
32
+ 'unicorn/no-accessor-recursion': 'error',
33
+ 'unicorn/no-anonymous-default-export': 'error',
34
+ 'unicorn/no-array-callback-reference': 'off',
35
+ 'unicorn/no-array-for-each': 'off',
36
+ 'unicorn/no-array-method-this-argument': 'warn',
37
+ 'unicorn/no-array-reduce': 'off',
38
+ 'unicorn/no-await-expression-member': 'error',
39
+ 'unicorn/no-await-in-promise-methods': 'error',
40
+ 'unicorn/no-console-spaces': 'warn',
41
+ 'unicorn/no-document-cookie': 'error',
42
+ 'unicorn/no-empty-file': 'error',
43
+ 'unicorn/no-for-loop': 'warn',
44
+ 'unicorn/no-hex-escape': 'warn',
45
+ 'unicorn/no-instanceof-array': 'off',
46
+ 'unicorn/no-instanceof-builtins': 'warn',
47
+ 'unicorn/no-invalid-fetch-options': 'error',
48
+ 'unicorn/no-invalid-remove-event-listener': 'error',
49
+ 'unicorn/no-keyword-prefix': ['off', {
50
+ disallowedPrefixes: ['new', 'class'],
51
+ checkProperties: true,
52
+ onlyCamelCase: false
53
+ }],
54
+ 'unicorn/no-lonely-if': 'warn',
55
+ 'unicorn/no-magic-array-flat-depth': 'error',
56
+ 'unicorn/no-named-default': 'warn',
57
+ 'unicorn/no-negated-condition': 'warn',
58
+ 'unicorn/no-negation-in-equality-check': 'error',
59
+ 'unicorn/no-nested-ternary': 'off',
60
+ 'unicorn/no-new-array': 'warn',
61
+ 'unicorn/no-new-buffer': 'warn',
62
+ 'unicorn/no-null': 'off',
63
+ 'unicorn/no-object-as-default-parameter': 'error',
64
+ 'unicorn/no-process-exit': 'error',
65
+ 'unicorn/no-single-promise-in-promise-methods': 'warn',
66
+ 'unicorn/no-static-only-class': 'error',
67
+ 'unicorn/no-thenable': 'error',
68
+ 'unicorn/no-this-assignment': 'error',
69
+ 'unicorn/no-typeof-undefined': ['warn', {
70
+ checkGlobalVariables: true
71
+ }],
72
+ 'unicorn/no-unnecessary-array-flat-depth': 'warn',
73
+ 'unicorn/no-unnecessary-array-splice-count': 'warn',
74
+ 'unicorn/no-unnecessary-await': 'warn',
75
+ 'unicorn/no-unnecessary-polyfills': 'error',
76
+ 'unicorn/no-unnecessary-slice-end': 'warn',
77
+ 'unicorn/no-unreadable-array-destructuring': 'error',
78
+ 'unicorn/no-unreadable-iife': 'error',
79
+ 'unicorn/no-unsafe-regex': 'off',
80
+ 'unicorn/no-unused-properties': 'off',
81
+ 'unicorn/no-useless-fallback-in-spread': 'warn',
82
+ 'unicorn/no-useless-length-check': 'warn',
83
+ 'unicorn/no-useless-promise-resolve-reject': 'warn',
84
+ 'unicorn/no-useless-spread': 'warn',
85
+ 'unicorn/no-useless-switch-case': 'error',
86
+ 'unicorn/no-useless-undefined': 'off',
87
+ 'unicorn/no-zero-fractions': 'off',
88
+ 'unicorn/number-literal-case': ['warn', {
89
+ hexadecimalValue: 'uppercase'
90
+ }],
91
+ 'unicorn/numeric-separators-style': ['warn', {
92
+ hexadecimal: {
93
+ minimumDigits: 6,
94
+ groupLength: 2
95
+ },
96
+ binary: {
97
+ minimumDigits: 0,
98
+ groupLength: 4
99
+ },
100
+ octal: {
101
+ minimumDigits: 0,
102
+ groupLength: 4
103
+ },
104
+ number: {
105
+ minimumDigits: 6,
106
+ groupLength: 3
107
+ }
108
+ }],
109
+ 'unicorn/prefer-add-event-listener': 'warn',
110
+ 'unicorn/prefer-array-find': ['warn', {
111
+ checkFromLast: true
112
+ }],
113
+ 'unicorn/prefer-array-flat': 'off',
114
+ 'unicorn/prefer-array-flat-map': 'off',
115
+ 'unicorn/prefer-array-index-of': 'warn',
116
+ 'unicorn/prefer-array-some': 'error',
117
+ 'unicorn/prefer-at': 'off',
118
+ 'unicorn/prefer-blob-reading-methods': 'error',
119
+ 'unicorn/prefer-code-point': 'error',
120
+ 'unicorn/prefer-date-now': 'warn',
121
+ 'unicorn/prefer-default-parameters': 'warn',
122
+ 'unicorn/prefer-dom-node-append': 'warn',
123
+ 'unicorn/prefer-dom-node-dataset': 'warn',
124
+ 'unicorn/prefer-dom-node-remove': 'warn',
125
+ 'unicorn/prefer-dom-node-text-content': 'warn',
126
+ 'unicorn/prefer-event-target': 'error',
127
+ 'unicorn/prefer-export-from': 'warn',
128
+ 'unicorn/prefer-global-this': 'warn',
129
+ 'unicorn/prefer-includes': 'warn',
130
+ 'unicorn/prefer-import-meta-properties': 'warn',
131
+ 'unicorn/prefer-json-parse-buffer': 'warn',
132
+ 'unicorn/prefer-keyboard-event-key': 'warn',
133
+ 'unicorn/prefer-logical-operator-over-ternary': 'error',
134
+ 'unicorn/prefer-math-min-max': 'warn',
135
+ 'unicorn/prefer-math-trunc': 'warn',
136
+ 'unicorn/prefer-modern-dom-apis': 'warn',
137
+ 'unicorn/prefer-modern-math-apis': 'warn',
138
+ 'unicorn/prefer-module': 'off',
139
+ 'unicorn/prefer-native-coercion-functions': 'warn',
140
+ 'unicorn/prefer-negative-index': 'warn',
141
+ 'unicorn/prefer-node-protocol': 'warn',
142
+ 'unicorn/prefer-number-properties': ['warn', {
143
+ checkInfinity: true,
144
+ checkNaN: true
145
+ }],
146
+ 'unicorn/prefer-object-from-entries': ['off', {
147
+ functions: []
148
+ }],
149
+ 'unicorn/prefer-optional-catch-binding': 'warn',
150
+ 'unicorn/prefer-prototype-methods': 'warn',
151
+ 'unicorn/prefer-query-selector': 'warn',
152
+ 'unicorn/prefer-reflect-apply': 'warn',
153
+ 'unicorn/prefer-regexp-test': 'off',
154
+ 'unicorn/prefer-set-has': 'warn',
155
+ 'unicorn/prefer-set-size': 'warn',
156
+ 'unicorn/prefer-single-call': ['warn', {
157
+ ignore: ['readable', 'this', 'this.stream']
158
+ }],
159
+ 'unicorn/prefer-spread': 'off',
160
+ 'unicorn/prefer-string-raw': 'off',
161
+ 'unicorn/prefer-string-replace-all': 'off',
162
+ 'unicorn/prefer-string-slice': 'warn',
163
+ 'unicorn/prefer-string-starts-ends-with': 'warn',
164
+ 'unicorn/prefer-string-trim-start-end': 'warn',
165
+ 'unicorn/prefer-structured-clone': 'off',
166
+ 'unicorn/prefer-switch': ['error', {
167
+ minimumCases: 3,
168
+ emptyDefaultCase: 'do-nothing-comment'
169
+ }],
170
+ 'unicorn/prefer-ternary': 'off',
171
+ 'unicorn/prefer-top-level-await': 'off',
172
+ 'unicorn/prefer-type-error': 'warn',
173
+ 'unicorn/prevent-abbreviations': ['warn', unicornPreventAbbreviations()],
174
+ 'unicorn/relative-url-style': ['warn', 'always'],
175
+ 'unicorn/require-array-join-separator': 'warn',
176
+ 'unicorn/require-number-to-fixed-digits-argument': 'warn',
177
+ 'unicorn/require-post-message-target-origin': 'error',
178
+ 'unicorn/string-content': 'off',
179
+ 'unicorn/switch-case-braces': 'off',
180
+ 'unicorn/template-indent': 'warn',
181
+ 'unicorn/text-encoding-identifier-case': 'error',
182
+ 'unicorn/throw-new-error': 'warn'
183
+ }
184
+ };
185
+ }