@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,200 @@
1
+ import eslintPluginStylisticJs from '@stylistic/eslint-plugin-js';
2
+ export function stylisticJsConfig() {
3
+ return {
4
+ plugins: {
5
+ '@stylistic/js': eslintPluginStylisticJs
6
+ },
7
+ rules: {
8
+ '@stylistic/js/array-bracket-newline': ['warn', 'consistent'],
9
+ '@stylistic/js/array-bracket-spacing': ['warn', 'never'],
10
+ '@stylistic/js/array-element-newline': ['warn', 'consistent'],
11
+ '@stylistic/js/arrow-parens': ['warn', 'as-needed'],
12
+ '@stylistic/js/arrow-spacing': ['warn', {
13
+ before: true,
14
+ after: true
15
+ }],
16
+ '@stylistic/js/block-spacing': ['warn', 'always'],
17
+ '@stylistic/js/brace-style': ['warn', 'stroustrup', {
18
+ allowSingleLine: false
19
+ }],
20
+ '@stylistic/js/comma-dangle': ['warn', {
21
+ arrays: 'always-multiline',
22
+ objects: 'always-multiline',
23
+ imports: 'always-multiline',
24
+ exports: 'always-multiline',
25
+ functions: 'always-multiline'
26
+ }],
27
+ '@stylistic/js/comma-spacing': ['warn', {
28
+ before: false,
29
+ after: true
30
+ }],
31
+ '@stylistic/js/comma-style': ['warn', 'last'],
32
+ '@stylistic/js/computed-property-spacing': ['warn', 'never'],
33
+ '@stylistic/js/dot-location': ['warn', 'property'],
34
+ '@stylistic/js/eol-last': ['warn', 'always'],
35
+ '@stylistic/js/func-call-spacing': 'off',
36
+ '@stylistic/js/function-call-argument-newline': ['warn', 'consistent'],
37
+ '@stylistic/js/function-call-spacing': ['warn', 'never'],
38
+ '@stylistic/js/function-paren-newline': ['warn', 'consistent'],
39
+ '@stylistic/js/generator-star-spacing': ['warn', {
40
+ before: true,
41
+ after: false
42
+ }],
43
+ '@stylistic/js/implicit-arrow-linebreak': ['warn', 'beside'],
44
+ '@stylistic/js/indent': ['warn', 4, {
45
+ SwitchCase: 1
46
+ }],
47
+ '@stylistic/js/jsx-quotes': ['warn', 'prefer-double'],
48
+ '@stylistic/js/key-spacing': ['warn', {
49
+ beforeColon: false,
50
+ afterColon: true,
51
+ mode: 'strict'
52
+ }],
53
+ '@stylistic/js/keyword-spacing': ['warn', {
54
+ before: true,
55
+ after: true
56
+ }],
57
+ '@stylistic/js/line-comment-position': ['error', {
58
+ position: 'above',
59
+ ignorePattern: '^ == .+'
60
+ }],
61
+ '@stylistic/js/linebreak-style': ['warn', 'unix'],
62
+ '@stylistic/js/lines-around-comment': ['warn', {
63
+ beforeBlockComment: true,
64
+ afterBlockComment: false,
65
+ beforeLineComment: false,
66
+ afterLineComment: false,
67
+ allowBlockStart: false,
68
+ allowBlockEnd: false,
69
+ allowObjectStart: false,
70
+ allowObjectEnd: false,
71
+ allowArrayStart: false,
72
+ allowArrayEnd: false,
73
+ allowClassStart: true,
74
+ allowClassEnd: false,
75
+ afterHashbangComment: true
76
+ }],
77
+ '@stylistic/js/lines-between-class-members': ['warn', 'always', {
78
+ exceptAfterSingleLine: true
79
+ }],
80
+ '@stylistic/js/max-len': ['error', {
81
+ code: 120,
82
+ tabWidth: 4,
83
+ ignoreRegExpLiterals: true,
84
+ ignoreUrls: true
85
+ }],
86
+ '@stylistic/js/max-statements-per-line': ['error', {
87
+ max: 1
88
+ }],
89
+ '@stylistic/js/multiline-comment-style': ['warn', 'separate-lines', {
90
+ checkJSDoc: false
91
+ }],
92
+ '@stylistic/js/multiline-ternary': ['warn', 'always-multiline'],
93
+ '@stylistic/js/new-parens': 'warn',
94
+ '@stylistic/js/newline-per-chained-call': ['off', {
95
+ ignoreChainWithDepth: 3
96
+ }],
97
+ '@stylistic/js/no-confusing-arrow': ['warn', {
98
+ allowParens: true,
99
+ onlyOneSimpleParam: false
100
+ }],
101
+ '@stylistic/js/no-extra-parens': ['warn', 'all', {
102
+ ignoreJSX: 'all',
103
+ nestedBinaryExpressions: false,
104
+ nestedConditionalExpressions: false,
105
+ enforceForArrowConditionals: false,
106
+ ternaryOperandBinaryExpressions: false
107
+ }],
108
+ '@stylistic/js/no-extra-semi': 'warn',
109
+ '@stylistic/js/no-floating-decimal': 'warn',
110
+ '@stylistic/js/no-mixed-operators': ['error', {
111
+ groups: [['+', '-'], ['*', '/', '%', '**'], ['&', '|', '^', '~', '<<', '>>', '>>>'], ['==', '!=', '===', '!==', '>', '>=', '<', '<='], ['&&', '||', '?:', '??'], ['in', 'instanceof']],
112
+ allowSamePrecedence: true
113
+ }],
114
+ '@stylistic/js/no-mixed-spaces-and-tabs': 'error',
115
+ '@stylistic/js/no-multi-spaces': 'warn',
116
+ '@stylistic/js/no-multiple-empty-lines': ['warn', {
117
+ max: 1,
118
+ maxEOF: 0,
119
+ maxBOF: 0
120
+ }],
121
+ '@stylistic/js/no-tabs': 'error',
122
+ '@stylistic/js/no-trailing-spaces': 'warn',
123
+ '@stylistic/js/no-whitespace-before-property': 'warn',
124
+ '@stylistic/js/nonblock-statement-body-position': ['warn', 'below'],
125
+ '@stylistic/js/object-curly-newline': ['warn', {
126
+ ImportDeclaration: {
127
+ multiline: true
128
+ },
129
+ ExportDeclaration: {
130
+ multiline: true
131
+ }
132
+ }],
133
+ '@stylistic/js/object-curly-spacing': ['warn', 'always', {
134
+ arraysInObjects: true,
135
+ objectsInObjects: true
136
+ }],
137
+ '@stylistic/js/object-property-newline': ['warn', {
138
+ allowAllPropertiesOnSameLine: true
139
+ }],
140
+ '@stylistic/js/one-var-declaration-per-line': ['warn', 'always'],
141
+ '@stylistic/js/operator-linebreak': ['warn', 'before', {
142
+ overrides: {
143
+ '=': 'none',
144
+ '==': 'none',
145
+ '!=': 'none',
146
+ '>=': 'none',
147
+ '<=': 'none',
148
+ '===': 'none',
149
+ '+=': 'none'
150
+ }
151
+ }],
152
+ '@stylistic/js/padded-blocks': ['warn', 'never'],
153
+ '@stylistic/js/padding-line-between-statements': 'off',
154
+ '@stylistic/js/quote-props': ['warn', 'consistent-as-needed'],
155
+ '@stylistic/js/quotes': ['warn', 'single', {
156
+ avoidEscape: true,
157
+ allowTemplateLiterals: true,
158
+ ignoreStringLiterals: false
159
+ }],
160
+ '@stylistic/js/rest-spread-spacing': ['warn', 'never'],
161
+ '@stylistic/js/semi': ['warn', 'always'],
162
+ '@stylistic/js/semi-spacing': ['warn', {
163
+ before: false,
164
+ after: true
165
+ }],
166
+ '@stylistic/js/semi-style': ['warn', 'last'],
167
+ '@stylistic/js/space-before-blocks': ['warn', 'always'],
168
+ '@stylistic/js/space-before-function-paren': ['warn', {
169
+ anonymous: 'always',
170
+ named: 'never',
171
+ asyncArrow: 'always'
172
+ }],
173
+ '@stylistic/js/space-in-parens': ['warn', 'never'],
174
+ '@stylistic/js/space-infix-ops': ['warn', {
175
+ int32Hint: false
176
+ }],
177
+ '@stylistic/js/space-unary-ops': ['warn', {
178
+ words: true,
179
+ nonwords: false
180
+ }],
181
+ '@stylistic/js/spaced-comment': ['warn', 'always', {
182
+ line: {
183
+ markers: ['/ <reference']
184
+ }
185
+ }],
186
+ '@stylistic/js/switch-colon-spacing': ['warn', {
187
+ after: true,
188
+ before: false
189
+ }],
190
+ '@stylistic/js/template-curly-spacing': ['warn', 'never'],
191
+ '@stylistic/js/template-tag-spacing': ['warn', 'never'],
192
+ '@stylistic/js/wrap-iife': ['warn', 'outside'],
193
+ '@stylistic/js/wrap-regex': 'warn',
194
+ '@stylistic/js/yield-star-spacing': ['warn', {
195
+ before: true,
196
+ after: false
197
+ }]
198
+ }
199
+ };
200
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function stylisticJsxConfig(): Linter.Config;
@@ -0,0 +1,87 @@
1
+ import eslintPluginStylisticJsx from '@stylistic/eslint-plugin-jsx';
2
+ import { jsxFiles, tsxFiles } from "../../../linter/glob.js";
3
+ import { languageOptions } from "../../../linter/language-options.js";
4
+ export function stylisticJsxConfig() {
5
+ return {
6
+ files: [jsxFiles, tsxFiles],
7
+ languageOptions: languageOptions(),
8
+ plugins: {
9
+ '@stylistic/jsx': eslintPluginStylisticJsx
10
+ },
11
+ rules: {
12
+ '@stylistic/jsx/jsx-child-element-spacing': 'error',
13
+ '@stylistic/jsx/jsx-closing-bracket-location': ['warn', {
14
+ selfClosing: 'after-props',
15
+ nonEmpty: 'after-props'
16
+ }],
17
+ '@stylistic/jsx/jsx-closing-tag-location': ['warn', 'tag-aligned'],
18
+ '@stylistic/jsx/jsx-curly-brace-presence': ['warn', {
19
+ props: 'never',
20
+ children: 'always',
21
+ propElementValues: 'always'
22
+ }],
23
+ '@stylistic/jsx/jsx-curly-newline': ['warn', 'never'],
24
+ '@stylistic/jsx/jsx-curly-spacing': ['warn', {
25
+ when: 'never',
26
+ attributes: {
27
+ allowMultiline: false
28
+ },
29
+ children: {
30
+ allowMultiline: false
31
+ }
32
+ }],
33
+ '@stylistic/jsx/jsx-equals-spacing': ['warn', 'never'],
34
+ '@stylistic/jsx/jsx-first-prop-new-line': ['warn', 'multiline-multiprop'],
35
+ '@stylistic/jsx/jsx-function-call-newline': ['warn', 'multiline'],
36
+ '@stylistic/jsx/jsx-indent': 'off',
37
+ '@stylistic/jsx/jsx-indent-props': ['warn', {
38
+ indentMode: 1,
39
+ ignoreTernaryOperator: false
40
+ }],
41
+ '@stylistic/jsx/jsx-max-props-per-line': ['warn', {
42
+ maximum: 1,
43
+ when: 'always'
44
+ }],
45
+ '@stylistic/jsx/jsx-newline': 'off',
46
+ '@stylistic/jsx/jsx-one-expression-per-line': ['warn', {
47
+ allow: 'single-child'
48
+ }],
49
+ '@stylistic/jsx/jsx-pascal-case': ['error', {
50
+ allowAllCaps: false,
51
+ allowLeadingUnderscore: false,
52
+ allowNamespace: false,
53
+ ignore: []
54
+ }],
55
+ '@stylistic/jsx/jsx-props-no-multi-spaces': 'warn',
56
+ '@stylistic/jsx/jsx-self-closing-comp': ['warn', {
57
+ component: true,
58
+ html: true
59
+ }],
60
+ '@stylistic/jsx/jsx-sort-props': ['warn', {
61
+ ignoreCase: false,
62
+ callbacksLast: true,
63
+ shorthandFirst: true,
64
+ shorthandLast: false,
65
+ multiline: 'ignore',
66
+ noSortAlphabetically: false,
67
+ reservedFirst: true,
68
+ locale: 'auto'
69
+ }],
70
+ '@stylistic/jsx/jsx-tag-spacing': ['warn', {
71
+ closingSlash: 'never',
72
+ beforeSelfClosing: 'always',
73
+ afterOpening: 'never',
74
+ beforeClosing: 'never'
75
+ }],
76
+ '@stylistic/jsx/jsx-wrap-multilines': ['warn', {
77
+ declaration: 'parens-new-line',
78
+ assignment: 'parens-new-line',
79
+ return: 'parens-new-line',
80
+ arrow: 'parens-new-line',
81
+ condition: 'parens-new-line',
82
+ logical: 'parens-new-line',
83
+ prop: 'parens-new-line'
84
+ }]
85
+ }
86
+ };
87
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function stylisticPlusConfig(): Linter.Config;
@@ -0,0 +1,16 @@
1
+ import eslintPluginStylisticPlus from '@stylistic/eslint-plugin-plus';
2
+ export function stylisticPlusConfig() {
3
+ return {
4
+ plugins: {
5
+ '@stylistic/plus': eslintPluginStylisticPlus
6
+ },
7
+ rules: {
8
+ '@stylistic/plus/curly-newline': ['warn', {
9
+ minElements: 1
10
+ }],
11
+ '@stylistic/plus/indent-binary-ops': ['warn', 4],
12
+ '@stylistic/plus/type-generic-spacing': 'warn',
13
+ '@stylistic/plus/type-named-tuple-spacing': 'warn'
14
+ }
15
+ };
16
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare function stylisticTsConfig(): Linter.Config;
@@ -0,0 +1,141 @@
1
+ import eslintPluginStylisticTs from '@stylistic/eslint-plugin-ts';
2
+ import { typescriptFiles } from "../../../linter/glob.js";
3
+ import { typescriptLanguageOptions } from "../../../linter/language-options.js";
4
+ export function stylisticTsConfig() {
5
+ return {
6
+ files: typescriptFiles,
7
+ languageOptions: typescriptLanguageOptions(),
8
+ plugins: {
9
+ '@stylistic/ts': eslintPluginStylisticTs
10
+ },
11
+ rules: {
12
+ '@stylistic/js/block-spacing': 'off',
13
+ '@stylistic/ts/block-spacing': ['warn', 'always'],
14
+ '@stylistic/js/brace-style': 'off',
15
+ '@stylistic/ts/brace-style': ['warn', 'stroustrup', {
16
+ allowSingleLine: false
17
+ }],
18
+ '@stylistic/js/comma-dangle': 'off',
19
+ '@stylistic/ts/comma-dangle': ['warn', {
20
+ arrays: 'always-multiline',
21
+ enums: 'always-multiline',
22
+ exports: 'always-multiline',
23
+ functions: 'always-multiline',
24
+ generics: 'always-multiline',
25
+ imports: 'always-multiline',
26
+ objects: 'always-multiline',
27
+ tuples: 'always-multiline'
28
+ }],
29
+ '@stylistic/js/comma-spacing': 'off',
30
+ '@stylistic/ts/comma-spacing': ['warn', {
31
+ before: false,
32
+ after: true
33
+ }],
34
+ '@stylistic/js/func-call-spacing': 'off',
35
+ '@stylistic/ts/func-call-spacing': 'off',
36
+ '@stylistic/js/function-call-spacing': 'off',
37
+ '@stylistic/ts/function-call-spacing': ['warn', 'never'],
38
+ '@stylistic/js/indent': 'off',
39
+ '@stylistic/ts/indent': ['warn', 4, {
40
+ SwitchCase: 1,
41
+ ignoredNodes: ['TSTypeParameterInstantiation']
42
+ }],
43
+ '@stylistic/js/key-spacing': 'off',
44
+ '@stylistic/ts/key-spacing': ['warn', {
45
+ beforeColon: false,
46
+ afterColon: true,
47
+ mode: 'strict'
48
+ }],
49
+ '@stylistic/js/keyword-spacing': 'off',
50
+ '@stylistic/ts/keyword-spacing': ['warn', {
51
+ before: true,
52
+ after: true
53
+ }],
54
+ '@stylistic/js/lines-around-comment': 'off',
55
+ '@stylistic/ts/lines-around-comment': ['warn', {
56
+ beforeBlockComment: true,
57
+ afterBlockComment: false,
58
+ beforeLineComment: false,
59
+ afterLineComment: false,
60
+ allowBlockStart: false,
61
+ allowBlockEnd: false,
62
+ allowObjectStart: false,
63
+ allowObjectEnd: false,
64
+ allowArrayStart: false,
65
+ allowArrayEnd: false,
66
+ allowClassStart: true,
67
+ allowClassEnd: false,
68
+ allowInterfaceStart: true,
69
+ allowInterfaceEnd: true,
70
+ allowTypeStart: true,
71
+ allowTypeEnd: true
72
+ }],
73
+ '@stylistic/js/lines-between-class-members': 'off',
74
+ '@stylistic/ts/lines-between-class-members': ['warn', 'always', {
75
+ exceptAfterSingleLine: true,
76
+ exceptAfterOverload: true
77
+ }],
78
+ '@stylistic/ts/member-delimiter-style': ['warn', {
79
+ multiline: {
80
+ delimiter: 'semi',
81
+ requireLast: true
82
+ },
83
+ singleline: {
84
+ delimiter: 'semi',
85
+ requireLast: true
86
+ },
87
+ multilineDetection: 'brackets'
88
+ }],
89
+ '@stylistic/js/no-extra-parens': 'off',
90
+ '@stylistic/ts/no-extra-parens': ['warn', 'all', {
91
+ ignoreJSX: 'all',
92
+ nestedBinaryExpressions: false,
93
+ enforceForArrowConditionals: false
94
+ }],
95
+ '@stylistic/js/no-extra-semi': 'off',
96
+ '@stylistic/ts/no-extra-semi': 'warn',
97
+ '@stylistic/js/object-curly-newline': 'off',
98
+ '@stylistic/ts/object-curly-newline': ['warn', {
99
+ ImportDeclaration: {
100
+ multiline: true
101
+ },
102
+ ExportDeclaration: {
103
+ multiline: true
104
+ }
105
+ }],
106
+ '@stylistic/js/object-curly-spacing': 'off',
107
+ '@stylistic/ts/object-curly-spacing': ['warn', 'always', {
108
+ arraysInObjects: true,
109
+ objectsInObjects: true
110
+ }],
111
+ '@stylistic/js/object-property-newline': 'off',
112
+ '@stylistic/ts/object-property-newline': ['warn', {
113
+ allowAllPropertiesOnSameLine: true
114
+ }],
115
+ '@stylistic/js/padding-line-between-statements': 'off',
116
+ '@stylistic/ts/padding-line-between-statements': 'off',
117
+ '@stylistic/js/quote-props': 'off',
118
+ '@stylistic/ts/quote-props': ['warn', 'consistent-as-needed'],
119
+ '@stylistic/js/quotes': 'off',
120
+ '@stylistic/ts/quotes': ['warn', 'single', {
121
+ avoidEscape: true,
122
+ allowTemplateLiterals: true
123
+ }],
124
+ '@stylistic/js/semi': 'off',
125
+ '@stylistic/ts/semi': ['warn', 'always'],
126
+ '@stylistic/js/space-before-blocks': 'off',
127
+ '@stylistic/ts/space-before-blocks': ['warn', 'always'],
128
+ '@stylistic/js/space-before-function-paren': 'off',
129
+ '@stylistic/ts/space-before-function-paren': ['warn', {
130
+ anonymous: 'always',
131
+ named: 'never',
132
+ asyncArrow: 'always'
133
+ }],
134
+ '@stylistic/js/space-infix-ops': 'off',
135
+ '@stylistic/ts/space-infix-ops': ['warn', {
136
+ int32Hint: false
137
+ }],
138
+ '@stylistic/ts/type-annotation-spacing': 'warn'
139
+ }
140
+ };
141
+ }
@@ -0,0 +1 @@
1
+ export { testingLibraryConfig } from './testing-library-config';
@@ -0,0 +1 @@
1
+ export { testingLibraryConfig } from "./testing-library-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-testing-library` for a given list of files globs.
5
+ *
6
+ * @since v0.31.0
7
+ */
8
+ export declare function testingLibraryConfig(files?: Glob[]): Linter.Config;
@@ -0,0 +1,45 @@
1
+ import eslintPluginTestingLibrary from 'eslint-plugin-testing-library';
2
+ import { jestFiles } from "../../linter/glob.js";
3
+ export function testingLibraryConfig(files = jestFiles) {
4
+ return {
5
+ files,
6
+ plugins: {
7
+ 'testing-library': eslintPluginTestingLibrary
8
+ },
9
+ rules: {
10
+ 'testing-library/await-async-events': 'off',
11
+ 'testing-library/await-async-queries': 'error',
12
+ 'testing-library/await-async-utils': 'error',
13
+ 'testing-library/consistent-data-testid': ['error', {
14
+ testIdPattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
15
+ testIdAttribute: 'data-testId'
16
+ }],
17
+ 'testing-library/no-await-sync-events': 'error',
18
+ 'testing-library/no-await-sync-queries': 'error',
19
+ 'testing-library/no-container': 'error',
20
+ 'testing-library/no-debugging-utils': 'error',
21
+ 'testing-library/no-dom-import': 'warn',
22
+ 'testing-library/no-global-regexp-flag-in-query': 'warn',
23
+ 'testing-library/no-manual-cleanup': 'error',
24
+ 'testing-library/no-node-access': 'error',
25
+ 'testing-library/no-promise-in-fire-event': 'error',
26
+ 'testing-library/no-render-in-lifecycle': 'error',
27
+ 'testing-library/no-unnecessary-act': 'off',
28
+ 'testing-library/no-wait-for-multiple-assertions': 'error',
29
+ 'testing-library/no-wait-for-side-effects': 'error',
30
+ 'testing-library/no-wait-for-snapshot': 'error',
31
+ 'testing-library/prefer-explicit-assert': 'off',
32
+ 'testing-library/prefer-find-by': 'warn',
33
+ 'testing-library/prefer-implicit-assert': 'error',
34
+ 'testing-library/prefer-presence-queries': ['error', {
35
+ presence: true,
36
+ absence: true
37
+ }],
38
+ 'testing-library/prefer-query-by-disappearance': 'error',
39
+ 'testing-library/prefer-query-matchers': 'off',
40
+ 'testing-library/prefer-screen-queries': 'error',
41
+ 'testing-library/prefer-user-event': 'error',
42
+ 'testing-library/render-result-naming-convention': 'error'
43
+ }
44
+ };
45
+ }
@@ -0,0 +1,2 @@
1
+ import { Linter } from 'eslint';
2
+ export declare const extensionRules: Linter.RulesRecord;
@@ -0,0 +1,113 @@
1
+ export const extensionRules = {
2
+ 'block-spacing': 'off',
3
+ '@typescript-eslint/block-spacing': 'off',
4
+ 'brace-style': 'off',
5
+ '@typescript-eslint/brace-style': 'off',
6
+ 'class-methods-use-this': 'off',
7
+ '@typescript-eslint/class-methods-use-this': 'off',
8
+ 'comma-dangle': 'off',
9
+ '@typescript-eslint/comma-dangle': 'off',
10
+ 'comma-spacing': 'off',
11
+ '@typescript-eslint/comma-spacing': 'off',
12
+ 'consistent-return': 'off',
13
+ '@typescript-eslint/consistent-return': 'error',
14
+ 'default-param-last': 'off',
15
+ '@typescript-eslint/default-param-last': 'error',
16
+ 'dot-notation': 'off',
17
+ '@typescript-eslint/dot-notation': ['warn', {
18
+ allowKeywords: true,
19
+ allowPrivateClassPropertyAccess: false,
20
+ allowProtectedClassPropertyAccess: false
21
+ }],
22
+ 'func-call-spacing': 'off',
23
+ '@typescript-eslint/func-call-spacing': 'off',
24
+ 'indent': 'off',
25
+ '@typescript-eslint/indent': 'off',
26
+ 'init-declarations': 'off',
27
+ '@typescript-eslint/init-declarations': ['error', 'always'],
28
+ 'key-spacing': 'off',
29
+ '@typescript-eslint/key-spacing': 'off',
30
+ 'keyword-spacing': 'off',
31
+ '@typescript-eslint/keyword-spacing': 'off',
32
+ 'lines-around-comment': 'off',
33
+ '@typescript-eslint/lines-around-comment': 'off',
34
+ 'lines-between-class-members': 'off',
35
+ '@typescript-eslint/lines-between-class-members': 'off',
36
+ 'no-array-constructor': 'off',
37
+ '@typescript-eslint/no-array-constructor': 'warn',
38
+ 'no-dupe-class-members': 'off',
39
+ '@typescript-eslint/no-dupe-class-members': 'error',
40
+ 'no-empty-function': 'off',
41
+ '@typescript-eslint/no-empty-function': ['error', {
42
+ allow: ['protected-constructors', 'private-constructors']
43
+ }],
44
+ 'no-extra-parens': 'off',
45
+ '@typescript-eslint/no-extra-parens': 'off',
46
+ 'no-extra-semi': 'off',
47
+ '@typescript-eslint/no-extra-semi': 'off',
48
+ 'no-implied-eval': 'off',
49
+ '@typescript-eslint/no-implied-eval': 'error',
50
+ 'no-invalid-this': 'off',
51
+ '@typescript-eslint/no-invalid-this': 'error',
52
+ 'no-loop-func': 'off',
53
+ '@typescript-eslint/no-loop-func': 'error',
54
+ '@typescript-eslint/no-loss-of-precision': 'off',
55
+ 'no-magic-numbers': 'off',
56
+ '@typescript-eslint/no-magic-numbers': 'off',
57
+ 'no-redeclare': 'off',
58
+ '@typescript-eslint/no-redeclare': 'error',
59
+ 'no-restricted-imports': 'off',
60
+ '@typescript-eslint/no-restricted-imports': ['error', {}],
61
+ 'no-shadow': 'off',
62
+ '@typescript-eslint/no-shadow': 'off',
63
+ 'no-throw-literal': 'off',
64
+ '@typescript-eslint/only-throw-error': ['error', {
65
+ allowThrowingAny: false,
66
+ allowThrowingUnknown: false
67
+ }],
68
+ 'no-unused-expressions': 'off',
69
+ '@typescript-eslint/no-unused-expressions': 'error',
70
+ 'no-unused-vars': 'off',
71
+ '@typescript-eslint/no-unused-vars': ['error', {
72
+ args: 'after-used',
73
+ argsIgnorePattern: '^_',
74
+ caughtErrors: 'all',
75
+ destructuredArrayIgnorePattern: '^_',
76
+ ignoreRestSiblings: false,
77
+ vars: 'all'
78
+ }],
79
+ 'no-use-before-define': 'off',
80
+ '@typescript-eslint/no-use-before-define': ['error', {
81
+ functions: false,
82
+ classes: false,
83
+ variables: false,
84
+ allowNamedExports: false,
85
+ enums: false,
86
+ typedefs: false,
87
+ ignoreTypeReferences: false
88
+ }],
89
+ 'no-useless-constructor': 'off',
90
+ '@typescript-eslint/no-useless-constructor': 'error',
91
+ 'object-curly-spacing': 'off',
92
+ '@typescript-eslint/object-curly-spacing': 'off',
93
+ 'padding-line-between-statements': 'off',
94
+ '@typescript-eslint/padding-line-between-statements': 'off',
95
+ 'prefer-destructuring': 'off',
96
+ '@typescript-eslint/prefer-destructuring': 'off',
97
+ 'prefer-promise-reject-errors': 'off',
98
+ '@typescript-eslint/prefer-promise-reject-errors': 'error',
99
+ 'quotes': 'off',
100
+ '@typescript-eslint/quotes': 'off',
101
+ 'require-await': 'off',
102
+ '@typescript-eslint/require-await': 'error',
103
+ 'no-return-await': 'off',
104
+ '@typescript-eslint/return-await': ['warn', 'error-handling-correctness-only'],
105
+ 'semi': 'off',
106
+ '@typescript-eslint/semi': 'off',
107
+ 'space-before-blocks': 'off',
108
+ '@typescript-eslint/space-before-blocks': 'off',
109
+ 'space-before-function-paren': 'off',
110
+ '@typescript-eslint/space-before-function-paren': 'off',
111
+ 'space-infix-ops': 'off',
112
+ '@typescript-eslint/space-infix-ops': 'off'
113
+ };
@@ -0,0 +1 @@
1
+ export { TypescriptEslintNamingConvention, typescriptEslintNamingConvention, TypescriptEslintNamingConventionFormat, TypescriptEslintNamingConventionGroupSelector, TypescriptEslintNamingConventionIndividualSelector, TypescriptEslintNamingConventionSelector, TypescriptEslintNamingConventionUnderscore, } from './rules/typescript-eslint-naming-convention';
@@ -0,0 +1 @@
1
+ export { typescriptEslintNamingConvention } from "./rules/typescript-eslint-naming-convention.js";