@perfective/eslint-config 0.30.0 → 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 (179) hide show
  1. package/README.adoc +185 -60
  2. package/README.md +53 -40
  3. package/config/array-func/array-func-config.d.ts +2 -0
  4. package/config/array-func/array-func-config.js +16 -0
  5. package/config/cypress/cypress-config.d.ts +10 -0
  6. package/config/cypress/cypress-config.js +38 -0
  7. package/config/cypress/index.d.ts +1 -0
  8. package/config/cypress/index.js +1 -0
  9. package/config/eslint/eslint-config.d.ts +2 -0
  10. package/config/eslint/eslint-config.js +8 -0
  11. package/config/eslint/layout-formatting-rules.d.ts +2 -0
  12. package/config/eslint/possible-problems-rules.d.ts +2 -0
  13. package/config/eslint/suggestions-rules.d.ts +2 -0
  14. package/config/eslint-comments/best-practices-rules.d.ts +2 -0
  15. package/config/eslint-comments/eslint-comments-config.d.ts +2 -0
  16. package/config/eslint-comments/eslint-comments-config.js +11 -0
  17. package/config/eslint-comments/stylistic-issues-rules.d.ts +2 -0
  18. package/config/import/helpful-warnings-rules.d.ts +2 -0
  19. package/config/import/import-config.d.ts +4 -0
  20. package/config/import/import-config.js +46 -0
  21. package/config/import/index.d.ts +1 -0
  22. package/config/import/index.js +1 -0
  23. package/config/import/module-systems-rules.d.ts +2 -0
  24. package/config/import/rules/no-extraneous-dependencies.d.ts +15 -0
  25. package/config/import/rules/no-extraneous-dependencies.js +8 -0
  26. package/config/import/static-analysis-rules.d.ts +2 -0
  27. package/config/import/style-guide-rules.d.ts +2 -0
  28. package/config/jest/index.d.ts +1 -0
  29. package/config/jest/index.js +1 -0
  30. package/config/jest/jest-config.d.ts +8 -0
  31. package/config/jest/jest-config.js +128 -0
  32. package/config/jest/typescript-eslint-jest-rules.d.ts +2 -0
  33. package/config/jest-dom/index.d.ts +1 -0
  34. package/config/jest-dom/index.js +1 -0
  35. package/config/jest-dom/jest-dom-config.d.ts +8 -0
  36. package/config/jest-dom/jest-dom-config.js +23 -0
  37. package/config/jsdoc/jsdoc-config.d.ts +3 -0
  38. package/config/jsdoc/jsdoc-config.js +179 -0
  39. package/config/node/node-config.d.ts +2 -0
  40. package/config/node/node-config.js +66 -0
  41. package/config/perfective-eslint-config.d.ts +6 -0
  42. package/config/perfective-eslint-config.js +45 -0
  43. package/config/prefer-arrow/prefer-arrow-config.d.ts +2 -0
  44. package/config/prefer-arrow/prefer-arrow-config.js +16 -0
  45. package/config/promise/promise-config.d.ts +2 -0
  46. package/config/promise/promise-config.js +37 -0
  47. package/config/rxjs/index.d.ts +1 -0
  48. package/config/rxjs/index.js +1 -0
  49. package/config/rxjs/rxjs-config.d.ts +8 -0
  50. package/config/rxjs/rxjs-config.js +67 -0
  51. package/config/security/security-config.d.ts +2 -0
  52. package/config/security/security-config.js +24 -0
  53. package/config/simple-import-sort/index.d.ts +1 -0
  54. package/config/simple-import-sort/index.js +1 -0
  55. package/{rules → config}/simple-import-sort/rules/imports.d.ts +11 -2
  56. package/config/simple-import-sort/simple-import-sort-config.d.ts +2 -0
  57. package/config/simple-import-sort/simple-import-sort-config.js +13 -0
  58. package/config/stylistic/js/stylistic-js-config.d.ts +2 -0
  59. package/config/stylistic/js/stylistic-js-config.js +200 -0
  60. package/config/stylistic/jsx/stylistic-jsx-config.d.ts +2 -0
  61. package/config/stylistic/jsx/stylistic-jsx-config.js +87 -0
  62. package/config/stylistic/plus/stylistic-plus-config.d.ts +2 -0
  63. package/config/stylistic/plus/stylistic-plus-config.js +16 -0
  64. package/config/stylistic/ts/stylistic-ts-config.d.ts +2 -0
  65. package/config/stylistic/ts/stylistic-ts-config.js +141 -0
  66. package/config/testing-library/index.d.ts +1 -0
  67. package/config/testing-library/index.js +1 -0
  68. package/config/testing-library/testing-library-config.d.ts +8 -0
  69. package/config/testing-library/testing-library-config.js +45 -0
  70. package/config/typescript-eslint/extension-rules.d.ts +2 -0
  71. package/config/typescript-eslint/index.d.ts +1 -0
  72. package/config/typescript-eslint/index.js +1 -0
  73. package/{rules → config}/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +35 -1
  74. package/config/typescript-eslint/supported-rules.d.ts +2 -0
  75. package/{rules → config}/typescript-eslint/supported-rules.js +6 -2
  76. package/config/typescript-eslint/typescript-eslint-config.d.ts +2 -0
  77. package/config/typescript-eslint/typescript-eslint-config.js +15 -0
  78. package/config/unicorn/index.d.ts +1 -0
  79. package/config/unicorn/index.js +1 -0
  80. package/{rules → config}/unicorn/rules/prevent-abbreviations.d.ts +14 -2
  81. package/config/unicorn/unicorn-config.d.ts +2 -0
  82. package/config/unicorn/unicorn-config.js +185 -0
  83. package/index.d.ts +5 -1766
  84. package/index.js +5 -102
  85. package/linter/glob.d.ts +59 -0
  86. package/linter/glob.js +8 -0
  87. package/linter/language-options.d.ts +25 -0
  88. package/linter/language-options.js +45 -0
  89. package/linter/linter-config.d.ts +13 -0
  90. package/linter/linter-config.js +6 -0
  91. package/{config → linter}/node.d.ts +3 -1
  92. package/{config → linter}/plugin.d.ts +6 -2
  93. package/package.json +37 -38
  94. package/config.d.ts +0 -1
  95. package/config.js +0 -1
  96. package/cypress.d.ts +0 -6
  97. package/cypress.js +0 -31
  98. package/jest-dom.d.ts +0 -1
  99. package/jest-dom.js +0 -8
  100. package/jest.d.ts +0 -7
  101. package/jest.js +0 -29
  102. package/rules/array-func/index.d.ts +0 -13
  103. package/rules/array-func/index.js +0 -14
  104. package/rules/cypress/index.d.ts +0 -29
  105. package/rules/cypress/index.js +0 -23
  106. package/rules/eslint/index.d.ts +0 -339
  107. package/rules/eslint/index.js +0 -6
  108. package/rules/eslint/layout-formatting.d.ts +0 -64
  109. package/rules/eslint/possible-problems.d.ts +0 -96
  110. package/rules/eslint/suggestions.d.ts +0 -181
  111. package/rules/eslint-comments/best-practices.d.ts +0 -8
  112. package/rules/eslint-comments/index.d.ts +0 -20
  113. package/rules/eslint-comments/index.js +0 -9
  114. package/rules/eslint-comments/stylistic-issues.d.ts +0 -9
  115. package/rules/import/helpful-warnings.d.ts +0 -10
  116. package/rules/import/index.d.ts +0 -78
  117. package/rules/import/index.js +0 -11
  118. package/rules/import/module-systems.d.ts +0 -10
  119. package/rules/import/rules/no-extraneous-dependencies.d.ts +0 -14
  120. package/rules/import/rules/no-extraneous-dependencies.js +0 -23
  121. package/rules/import/static-analysis.d.ts +0 -26
  122. package/rules/import/style-guide.d.ts +0 -33
  123. package/rules/jest/index.d.ts +0 -124
  124. package/rules/jest/index.js +0 -98
  125. package/rules/jest/typescript-eslint.d.ts +0 -5
  126. package/rules/jest-dom/index.d.ts +0 -32
  127. package/rules/jest-dom/index.js +0 -19
  128. package/rules/jsdoc/index.d.ts +0 -134
  129. package/rules/jsdoc/index.js +0 -161
  130. package/rules/n/index.d.ts +0 -66
  131. package/rules/n/index.js +0 -64
  132. package/rules/prefer-arrow/index.d.ts +0 -13
  133. package/rules/prefer-arrow/index.js +0 -14
  134. package/rules/promise/index.d.ts +0 -34
  135. package/rules/promise/index.js +0 -35
  136. package/rules/rxjs/index.d.ts +0 -60
  137. package/rules/rxjs/index.js +0 -60
  138. package/rules/security/index.d.ts +0 -21
  139. package/rules/security/index.js +0 -22
  140. package/rules/simple-import-sort/index.d.ts +0 -10
  141. package/rules/simple-import-sort/index.js +0 -12
  142. package/rules/stylistic/js/index.d.ts +0 -204
  143. package/rules/stylistic/js/index.js +0 -198
  144. package/rules/stylistic/jsx/index.d.ts +0 -87
  145. package/rules/stylistic/jsx/index.js +0 -81
  146. package/rules/stylistic/plus/index.d.ts +0 -18
  147. package/rules/stylistic/plus/index.js +0 -14
  148. package/rules/stylistic/ts/index.d.ts +0 -141
  149. package/rules/stylistic/ts/index.js +0 -135
  150. package/rules/testing-library/index.d.ts +0 -62
  151. package/rules/testing-library/index.js +0 -41
  152. package/rules/typescript-eslint/extension-rules.d.ts +0 -113
  153. package/rules/typescript-eslint/index.d.ts +0 -371
  154. package/rules/typescript-eslint/index.js +0 -9
  155. package/rules/typescript-eslint/supported-rules.d.ts +0 -255
  156. package/rules/unicorn/index.d.ts +0 -183
  157. package/rules/unicorn/index.js +0 -178
  158. package/rules.d.ts +0 -4
  159. package/rules.js +0 -4
  160. package/rxjs.d.ts +0 -6
  161. package/rxjs.js +0 -22
  162. package/testing-library.d.ts +0 -1
  163. package/testing-library.js +0 -8
  164. /package/{rules/eslint/layout-formatting.js → config/eslint/layout-formatting-rules.js} +0 -0
  165. /package/{rules/eslint/possible-problems.js → config/eslint/possible-problems-rules.js} +0 -0
  166. /package/{rules/eslint/suggestions.js → config/eslint/suggestions-rules.js} +0 -0
  167. /package/{rules/eslint-comments/best-practices.js → config/eslint-comments/best-practices-rules.js} +0 -0
  168. /package/{rules/eslint-comments/stylistic-issues.js → config/eslint-comments/stylistic-issues-rules.js} +0 -0
  169. /package/{rules/import/helpful-warnings.js → config/import/helpful-warnings-rules.js} +0 -0
  170. /package/{rules/import/module-systems.js → config/import/module-systems-rules.js} +0 -0
  171. /package/{rules/import/static-analysis.js → config/import/static-analysis-rules.js} +0 -0
  172. /package/{rules/import/style-guide.js → config/import/style-guide-rules.js} +0 -0
  173. /package/{rules/jest/typescript-eslint.js → config/jest/typescript-eslint-jest-rules.js} +0 -0
  174. /package/{rules → config}/simple-import-sort/rules/imports.js +0 -0
  175. /package/{rules → config}/typescript-eslint/extension-rules.js +0 -0
  176. /package/{rules → config}/typescript-eslint/rules/typescript-eslint-naming-convention.js +0 -0
  177. /package/{rules → config}/unicorn/rules/prevent-abbreviations.js +0 -0
  178. /package/{config → linter}/node.js +0 -0
  179. /package/{config → linter}/plugin.js +0 -0
@@ -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";
@@ -1,12 +1,21 @@
1
1
  export type Match = string;
2
2
  export type Group = Match[];
3
+ /**
4
+ * Configuration options for the `simple-import-sort/imports` rule.
5
+ *
6
+ * @since v0.11.0
7
+ */
3
8
  export interface SimpleImportSortImports {
4
9
  groups: Group[];
5
10
  }
6
11
  /**
7
- * Configuration for the "simple-import-sort/imports" ESLint rule.
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.
8
17
  *
9
- * @param internal - A list of internal scopes. Each scope will sorted in its own group.
18
+ * @since v0.11.0
10
19
  */
11
20
  export declare function simpleImportSortImports(internal?: string[]): SimpleImportSortImports;
12
21
  /**
@@ -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;
@@ -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;