@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
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare const typescriptEslintJestRules: Linter.RulesRecord;
@@ -0,0 +1,5 @@
1
+ export const typescriptEslintJestRules = {
2
+ 'jest/unbound-method': ['error', {
3
+ ignoreStatic: false
4
+ }]
5
+ };
@@ -0,0 +1 @@
1
+ export { jestDomConfig } from './jest-dom-config';
@@ -0,0 +1 @@
1
+ export { jestDomConfig } from "./jest-dom-config.js";
@@ -0,0 +1,8 @@
1
+ import { Linter } from 'eslint';
2
+ import { Glob } from '../../linter/glob';
3
+ /**
4
+ * Creates a flat config for `eslint-plugin-jest-dom` for a given list of files globs.
5
+ *
6
+ * @since v0.31.0
7
+ */
8
+ export declare function jestDomConfig(files?: Glob[]): Linter.Config;
@@ -0,0 +1,23 @@
1
+ import eslintPluginJestDom from 'eslint-plugin-jest-dom';
2
+ import { jestFiles } from "../../linter/glob.js";
3
+ export function jestDomConfig(files = jestFiles) {
4
+ return {
5
+ files,
6
+ plugins: {
7
+ 'jest-dom': eslintPluginJestDom
8
+ },
9
+ rules: {
10
+ 'jest-dom/prefer-checked': 'warn',
11
+ 'jest-dom/prefer-empty': 'warn',
12
+ 'jest-dom/prefer-enabled-disabled': 'warn',
13
+ 'jest-dom/prefer-focus': 'warn',
14
+ 'jest-dom/prefer-in-document': 'off',
15
+ 'jest-dom/prefer-required': 'warn',
16
+ 'jest-dom/prefer-to-have-attribute': 'warn',
17
+ 'jest-dom/prefer-to-have-class': 'warn',
18
+ 'jest-dom/prefer-to-have-style': 'warn',
19
+ 'jest-dom/prefer-to-have-text-content': 'warn',
20
+ 'jest-dom/prefer-to-have-value': 'warn'
21
+ }
22
+ };
23
+ }
@@ -0,0 +1,3 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function jsdocConfig(): Linter.Config;
3
+ export declare function jsdocJavascriptConfig(): Linter.Config;
@@ -0,0 +1,179 @@
1
+ import eslintPluginJsdoc from 'eslint-plugin-jsdoc';
2
+ import { javascriptFiles } from "../../linter/glob.js";
3
+ import { javascriptLanguageOptions } from "../../linter/language-options.js";
4
+ export function jsdocConfig() {
5
+ return {
6
+ plugins: {
7
+ jsdoc: {
8
+ rules: eslintPluginJsdoc.configs['flat/recommended'].plugins['jsdoc'].rules
9
+ }
10
+ },
11
+ settings: {
12
+ jsdoc: {
13
+ tagNamePreference: {
14
+ augments: {
15
+ message: 'Use @extends instead of @augments as it is more evocative of classes than @augments',
16
+ replacement: 'extends'
17
+ },
18
+ todo: {
19
+ message: 'Use TODO for comments'
20
+ },
21
+ fires: {
22
+ replacement: 'emits'
23
+ }
24
+ },
25
+ ignoreReplacesDocs: true,
26
+ overrideReplacesDocs: true,
27
+ augmentsExtendsReplacesDocs: false,
28
+ implementsReplacesDoc: false
29
+ }
30
+ },
31
+ rules: {
32
+ 'jsdoc/check-access': 'off',
33
+ 'jsdoc/check-alignment': 'error',
34
+ 'jsdoc/check-examples': 'off',
35
+ 'jsdoc/check-indentation': 'off',
36
+ 'jsdoc/check-line-alignment': ['off', 'never'],
37
+ 'jsdoc/check-param-names': ['error', {
38
+ allowExtraTrailingParamDocs: false,
39
+ checkDestructured: true,
40
+ checkRestProperty: false,
41
+ disableExtraPropertyReporting: false,
42
+ disableMissingParamChecks: false,
43
+ enableFixer: true,
44
+ useDefaultObjectProperties: false
45
+ }],
46
+ 'jsdoc/check-property-names': ['error', {
47
+ enableFixer: true
48
+ }],
49
+ 'jsdoc/check-syntax': 'error',
50
+ 'jsdoc/check-tag-names': ['error', {
51
+ definedTags: ['final', 'flags', 'sealed', 'workaround'],
52
+ jsxTags: true
53
+ }],
54
+ 'jsdoc/check-template-names': 'error',
55
+ 'jsdoc/check-types': ['error', {
56
+ noDefaults: false
57
+ }],
58
+ 'jsdoc/check-values': 'error',
59
+ 'jsdoc/convert-to-jsdoc-comments': 'off',
60
+ 'jsdoc/empty-tags': ['error', {
61
+ tags: ['final', 'flags', 'sealed']
62
+ }],
63
+ 'jsdoc/implements-on-classes': 'error',
64
+ 'jsdoc/imports-as-dependencies': 'error',
65
+ 'jsdoc/lines-before-block': 'off',
66
+ 'jsdoc/match-description': 'error',
67
+ 'jsdoc/match-name': 'off',
68
+ 'jsdoc/multiline-blocks': ['warn', {
69
+ noZeroLineText: true,
70
+ noFinalLineText: true,
71
+ noSingleLineBlocks: true,
72
+ singleLineTags: ['lends', 'type', 'deprecated'],
73
+ noMultilineBlocks: false,
74
+ multilineTags: ['*'],
75
+ allowMultipleTags: true
76
+ }],
77
+ 'jsdoc/no-bad-blocks': ['error', {
78
+ ignore: ['ts-check', 'ts-expect-error', 'ts-ignore', 'ts-nocheck', 'typescript-eslint'],
79
+ preventAllMultiAsteriskBlocks: false
80
+ }],
81
+ 'jsdoc/no-blank-blocks': 'warn',
82
+ 'jsdoc/no-blank-block-descriptions': 'off',
83
+ 'jsdoc/no-defaults': 'error',
84
+ 'jsdoc/no-missing-syntax': 'off',
85
+ 'jsdoc/no-multi-asterisks': ['error', {
86
+ allowWhitespace: false,
87
+ preventAtMiddleLines: true,
88
+ preventAtEnd: true
89
+ }],
90
+ 'jsdoc/no-restricted-syntax': 'off',
91
+ 'jsdoc/no-types': 'error',
92
+ 'jsdoc/no-undefined-types': 'error',
93
+ 'jsdoc/require-asterisk-prefix': ['error', 'always'],
94
+ 'jsdoc/require-description': ['error', {
95
+ exemptedBy: ['inheritdoc', 'package', 'private', 'see', 'deprecated']
96
+ }],
97
+ 'jsdoc/require-description-complete-sentence': 'warn',
98
+ 'jsdoc/require-example': 'off',
99
+ 'jsdoc/require-file-overview': 'off',
100
+ 'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
101
+ 'jsdoc/require-jsdoc': 'off',
102
+ 'jsdoc/require-param': 'off',
103
+ 'jsdoc/require-param-description': 'error',
104
+ 'jsdoc/require-param-name': 'error',
105
+ 'jsdoc/require-param-type': 'off',
106
+ 'jsdoc/require-property': 'error',
107
+ 'jsdoc/require-property-description': 'error',
108
+ 'jsdoc/require-property-name': 'error',
109
+ 'jsdoc/require-property-type': 'error',
110
+ 'jsdoc/require-returns': 'off',
111
+ 'jsdoc/require-returns-check': 'error',
112
+ 'jsdoc/require-returns-description': 'error',
113
+ 'jsdoc/require-returns-type': 'off',
114
+ 'jsdoc/require-template': ['off', {
115
+ requireSeparateTemplates: false
116
+ }],
117
+ 'jsdoc/require-throws': 'error',
118
+ 'jsdoc/require-yields': 'error',
119
+ 'jsdoc/require-yields-check': 'error',
120
+ 'jsdoc/sort-tags': ['warn', {
121
+ tagSequence: [{
122
+ tags: ['summary', 'typeSummary']
123
+ }, {
124
+ tags: ['module', 'exports', 'file', 'fileoverview', 'overview']
125
+ }, {
126
+ tags: ['typedef', 'interface', 'record', 'template', 'name', 'kind', 'type', 'alias', 'external', 'host', 'callback', 'func', 'function', 'method', 'class', 'constructor']
127
+ }, {
128
+ tags: ['modifies', 'mixes', 'mixin', 'mixinClass', 'mixinFunction', 'namespace', 'borrows', 'constructs', 'lends', 'implements', 'requires']
129
+ }, {
130
+ tags: ['desc', 'description', 'classdesc', 'tutorial', 'copyright', 'license']
131
+ }, {
132
+ tags: ['const', 'constant', 'final', 'global', 'readonly', 'abstract', 'virtual', 'var', 'member', 'memberof', 'memberof!', 'inner', 'instance', 'inheritdoc', 'inheritDoc', 'override', 'hideconstructor']
133
+ }, {
134
+ tags: ['param', 'arg', 'argument', 'prop', 'property']
135
+ }, {
136
+ tags: ['async', 'generator', 'default', 'defaultvalue', 'enum', 'augments', 'extends', 'return', 'returns', 'throws', 'exception', 'yield', 'yields', 'event', 'fires', 'emits', 'listens', 'this']
137
+ }, {
138
+ tags: ['static', 'private', 'protected', 'public', 'access', 'package']
139
+ }, {
140
+ tags: ['see', 'example']
141
+ }, {
142
+ tags: ['closurePrimitive', 'customElement', 'expose', 'hidden', 'idGenerator', 'meaning', 'ngInject', 'owner', 'wizaction']
143
+ }, {
144
+ tags: ['define', 'dict', 'export', 'externs', 'implicitCast', 'noalias', 'nocollapse', 'nocompile', 'noinline', 'nosideeffects', 'polymer', 'polymerBehavior', 'preserve', 'struct', 'suppress', 'unrestricted']
145
+ }, {
146
+ tags: ['category']
147
+ }, {
148
+ tags: ['ignore', 'author', 'version', 'variation', 'since', 'deprecated', 'todo']
149
+ }],
150
+ alphabetizeExtras: false,
151
+ linesBetween: 1,
152
+ reportTagGroupSpacing: true,
153
+ reportIntraTagGroupSpacing: true
154
+ }],
155
+ 'jsdoc/tag-lines': ['warn', 'always', {
156
+ count: 0,
157
+ startLines: 1,
158
+ endLines: 0,
159
+ applyToEndTag: false,
160
+ tags: {}
161
+ }],
162
+ 'jsdoc/valid-types': 'error'
163
+ }
164
+ };
165
+ }
166
+ export function jsdocJavascriptConfig() {
167
+ return {
168
+ files: javascriptFiles,
169
+ languageOptions: javascriptLanguageOptions(),
170
+ rules: {
171
+ 'jsdoc/no-types': 'off',
172
+ 'jsdoc/no-undefined-types': 'off',
173
+ 'jsdoc/require-param': 'error',
174
+ 'jsdoc/require-param-type': 'error',
175
+ 'jsdoc/require-returns': 'error',
176
+ 'jsdoc/require-returns-type': 'error'
177
+ }
178
+ };
179
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function nodeConfig(): Linter.Config;
@@ -0,0 +1,66 @@
1
+ import eslintPluginN from 'eslint-plugin-n';
2
+ export function nodeConfig() {
3
+ return {
4
+ plugins: {
5
+ n: eslintPluginN
6
+ },
7
+ rules: {
8
+ 'n/callback-return': ['error', ['callback', 'cb', 'next']],
9
+ 'n/exports-style': ['warn', 'module.exports', {
10
+ allowBatchAssign: false
11
+ }],
12
+ 'n/file-extension-in-import': 'off',
13
+ 'n/global-require': 'error',
14
+ 'n/handle-callback-err': 'error',
15
+ 'n/hashbang': 'warn',
16
+ 'n/no-callback-literal': 'error',
17
+ 'n/no-deprecated-api': 'error',
18
+ 'n/no-exports-assign': 'error',
19
+ 'n/no-extraneous-import': 'off',
20
+ 'n/no-extraneous-require': 'off',
21
+ 'n/no-hide-core-modules': 'off',
22
+ 'n/no-missing-import': 'off',
23
+ 'n/no-missing-require': 'off',
24
+ 'n/no-mixed-requires': 'error',
25
+ 'n/no-new-require': 'error',
26
+ 'n/no-path-concat': 'error',
27
+ 'n/no-process-env': 'error',
28
+ 'n/no-process-exit': 'off',
29
+ 'n/no-restricted-import': 'error',
30
+ 'n/no-restricted-require': 'error',
31
+ 'n/no-sync': ['error', {
32
+ allowAtRootLevel: false
33
+ }],
34
+ 'n/no-unpublished-bin': 'error',
35
+ 'n/no-unpublished-import': ['error', {
36
+ ignorePrivate: false
37
+ }],
38
+ 'n/no-unpublished-require': ['error', {
39
+ allowModules: [],
40
+ ignorePrivate: false,
41
+ tryExtensions: ['.js', '.json', '.node']
42
+ }],
43
+ 'n/no-unsupported-features/es-builtins': ['error', {
44
+ version: '>=18.0.0',
45
+ ignores: []
46
+ }],
47
+ 'n/no-unsupported-features/es-syntax': 'off',
48
+ 'n/no-unsupported-features/node-builtins': ['error', {
49
+ version: '>=18.0.0',
50
+ ignores: []
51
+ }],
52
+ 'n/prefer-global/buffer': ['error', 'always'],
53
+ 'n/prefer-global/console': ['error', 'always'],
54
+ 'n/prefer-global/process': ['error', 'always'],
55
+ 'n/prefer-global/text-decoder': ['error', 'always'],
56
+ 'n/prefer-global/text-encoder': ['error', 'always'],
57
+ 'n/prefer-global/url': ['error', 'always'],
58
+ 'n/prefer-global/url-search-params': ['error', 'always'],
59
+ 'n/prefer-node-protocol': 'off',
60
+ 'n/prefer-promises/dns': 'error',
61
+ 'n/prefer-promises/fs': 'error',
62
+ 'n/process-exit-as-throw': 'error',
63
+ 'n/shebang': 'off'
64
+ }
65
+ };
66
+ }
@@ -0,0 +1,6 @@
1
+ import { Linter } from 'eslint';
2
+ import { LinterConfig } from '../linter/linter-config';
3
+ /**
4
+ * Returns an array of flat configs.
5
+ */
6
+ export declare function perfectiveEslintConfig(configs?: LinterConfig[]): Linter.Config[];
@@ -0,0 +1,45 @@
1
+ import { configurationFiles, typescriptDeclarationFiles } from "../linter/glob.js";
2
+ import { languageOptions } from "../linter/language-options.js";
3
+ import { linterConfig } from "../linter/linter-config.js";
4
+ import { arrayFuncConfig } from "./array-func/array-func-config.js";
5
+ import { eslintConfig } from "./eslint/eslint-config.js";
6
+ import { eslintCommentsConfig } from "./eslint-comments/eslint-comments-config.js";
7
+ import { importConfig, importJavascriptConfig, importTypescriptConfig } from "./import/import-config.js";
8
+ import { importNoExtraneousDependencies } from "./import/index.js";
9
+ import { jsdocConfig, jsdocJavascriptConfig } from "./jsdoc/jsdoc-config.js";
10
+ import { nodeConfig } from "./node/node-config.js";
11
+ import { preferArrowConfig } from "./prefer-arrow/prefer-arrow-config.js";
12
+ import { promiseConfig } from "./promise/promise-config.js";
13
+ import { securityConfig } from "./security/security-config.js";
14
+ import { simpleImportSortConfig } from "./simple-import-sort/simple-import-sort-config.js";
15
+ import { stylisticJsConfig } from "./stylistic/js/stylistic-js-config.js";
16
+ import { stylisticJsxConfig } from "./stylistic/jsx/stylistic-jsx-config.js";
17
+ import { stylisticPlusConfig } from "./stylistic/plus/stylistic-plus-config.js";
18
+ import { stylisticTsConfig } from "./stylistic/ts/stylistic-ts-config.js";
19
+ import { typescriptEslintConfig } from "./typescript-eslint/typescript-eslint-config.js";
20
+ import { unicornConfig } from "./unicorn/unicorn-config.js";
21
+ export function perfectiveEslintConfig(configs = []) {
22
+ return [{
23
+ languageOptions: languageOptions()
24
+ }, {
25
+ ignores: ['**/dist', typescriptDeclarationFiles]
26
+ }, eslintConfig(), typescriptEslintConfig(), arrayFuncConfig(), eslintCommentsConfig(), importConfig(), importJavascriptConfig(), importTypescriptConfig(), jsdocConfig(), jsdocJavascriptConfig(), nodeConfig(), preferArrowConfig(), promiseConfig(), securityConfig(), simpleImportSortConfig(), stylisticJsConfig(), stylisticJsxConfig(), stylisticPlusConfig(), stylisticTsConfig(), unicornConfig(), configurationFilesConfig()].concat(configs.map(linterConfig));
27
+ }
28
+ function configurationFilesConfig() {
29
+ return {
30
+ files: configurationFiles,
31
+ rules: {
32
+ 'import/extensions': ['error', 'ignorePackages'],
33
+ 'import/no-default-export': ['off'],
34
+ 'import/no-extraneous-dependencies': ['error', importNoExtraneousDependencies({
35
+ devDependencies: configurationFiles
36
+ })],
37
+ 'n/no-unpublished-import': ['error', {
38
+ allowModules: ['gulp', '@perfective/build'],
39
+ convertPath: {
40
+ 'dist/**/*.js': ['^dist/(.+)?\\.js$', '$1.js']
41
+ }
42
+ }]
43
+ }
44
+ };
45
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function preferArrowConfig(): Linter.Config;
@@ -0,0 +1,16 @@
1
+ import eslintPluginPreferArrow from 'eslint-plugin-prefer-arrow';
2
+ export function preferArrowConfig() {
3
+ return {
4
+ plugins: {
5
+ 'prefer-arrow': eslintPluginPreferArrow
6
+ },
7
+ rules: {
8
+ 'prefer-arrow/prefer-arrow-functions': ['error', {
9
+ allowStandaloneDeclarations: true,
10
+ classPropertiesAllowed: false,
11
+ disallowPrototype: false,
12
+ singleReturnOnly: false
13
+ }]
14
+ }
15
+ };
16
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function promiseConfig(): Linter.Config;
@@ -0,0 +1,37 @@
1
+ import eslintPluginPromise from 'eslint-plugin-promise';
2
+ export function promiseConfig() {
3
+ return {
4
+ plugins: {
5
+ promise: eslintPluginPromise
6
+ },
7
+ rules: {
8
+ 'promise/catch-or-return': ['error', {
9
+ allowThen: false,
10
+ allowThenStrict: false,
11
+ allowFinally: true
12
+ }],
13
+ 'promise/no-return-wrap': 'error',
14
+ 'promise/param-names': 'warn',
15
+ 'promise/always-return': ['error', {
16
+ ignoreAssignmentVariable: ['globalThis']
17
+ }],
18
+ 'promise/no-multiple-resolved': 'error',
19
+ 'promise/no-native': 'off',
20
+ 'promise/no-nesting': 'error',
21
+ 'promise/no-promise-in-callback': 'error',
22
+ 'promise/no-callback-in-promise': ['error', {
23
+ timeoutsErr: false
24
+ }],
25
+ 'promise/avoid-new': 'off',
26
+ 'promise/no-new-statics': 'warn',
27
+ 'promise/no-return-in-finally': 'error',
28
+ 'promise/prefer-catch': 'warn',
29
+ 'promise/spec-only': ['error', {
30
+ allowedMethods: []
31
+ }],
32
+ 'promise/valid-params': 'error',
33
+ 'promise/prefer-await-to-then': 'off',
34
+ 'promise/prefer-await-to-callbacks': 'off'
35
+ }
36
+ };
37
+ }
@@ -0,0 +1 @@
1
+ export { rxjsConfig } from './rxjs-config';
@@ -0,0 +1 @@
1
+ export { rxjsConfig } from "./rxjs-config.js";
@@ -0,0 +1,8 @@
1
+ import { Linter } from 'eslint';
2
+ import { Glob } from '../../linter/glob';
3
+ /**
4
+ * Creates a flat config for `eslint-plugin-rxjs-x` for a given list of files globs.
5
+ *
6
+ * @since v0.31.0
7
+ */
8
+ export declare function rxjsConfig(files?: Glob[]): Linter.Config;
@@ -0,0 +1,67 @@
1
+ import eslintPluginRxjs from 'eslint-plugin-rxjs-x';
2
+ import { typescriptFiles } from "../../linter/glob.js";
3
+ import { typescriptLanguageOptions } from "../../linter/language-options.js";
4
+ export function rxjsConfig(files = typescriptFiles) {
5
+ return {
6
+ files,
7
+ languageOptions: typescriptLanguageOptions(),
8
+ plugins: {
9
+ 'rxjs-x': eslintPluginRxjs.configs.recommended.plugins['rxjs-x']
10
+ },
11
+ rules: {
12
+ 'rxjs-x/ban-observables': 'error',
13
+ 'rxjs-x/ban-operators': ['error', {
14
+ tap: false
15
+ }],
16
+ 'rxjs-x/finnish': ['error', {
17
+ functions: true,
18
+ methods: true,
19
+ names: {},
20
+ parameters: true,
21
+ properties: true,
22
+ strict: true,
23
+ types: {},
24
+ variables: true
25
+ }],
26
+ 'rxjs-x/just': 'off',
27
+ 'rxjs-x/no-async-subscribe': 'error',
28
+ 'rxjs-x/no-compat': 'error',
29
+ 'rxjs-x/no-connectable': 'error',
30
+ 'rxjs-x/no-create': 'error',
31
+ 'rxjs-x/no-cyclic-action': 'error',
32
+ 'rxjs-x/no-explicit-generics': 'off',
33
+ 'rxjs-x/no-exposed-subjects': 'error',
34
+ 'rxjs-x/no-finnish': 'off',
35
+ 'rxjs-x/no-floating-observables': 'error',
36
+ 'rxjs-x/no-ignored-error': 'error',
37
+ 'rxjs-x/no-ignored-notifier': 'error',
38
+ 'rxjs-x/no-ignored-observable': 'off',
39
+ 'rxjs-x/no-ignored-replay-buffer': 'error',
40
+ 'rxjs-x/no-ignored-subscribe': 'error',
41
+ 'rxjs-x/no-ignored-subscription': 'error',
42
+ 'rxjs-x/no-ignored-takewhile-value': 'error',
43
+ 'rxjs-x/no-implicit-any-catch': ['off', {
44
+ allowExplicitAny: false
45
+ }],
46
+ 'rxjs-x/no-index': 'error',
47
+ 'rxjs-x/no-internal': 'warn',
48
+ 'rxjs-x/no-nested-subscribe': 'error',
49
+ 'rxjs-x/no-redundant-notify': 'error',
50
+ 'rxjs-x/no-sharereplay': 'off',
51
+ 'rxjs-x/no-subclass': 'error',
52
+ 'rxjs-x/no-subject-unsubscribe': 'error',
53
+ 'rxjs-x/no-subject-value': 'error',
54
+ 'rxjs-x/no-subscribe-handlers': 'off',
55
+ 'rxjs-x/no-topromise': 'error',
56
+ 'rxjs-x/no-unbound-methods': 'error',
57
+ 'rxjs-x/no-unsafe-catch': 'error',
58
+ 'rxjs-x/no-unsafe-first': 'error',
59
+ 'rxjs-x/no-unsafe-subject-next': 'error',
60
+ 'rxjs-x/no-unsafe-switchmap': 'error',
61
+ 'rxjs-x/no-unsafe-takeuntil': 'error',
62
+ 'rxjs-x/prefer-observer': 'off',
63
+ 'rxjs-x/suffix-subjects': 'off',
64
+ 'rxjs-x/throw-error': 'error'
65
+ }
66
+ };
67
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function securityConfig(): Linter.Config;
@@ -0,0 +1,24 @@
1
+ import eslintPluginSecurity from 'eslint-plugin-security';
2
+ export function securityConfig() {
3
+ return {
4
+ plugins: {
5
+ security: eslintPluginSecurity
6
+ },
7
+ rules: {
8
+ 'security/detect-bidi-characters': 'error',
9
+ 'security/detect-buffer-noassert': 'error',
10
+ 'security/detect-child-process': 'error',
11
+ 'security/detect-disable-mustache-escape': 'error',
12
+ 'security/detect-eval-with-expression': 'error',
13
+ 'security/detect-new-buffer': 'error',
14
+ 'security/detect-no-csrf-before-method-override': 'error',
15
+ 'security/detect-non-literal-fs-filename': 'error',
16
+ 'security/detect-non-literal-regexp': 'error',
17
+ 'security/detect-non-literal-require': 'error',
18
+ 'security/detect-object-injection': 'error',
19
+ 'security/detect-possible-timing-attacks': 'error',
20
+ 'security/detect-pseudoRandomBytes': 'error',
21
+ 'security/detect-unsafe-regex': 'error'
22
+ }
23
+ };
24
+ }
@@ -0,0 +1 @@
1
+ export { SimpleImportSortImports, simpleImportSortImports, } from './rules/imports';
@@ -0,0 +1 @@
1
+ export { simpleImportSortImports } from "./rules/imports.js";
@@ -0,0 +1,28 @@
1
+ export type Match = string;
2
+ export type Group = Match[];
3
+ /**
4
+ * Configuration options for the `simple-import-sort/imports` rule.
5
+ *
6
+ * @since v0.11.0
7
+ */
8
+ export interface SimpleImportSortImports {
9
+ groups: Group[];
10
+ }
11
+ /**
12
+ * Creates configuration for the `simple-import-sort/imports` ESLint rule.
13
+ *
14
+ * Allows to splice `internal` scope packages imports between the global and relative imports.
15
+ *
16
+ * @param internal - A list of internal scopes. Each scope is sorted in its own group.
17
+ *
18
+ * @since v0.11.0
19
+ */
20
+ export declare function simpleImportSortImports(internal?: string[]): SimpleImportSortImports;
21
+ /**
22
+ * @private
23
+ */
24
+ export declare function scopedPackages(exclude: string[]): Group;
25
+ /**
26
+ * @private
27
+ */
28
+ export declare function internalPackages(internal: string[]): Group[];
@@ -0,0 +1,32 @@
1
+ export function simpleImportSortImports(internal = []) {
2
+ return {
3
+ groups: [sideEffects(), nodePrefixedModules(), unscopedPackages(), scopedPackages(internal), ...internalPackages(internal), parentImports(), relativeImports(), styleImports()].filter(group => group.length > 0)
4
+ };
5
+ }
6
+ function sideEffects() {
7
+ return ['^\\u0000'];
8
+ }
9
+ function nodePrefixedModules() {
10
+ return ['^node:'];
11
+ }
12
+ function unscopedPackages() {
13
+ return ['^[a-zA-Z]'];
14
+ }
15
+ export function scopedPackages(exclude) {
16
+ if (exclude.length === 0) {
17
+ return ['^@'];
18
+ }
19
+ return [`^(?!${exclude.join('|')})@`];
20
+ }
21
+ export function internalPackages(internal) {
22
+ return internal.map(scope => [`^${scope}`]);
23
+ }
24
+ function parentImports() {
25
+ return ['^\\.\\.(?!/?$)', '^\\.\\./?$'];
26
+ }
27
+ function relativeImports() {
28
+ return ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'];
29
+ }
30
+ function styleImports() {
31
+ return ['^.+\\.s?css$'];
32
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function simpleImportSortConfig(): Linter.Config;
@@ -0,0 +1,13 @@
1
+ import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
2
+ import { simpleImportSortImports } from "./rules/imports.js";
3
+ export function simpleImportSortConfig() {
4
+ return {
5
+ plugins: {
6
+ 'simple-import-sort': eslintPluginSimpleImportSort
7
+ },
8
+ rules: {
9
+ 'simple-import-sort/exports': 'warn',
10
+ 'simple-import-sort/imports': ['warn', simpleImportSortImports()]
11
+ }
12
+ };
13
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function stylisticJsConfig(): Linter.Config;