eslint-interactive 13.0.0 → 13.0.1

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 (178) hide show
  1. package/dist/action/convert-error-to-warning-per-file.d.ts +6 -0
  2. package/dist/action/convert-error-to-warning-per-file.d.ts.map +1 -0
  3. package/dist/action/convert-error-to-warning-per-file.js +8 -0
  4. package/dist/action/convert-error-to-warning-per-file.js.map +1 -0
  5. package/dist/action/disable-per-file.d.ts +6 -0
  6. package/dist/action/disable-per-file.d.ts.map +1 -0
  7. package/dist/action/disable-per-file.js +12 -0
  8. package/dist/action/disable-per-file.js.map +1 -0
  9. package/dist/action/disable-per-line.d.ts +6 -0
  10. package/dist/action/disable-per-line.d.ts.map +1 -0
  11. package/dist/action/disable-per-line.js +12 -0
  12. package/dist/action/disable-per-line.js.map +1 -0
  13. package/dist/action/fix.d.ts +6 -0
  14. package/dist/action/fix.d.ts.map +1 -0
  15. package/dist/action/fix.js +6 -0
  16. package/dist/action/fix.js.map +1 -0
  17. package/dist/action/index.d.ts +6 -0
  18. package/dist/action/index.d.ts.map +1 -0
  19. package/dist/action/index.js +6 -0
  20. package/dist/action/index.js.map +1 -0
  21. package/dist/action/print-result-details.d.ts +5 -0
  22. package/dist/action/print-result-details.d.ts.map +1 -0
  23. package/dist/action/print-result-details.js +35 -0
  24. package/dist/action/print-result-details.js.map +1 -0
  25. package/dist/cli/log.d.ts +6 -0
  26. package/dist/cli/log.d.ts.map +1 -0
  27. package/dist/cli/log.js +10 -0
  28. package/dist/cli/log.js.map +1 -0
  29. package/dist/cli/package.d.ts +2 -0
  30. package/dist/cli/package.d.ts.map +1 -0
  31. package/dist/cli/package.js +6 -0
  32. package/dist/cli/package.js.map +1 -0
  33. package/dist/cli/pager.d.ts +2 -0
  34. package/dist/cli/pager.d.ts.map +1 -0
  35. package/dist/cli/pager.js +34 -0
  36. package/dist/cli/pager.js.map +1 -0
  37. package/dist/cli/parse-argv.d.ts +4 -0
  38. package/dist/cli/parse-argv.d.ts.map +1 -0
  39. package/dist/cli/parse-argv.js +82 -0
  40. package/dist/cli/parse-argv.js.map +1 -0
  41. package/dist/cli/prompt.d.ts +51 -0
  42. package/dist/cli/prompt.d.ts.map +1 -0
  43. package/dist/cli/prompt.js +135 -0
  44. package/dist/cli/prompt.js.map +1 -0
  45. package/dist/cli/run.d.ts +8 -0
  46. package/dist/cli/run.d.ts.map +1 -0
  47. package/dist/cli/run.js +52 -0
  48. package/dist/cli/run.js.map +1 -0
  49. package/dist/cli/spinner.d.ts +4 -0
  50. package/dist/cli/spinner.d.ts.map +1 -0
  51. package/dist/cli/spinner.js +20 -0
  52. package/dist/cli/spinner.js.map +1 -0
  53. package/dist/core-worker.d.ts +21 -0
  54. package/dist/core-worker.d.ts.map +1 -0
  55. package/dist/core-worker.js +47 -0
  56. package/dist/core-worker.js.map +1 -0
  57. package/dist/core.d.ts +82 -0
  58. package/dist/core.d.ts.map +1 -0
  59. package/dist/core.js +186 -0
  60. package/dist/core.js.map +1 -0
  61. package/dist/eslint/linter.d.ts +18 -0
  62. package/dist/eslint/linter.d.ts.map +1 -0
  63. package/dist/eslint/linter.js +71 -0
  64. package/dist/eslint/linter.js.map +1 -0
  65. package/dist/eslint/report-translator.d.ts +9 -0
  66. package/dist/eslint/report-translator.d.ts.map +1 -0
  67. package/dist/eslint/report-translator.js +75 -0
  68. package/dist/eslint/report-translator.js.map +1 -0
  69. package/dist/eslint/rule-fixer.d.ts +80 -0
  70. package/dist/eslint/rule-fixer.d.ts.map +1 -0
  71. package/dist/eslint/rule-fixer.js +114 -0
  72. package/dist/eslint/rule-fixer.js.map +1 -0
  73. package/dist/eslint/source-code-fixer.d.ts +15 -0
  74. package/dist/eslint/source-code-fixer.d.ts.map +1 -0
  75. package/dist/eslint/source-code-fixer.js +131 -0
  76. package/dist/eslint/source-code-fixer.js.map +1 -0
  77. package/dist/fix/apply-auto-fixes.d.ts +8 -0
  78. package/dist/fix/apply-auto-fixes.d.ts.map +1 -0
  79. package/dist/fix/apply-auto-fixes.js +8 -0
  80. package/dist/fix/apply-auto-fixes.js.map +1 -0
  81. package/dist/fix/apply-suggestions.d.ts +11 -0
  82. package/dist/fix/apply-suggestions.d.ts.map +1 -0
  83. package/dist/fix/apply-suggestions.js +25 -0
  84. package/dist/fix/apply-suggestions.js.map +1 -0
  85. package/dist/fix/convert-error-to-warning-per-file.d.ts +10 -0
  86. package/dist/fix/convert-error-to-warning-per-file.d.ts.map +1 -0
  87. package/dist/fix/convert-error-to-warning-per-file.js +28 -0
  88. package/dist/fix/convert-error-to-warning-per-file.js.map +1 -0
  89. package/dist/fix/disable-per-file.d.ts +12 -0
  90. package/dist/fix/disable-per-file.d.ts.map +1 -0
  91. package/dist/fix/disable-per-file.js +63 -0
  92. package/dist/fix/disable-per-file.js.map +1 -0
  93. package/dist/fix/disable-per-line.d.ts +12 -0
  94. package/dist/fix/disable-per-line.d.ts.map +1 -0
  95. package/dist/fix/disable-per-line.js +72 -0
  96. package/dist/fix/disable-per-line.js.map +1 -0
  97. package/dist/fix/index.d.ts +19 -0
  98. package/dist/fix/index.d.ts.map +1 -0
  99. package/dist/fix/index.js +8 -0
  100. package/dist/fix/index.js.map +1 -0
  101. package/dist/fix/make-fixable-and-fix.d.ts +11 -0
  102. package/dist/fix/make-fixable-and-fix.d.ts.map +1 -0
  103. package/dist/fix/make-fixable-and-fix.js +35 -0
  104. package/dist/fix/make-fixable-and-fix.js.map +1 -0
  105. package/dist/formatter/colors.d.ts +4 -0
  106. package/dist/formatter/colors.d.ts.map +1 -0
  107. package/dist/formatter/colors.js +5 -0
  108. package/dist/formatter/colors.js.map +1 -0
  109. package/dist/formatter/format-by-files.d.ts +3 -0
  110. package/dist/formatter/format-by-files.d.ts.map +1 -0
  111. package/dist/formatter/format-by-files.js +42 -0
  112. package/dist/formatter/format-by-files.js.map +1 -0
  113. package/dist/formatter/format-by-rules.d.ts +8 -0
  114. package/dist/formatter/format-by-rules.d.ts.map +1 -0
  115. package/dist/formatter/format-by-rules.js +31 -0
  116. package/dist/formatter/format-by-rules.js.map +1 -0
  117. package/dist/formatter/format-table.d.ts +4 -0
  118. package/dist/formatter/format-table.d.ts.map +1 -0
  119. package/dist/formatter/format-table.js +62 -0
  120. package/dist/formatter/format-table.js.map +1 -0
  121. package/dist/formatter/index.d.ts +6 -0
  122. package/dist/formatter/index.d.ts.map +1 -0
  123. package/dist/formatter/index.js +8 -0
  124. package/dist/formatter/index.js.map +1 -0
  125. package/dist/formatter/sort-rule-statistics.d.ts +5 -0
  126. package/dist/formatter/sort-rule-statistics.d.ts.map +1 -0
  127. package/dist/formatter/sort-rule-statistics.js +34 -0
  128. package/dist/formatter/sort-rule-statistics.js.map +1 -0
  129. package/dist/formatter/take-rule-statistics.d.ts +18 -0
  130. package/dist/formatter/take-rule-statistics.d.ts.map +1 -0
  131. package/dist/formatter/take-rule-statistics.js +51 -0
  132. package/dist/formatter/take-rule-statistics.js.map +1 -0
  133. package/dist/index.d.ts +6 -0
  134. package/dist/index.d.ts.map +1 -0
  135. package/dist/index.js +6 -0
  136. package/dist/index.js.map +1 -0
  137. package/dist/plugin.d.ts +4 -0
  138. package/dist/plugin.d.ts.map +1 -0
  139. package/dist/plugin.js +87 -0
  140. package/dist/plugin.js.map +1 -0
  141. package/dist/scene/check-results.d.ts +21 -0
  142. package/dist/scene/check-results.d.ts.map +1 -0
  143. package/dist/scene/check-results.js +22 -0
  144. package/dist/scene/check-results.js.map +1 -0
  145. package/dist/scene/index.d.ts +25 -0
  146. package/dist/scene/index.d.ts.map +1 -0
  147. package/dist/scene/index.js +6 -0
  148. package/dist/scene/index.js.map +1 -0
  149. package/dist/scene/lint.d.ts +8 -0
  150. package/dist/scene/lint.d.ts.map +1 -0
  151. package/dist/scene/lint.js +30 -0
  152. package/dist/scene/lint.js.map +1 -0
  153. package/dist/scene/select-action.d.ts +20 -0
  154. package/dist/scene/select-action.d.ts.map +1 -0
  155. package/dist/scene/select-action.js +44 -0
  156. package/dist/scene/select-action.js.map +1 -0
  157. package/dist/scene/select-rule-ids.d.ts +15 -0
  158. package/dist/scene/select-rule-ids.d.ts.map +1 -0
  159. package/dist/scene/select-rule-ids.js +10 -0
  160. package/dist/scene/select-rule-ids.js.map +1 -0
  161. package/dist/type.d.ts +12 -0
  162. package/dist/type.d.ts.map +1 -0
  163. package/dist/type.js +2 -0
  164. package/dist/type.js.map +1 -0
  165. package/dist/util/array.d.ts +3 -0
  166. package/dist/util/array.d.ts.map +1 -0
  167. package/dist/util/array.js +14 -0
  168. package/dist/util/array.js.map +1 -0
  169. package/dist/util/eslint.d.ts +103 -0
  170. package/dist/util/eslint.d.ts.map +1 -0
  171. package/dist/util/eslint.js +220 -0
  172. package/dist/util/eslint.js.map +1 -0
  173. package/dist/util/type-check.d.ts +3 -0
  174. package/dist/util/type-check.d.ts.map +1 -0
  175. package/dist/util/type-check.js +8 -0
  176. package/dist/util/type-check.js.map +1 -0
  177. package/package.json +18 -19
  178. package/src/index.ts +0 -0
@@ -0,0 +1,6 @@
1
+ import type { Remote } from 'comlink';
2
+ import type { ESLint } from 'eslint';
3
+ import type { Undo } from '../core.js';
4
+ import type { SerializableCore } from '../core-worker.js';
5
+ export declare function doConvertErrorToWarningPerFileAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
6
+ //# sourceMappingURL=convert-error-to-warning-per-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-error-to-warning-per-file.d.ts","sourceRoot":"","sources":["../../src/action/convert-error-to-warning-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -0,0 +1,8 @@
1
+ import { promptToInputDescription } from '../cli/prompt.js';
2
+ import { fixingSpinner } from '../cli/spinner.js';
3
+ export async function doConvertErrorToWarningPerFileAction(core, results, selectedRuleIds) {
4
+ const description = await promptToInputDescription();
5
+ const undo = await fixingSpinner(async () => core.convertErrorToWarningPerFile(results, selectedRuleIds, description));
6
+ return undo;
7
+ }
8
+ //# sourceMappingURL=convert-error-to-warning-per-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-error-to-warning-per-file.js","sourceRoot":"","sources":["../../src/action/convert-error-to-warning-per-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,WAAW,GAAG,MAAM,wBAAwB,EAAE,CAAC;IACrD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE,CAC1C,IAAI,CAAC,4BAA4B,CAAC,OAAO,EAAE,eAAe,EAAE,WAAW,CAAC,CACzE,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Remote } from 'comlink';
2
+ import type { ESLint } from 'eslint';
3
+ import type { Undo } from '../core.js';
4
+ import type { SerializableCore } from '../core-worker.js';
5
+ export declare function doDisablePerFileAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
6
+ //# sourceMappingURL=disable-per-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable-per-file.d.ts","sourceRoot":"","sources":["../../src/action/disable-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -0,0 +1,12 @@
1
+ import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.js';
2
+ import { fixingSpinner } from '../cli/spinner.js';
3
+ export async function doDisablePerFileAction(core, results, selectedRuleIds) {
4
+ const description = await promptToInputDescription();
5
+ let descriptionPosition;
6
+ if (description) {
7
+ descriptionPosition = await promptToInputDescriptionPosition();
8
+ }
9
+ const undo = await fixingSpinner(async () => core.disablePerFile(results, selectedRuleIds, description, descriptionPosition));
10
+ return undo;
11
+ }
12
+ //# sourceMappingURL=disable-per-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable-per-file.js","sourceRoot":"","sources":["../../src/action/disable-per-file.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,WAAW,GAAG,MAAM,wBAAwB,EAAE,CAAC;IACrD,IAAI,mBAAwC,CAAC;IAC7C,IAAI,WAAW,EAAE,CAAC;QAChB,mBAAmB,GAAG,MAAM,gCAAgC,EAAE,CAAC;IACjE,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE,CAC1C,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAChF,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Remote } from 'comlink';
2
+ import type { ESLint } from 'eslint';
3
+ import type { Undo } from '../core.js';
4
+ import type { SerializableCore } from '../core-worker.js';
5
+ export declare function doDisablePerLineAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
6
+ //# sourceMappingURL=disable-per-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable-per-line.d.ts","sourceRoot":"","sources":["../../src/action/disable-per-line.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -0,0 +1,12 @@
1
+ import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.js';
2
+ import { fixingSpinner } from '../cli/spinner.js';
3
+ export async function doDisablePerLineAction(core, results, selectedRuleIds) {
4
+ const description = await promptToInputDescription();
5
+ let descriptionPosition;
6
+ if (description) {
7
+ descriptionPosition = await promptToInputDescriptionPosition();
8
+ }
9
+ const undo = await fixingSpinner(async () => core.disablePerLine(results, selectedRuleIds, description, descriptionPosition));
10
+ return undo;
11
+ }
12
+ //# sourceMappingURL=disable-per-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disable-per-line.js","sourceRoot":"","sources":["../../src/action/disable-per-line.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,WAAW,GAAG,MAAM,wBAAwB,EAAE,CAAC;IACrD,IAAI,mBAAwC,CAAC;IAC7C,IAAI,WAAW,EAAE,CAAC;QAChB,mBAAmB,GAAG,MAAM,gCAAgC,EAAE,CAAC;IACjE,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE,CAC1C,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAChF,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Remote } from 'comlink';
2
+ import type { ESLint } from 'eslint';
3
+ import type { Undo } from '../core.js';
4
+ import type { SerializableCore } from '../core-worker.js';
5
+ export declare function doFixAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
6
+ //# sourceMappingURL=fix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix.d.ts","sourceRoot":"","sources":["../../src/action/fix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -0,0 +1,6 @@
1
+ import { fixingSpinner } from '../cli/spinner.js';
2
+ export async function doFixAction(core, results, selectedRuleIds) {
3
+ const undo = await fixingSpinner(async () => core.applyAutoFixes(results, selectedRuleIds));
4
+ return undo;
5
+ }
6
+ //# sourceMappingURL=fix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix.js","sourceRoot":"","sources":["../../src/action/fix.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAC5F,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { doDisablePerFileAction } from './disable-per-file.js';
2
+ export { doDisablePerLineAction } from './disable-per-line.js';
3
+ export { doConvertErrorToWarningPerFileAction } from './convert-error-to-warning-per-file.js';
4
+ export { doFixAction } from './fix.js';
5
+ export { doPrintResultDetailsAction } from './print-result-details.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { doDisablePerFileAction } from './disable-per-file.js';
2
+ export { doDisablePerLineAction } from './disable-per-line.js';
3
+ export { doConvertErrorToWarningPerFileAction } from './convert-error-to-warning-per-file.js';
4
+ export { doFixAction } from './fix.js';
5
+ export { doPrintResultDetailsAction } from './print-result-details.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Remote } from 'comlink';
2
+ import type { ESLint } from 'eslint';
3
+ import type { SerializableCore } from '../core-worker.js';
4
+ export declare function doPrintResultDetailsAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<void>;
5
+ //# sourceMappingURL=print-result-details.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-result-details.d.ts","sourceRoot":"","sources":["../../src/action/print-result-details.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,iBAkB1B"}
@@ -0,0 +1,35 @@
1
+ import { writeFile } from 'node:fs/promises';
2
+ import { mkdir } from 'node:fs/promises';
3
+ import { tmpdir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
6
+ import { stripVTControlCharacters, styleText } from 'node:util';
7
+ import { VERSION } from '../cli/package.js';
8
+ import { pager } from '../cli/pager.js';
9
+ import { promptToInputDisplayMode } from '../cli/prompt.js';
10
+ import { unreachable } from '../util/type-check.js';
11
+ export async function doPrintResultDetailsAction(core, results, selectedRuleIds) {
12
+ const displayMode = await promptToInputDisplayMode();
13
+ const formattedResultDetails = await core.formatResultDetails(results, selectedRuleIds);
14
+ if (displayMode === 'printInTerminal') {
15
+ console.log(formattedResultDetails);
16
+ }
17
+ else if (displayMode === 'printInTerminalWithPager') {
18
+ await pager(formattedResultDetails);
19
+ }
20
+ else if (displayMode === 'writeToFile') {
21
+ const tempDir = getTempDir();
22
+ const filePath = join(tempDir, 'lint-result-details.txt');
23
+ await mkdir(tempDir, { recursive: true }); // Create the directory because it might not exist
24
+ await writeFile(filePath, stripVTControlCharacters(formattedResultDetails), 'utf8');
25
+ console.log(styleText('cyan', `Wrote to ${filePath}`));
26
+ }
27
+ else {
28
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
29
+ unreachable(`Unknown display mode: ${displayMode}`);
30
+ }
31
+ }
32
+ function getTempDir() {
33
+ return join(tmpdir(), 'eslint-interactive', VERSION);
34
+ }
35
+ //# sourceMappingURL=print-result-details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-result-details.js","sourceRoot":"","sources":["../../src/action/print-result-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,E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,YAAY,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,4EAA4E;QAC5E,WAAW,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED,SAAS,UAAU;IACjB,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Log an error message to stderr
3
+ * @param message The message to report
4
+ */
5
+ export declare function error(message: string): void;
6
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,QAEpC"}
@@ -0,0 +1,10 @@
1
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
2
+ import { styleText } from 'node:util';
3
+ /**
4
+ * Log an error message to stderr
5
+ * @param message The message to report
6
+ */
7
+ export function error(message) {
8
+ process.stderr.write(styleText('red', 'Error') + ': ' + message + '\n');
9
+ }
10
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,OAAe;IACnC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION: string;
2
+ //# sourceMappingURL=package.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/cli/package.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,OAAO,EAAE,MAA6B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ const PACKAGE_JSON = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'), 'utf8'));
5
+ export const VERSION = PACKAGE_JSON.version;
6
+ //# sourceMappingURL=package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/cli/package.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAC7B,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAChG,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAW,YAAY,CAAC,OAAO,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function pager(content: string): Promise<void>;
2
+ //# sourceMappingURL=pager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../src/cli/pager.ts"],"names":[],"mappings":"AAEA,wBAAsB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1D"}
@@ -0,0 +1,34 @@
1
+ import { spawn } from 'node:child_process';
2
+ export async function pager(content) {
3
+ if (process.platform === 'win32') {
4
+ return spawnPager('more', [], content);
5
+ }
6
+ else {
7
+ return spawnPager('less', ['-R'], content);
8
+ }
9
+ }
10
+ async function spawnPager(command, options, content) {
11
+ return new Promise((resolve, reject) => {
12
+ try {
13
+ const process = spawn(command, options, { shell: true, stdio: ['pipe', 'inherit', 'inherit'] });
14
+ process.stdin.write(content);
15
+ process.stdin.end();
16
+ process.addListener('exit', (code) => {
17
+ if (code !== 0) {
18
+ reject(new Error(`\`${command}\` exited with code ${code}`));
19
+ }
20
+ else {
21
+ resolve();
22
+ }
23
+ });
24
+ process.addListener('error', (err) => {
25
+ reject(new Error(`\`${command}\` throws an error: ${err.message}`));
26
+ });
27
+ }
28
+ catch (e) {
29
+ const cause = e instanceof Error ? e.message : String(e);
30
+ reject(new Error(`Failed to execute \`${command}\`: ${cause}`));
31
+ }
32
+ });
33
+ }
34
+ //# sourceMappingURL=pager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pager.js","sourceRoot":"","sources":["../../src/cli/pager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAe;IACzC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,OAAO,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,OAAiB,EAAE,OAAe;IAC3E,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;YAChG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACpB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACnC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACf,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,OAAO,uBAAuB,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC/D,CAAC;qBAAM,CAAC;oBACN,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACnC,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,OAAO,uBAAuB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACtE,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzD,MAAM,CAAC,IAAI,KAAK,CAAC,uBAAuB,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Config } from '../type.js';
2
+ /** Parse CLI options */
3
+ export declare function parseArgv(argv: string[]): Config;
4
+ //# sourceMappingURL=parse-argv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-argv.d.ts","sourceRoot":"","sources":["../../src/cli/parse-argv.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAwB,MAAM,YAAY,CAAC;AAM/D,wBAAwB;AACxB,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAqFhD"}
@@ -0,0 +1,82 @@
1
+ import { parseArgs } from 'node:util';
2
+ import { VERSION } from './package.js';
3
+ const VALID_SORT_FIELDS = ['rule', 'error', 'warning', 'fixable', 'suggestions'];
4
+ const VALID_SORT_ORDERS = ['asc', 'desc'];
5
+ /** Parse CLI options */
6
+ export function parseArgv(argv) {
7
+ const options = {
8
+ 'config': { type: 'string', short: 'c' },
9
+ 'format': { type: 'string' },
10
+ 'quiet': { type: 'boolean' },
11
+ 'cache': { type: 'boolean' },
12
+ 'cache-location': { type: 'string' },
13
+ 'version': { type: 'boolean' },
14
+ 'help': { type: 'boolean' },
15
+ 'flag': { type: 'string', multiple: true },
16
+ 'sort': { type: 'string' },
17
+ 'sort-order': { type: 'string' },
18
+ };
19
+ const { values, positionals } = parseArgs({
20
+ allowPositionals: true,
21
+ allowNegative: true,
22
+ strict: true,
23
+ args: argv.slice(2),
24
+ options,
25
+ });
26
+ // Validate `--sort` and `--sort-order`
27
+ if (values.sort !== undefined && !VALID_SORT_FIELDS.includes(values.sort)) {
28
+ console.error(`Invalid --sort value: "${values.sort}". Must be one of: ${VALID_SORT_FIELDS.join(', ')}`);
29
+ // eslint-disable-next-line n/no-process-exit
30
+ process.exit(1);
31
+ }
32
+ if (values['sort-order'] !== undefined && !VALID_SORT_ORDERS.includes(values['sort-order'])) {
33
+ console.error(`Invalid --sort-order value: "${values['sort-order']}". Must be one of: ${VALID_SORT_ORDERS.join(', ')}`);
34
+ // eslint-disable-next-line n/no-process-exit
35
+ process.exit(1);
36
+ }
37
+ if (values.version) {
38
+ console.log(VERSION);
39
+ // eslint-disable-next-line n/no-process-exit
40
+ process.exit(0);
41
+ }
42
+ if (values.help) {
43
+ console.log(`
44
+ eslint-interactive [...patterns]
45
+
46
+ Options:
47
+ --help Show help
48
+ --version Show version number
49
+ -c, --config <path> Use this configuration, overriding config options if present
50
+ --format <nameOrPath> Specify the format to be used for the "Display problem messages" action
51
+ --quiet Report errors only
52
+ --cache Only check changed files
53
+ --cache-location <path> Path to the cache file or directory
54
+ --flag <name> Enable a feature flag (requires ESLint v9.6.0+)
55
+ --sort <field> Sort rules by: rule, error, warning, fixable, suggestions
56
+ --sort-order <direction> Sort direction: asc, desc (default: desc for counts, asc for rule)
57
+
58
+ Examples:
59
+ eslint-interactive Lint all files in the project
60
+ eslint-interactive src test Lint specified directories
61
+ eslint-interactive 'src/**/*.{ts,tsx,vue}' Lint with glob pattern
62
+ eslint-interactive --sort error Sort rules by error count (descending)
63
+ eslint-interactive --sort rule Sort rules by rule name (ascending)
64
+ `.trim());
65
+ // eslint-disable-next-line n/no-process-exit
66
+ process.exit(0);
67
+ }
68
+ const patterns = positionals.map((pattern) => pattern.toString());
69
+ const formatterName = values.format;
70
+ return {
71
+ patterns,
72
+ formatterName,
73
+ quiet: values.quiet,
74
+ overrideConfigFile: values.config,
75
+ cache: values.cache,
76
+ cacheLocation: values['cache-location'],
77
+ flags: values.flag,
78
+ sort: values.sort,
79
+ sortOrder: values['sort-order'],
80
+ };
81
+ }
82
+ //# sourceMappingURL=parse-argv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-argv.js","sourceRoot":"","sources":["../../src/cli/parse-argv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,iBAAiB,GAAyB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AACvG,MAAM,iBAAiB,GAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAEhE,wBAAwB;AACxB,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,OAAO,GAAG;QACd,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE;QACxC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;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AAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,6CAA6C;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CACT;;;;;;;;;;;;;;;;;;;;;CAqBL,CAAC,IAAI,EAAE,CACH,CAAC;QACF,6CAA6C;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClE,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IAEpC,OAAO;QACL,QAAQ;QACR,aAAa;QACb,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,kBAAkB,EAAE,MAAM,CAAC,MAAM;QACjC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,aAAa,EAAE,MAAM,CAAC,gBAAgB,CAAC;QACvC,KAAK,EAAE,MAAM,CAAC,IAAI;QAClB,IAAI,EAAE,MAAM,CAAC,IAA6B;QAC1C,SAAS,EAAE,MAAM,CAAC,YAAY,CAA0B;KACzD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { ESLint } from 'eslint';
2
+ /**
3
+ * The type that indicates what to do with the problems of selected rules.
4
+ */
5
+ export type Action = 'printResultDetails' | 'applyAutoFixes' | 'disablePerLine' | 'disablePerFile' | 'convertErrorToWarningPerFile' | 'relintAndReselectRules' | 'reselectRules';
6
+ /**
7
+ * The type representing how to display the lint results.
8
+ *
9
+ * `printInTerminal` means to print the lint results in the terminal.
10
+ * `printInTerminalWithPager` means to print the lint results in the terminal with a pager (e.g. `less`).
11
+ * `writeToFile` means to write the lint results to a file.
12
+ */
13
+ type DisplayMode = 'printInTerminal' | 'printInTerminalWithPager' | 'writeToFile';
14
+ /**
15
+ * The type that represents what to do next.
16
+ */
17
+ type NextStep = 'fixOtherRules' | 'exit' | 'undoTheFix';
18
+ export type DescriptionPosition = 'sameLine' | 'previousLine';
19
+ /**
20
+ * Ask the user for the rule ids to which they want to apply the action.
21
+ * @param ruleIdsInResults The rule ids that are in the lint results.
22
+ * @returns The rule ids
23
+ */
24
+ export declare function promptToInputRuleIds(ruleIdsInResults: string[]): Promise<string[]>;
25
+ /**
26
+ * Ask the user what action they want to perform.
27
+ * @returns The action name
28
+ */
29
+ export declare function promptToInputAction(results: ESLint.LintResult[], selectedRuleIds: string[], initialAction?: Action): Promise<Action>;
30
+ /**
31
+ * Ask the user how to display the lint results.
32
+ * @returns How to display
33
+ */
34
+ export declare function promptToInputDisplayMode(): Promise<DisplayMode>;
35
+ /**
36
+ * Ask the user a description to leave in directive.
37
+ * @returns The description
38
+ */
39
+ export declare function promptToInputDescription(): Promise<string | undefined>;
40
+ /**
41
+ * Ask the user a position of the description
42
+ * @returns The description position
43
+ */
44
+ export declare function promptToInputDescriptionPosition(): Promise<DescriptionPosition>;
45
+ /**
46
+ * Ask the user what to do next.
47
+ * @returns What to do next.
48
+ */
49
+ export declare function promptToInputWhatToDoNext(): Promise<NextStep>;
50
+ export {};
51
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/cli/prompt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUrC;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,oBAAoB,GACpB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,8BAA8B,GAC9B,wBAAwB,GACxB,eAAe,CAAC;AAEpB;;;;;;GAMG;AACH,KAAK,WAAW,GAAG,iBAAiB,GAAG,0BAA0B,GAAG,aAAa,CAAC;AAElF;;GAEG;AACH,KAAK,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,YAAY,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,cAAc,CAAC;AAE9D;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBxF;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,EACzB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,WAAW,CAAC,CAiBrE;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAY5E;AAED;;;GAGG;AACH,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAgBrF;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAenE"}
@@ -0,0 +1,135 @@
1
+ /* istanbul ignore file */
2
+ import enquirer from 'enquirer';
3
+ import { takeRuleStatistics } from '../formatter/index.js';
4
+ const { prompt } = enquirer;
5
+ // When combined with worker, for some reason the enquirer grabs the SIGINT and the process continues to survive.
6
+ // Therefore, the process is explicitly terminated.
7
+ // eslint-disable-next-line n/no-process-exit
8
+ const onCancel = () => process.exit();
9
+ /**
10
+ * Ask the user for the rule ids to which they want to apply the action.
11
+ * @param ruleIdsInResults The rule ids that are in the lint results.
12
+ * @returns The rule ids
13
+ */
14
+ export async function promptToInputRuleIds(ruleIdsInResults) {
15
+ const { ruleIds } = await prompt([
16
+ {
17
+ name: 'ruleIds',
18
+ type: 'multiselect',
19
+ message: 'Which rules would you like to apply action?',
20
+ // @ts-expect-error
21
+ hint: 'Select all you want with <space> key.',
22
+ choices: ruleIdsInResults,
23
+ validate(value) {
24
+ return value.length === 0 ? `Select at least one rule with <space> key.` : true;
25
+ },
26
+ onCancel,
27
+ },
28
+ ]);
29
+ return ruleIds;
30
+ }
31
+ /**
32
+ * Ask the user what action they want to perform.
33
+ * @returns The action name
34
+ */
35
+ export async function promptToInputAction(results, selectedRuleIds, initialAction) {
36
+ const ruleStatistics = takeRuleStatistics(results).filter((ruleStatistic) => selectedRuleIds.includes(ruleStatistic.ruleId));
37
+ const foldedStatistics = ruleStatistics.reduce((a, b) => ({
38
+ isFixableCount: a.isFixableCount + b.isFixableCount,
39
+ }), { isFixableCount: 0 });
40
+ const choices = [
41
+ { name: 'printResultDetails', message: '🔎 Display details of lint results' },
42
+ { name: 'applyAutoFixes', message: '🔧 Run `eslint --fix`', disabled: foldedStatistics.isFixableCount === 0 },
43
+ { name: 'disablePerLine', message: '🔧 Disable per line' },
44
+ { name: 'disablePerFile', message: '🔧 Disable per file' },
45
+ { name: 'convertErrorToWarningPerFile', message: '🔧 Convert error to warning per file' },
46
+ { name: 'relintAndReselectRules', message: 'â†Šī¸ Go back (with re-lint)' },
47
+ { name: 'reselectRules', message: 'â†Šī¸ Go back' },
48
+ ];
49
+ const { action } = await prompt([
50
+ {
51
+ name: 'action',
52
+ type: 'select',
53
+ message: 'Which action do you want to do?',
54
+ choices,
55
+ initial: choices.findIndex((choice) => choice.name === initialAction) ?? 0,
56
+ onCancel,
57
+ },
58
+ ]);
59
+ return action;
60
+ }
61
+ /**
62
+ * Ask the user how to display the lint results.
63
+ * @returns How to display
64
+ */
65
+ export async function promptToInputDisplayMode() {
66
+ const { displayMode } = await prompt([
67
+ {
68
+ name: 'displayMode',
69
+ type: 'select',
70
+ message: 'In what way are the details displayed?',
71
+ choices: [
72
+ { name: 'printInTerminal', message: '🖨 Print in terminal' },
73
+ { name: 'printInTerminalWithPager', message: 'â†•ī¸ Print in terminal with pager' },
74
+ { name: 'writeToFile', message: '📝 Write to file' },
75
+ ],
76
+ onCancel,
77
+ },
78
+ ]);
79
+ return displayMode;
80
+ }
81
+ /**
82
+ * Ask the user a description to leave in directive.
83
+ * @returns The description
84
+ */
85
+ export async function promptToInputDescription() {
86
+ const { description } = await prompt([
87
+ {
88
+ name: 'description',
89
+ type: 'input',
90
+ message: 'Leave a code comment with your reason for fixing (Optional)',
91
+ onCancel,
92
+ },
93
+ ]);
94
+ return description === '' ? undefined : description;
95
+ }
96
+ /**
97
+ * Ask the user a position of the description
98
+ * @returns The description position
99
+ */
100
+ export async function promptToInputDescriptionPosition() {
101
+ const { descriptionPosition } = await prompt([
102
+ {
103
+ name: 'descriptionPosition',
104
+ type: 'select',
105
+ message: 'Where would you like to position the code comment?',
106
+ choices: [
107
+ { name: 'sameLine', message: "Same Line - Place on the same line as the eslint's disable comment." },
108
+ { name: 'previousLine', message: "Previous Line - Place on the line before the eslint's disable comment." },
109
+ ],
110
+ onCancel,
111
+ },
112
+ ]);
113
+ return descriptionPosition;
114
+ }
115
+ /**
116
+ * Ask the user what to do next.
117
+ * @returns What to do next.
118
+ */
119
+ export async function promptToInputWhatToDoNext() {
120
+ const { nextStep } = await prompt([
121
+ {
122
+ name: 'nextStep',
123
+ type: 'select',
124
+ message: "What's the next step?",
125
+ choices: [
126
+ { name: 'fixOtherRules', message: '🔧 Fix other rules' },
127
+ { name: 'undoTheFix', message: 'â†Šī¸ Undo the fix' },
128
+ { name: 'exit', message: '💚 Exit' },
129
+ ],
130
+ onCancel,
131
+ },
132
+ ]);
133
+ return nextStep;
134
+ }
135
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/cli/prompt.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,EAAE,MAAM,EAAE,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+ /**
5
+ * Run eslint-interactive.
6
+ */
7
+ export declare function run(options: Options): Promise<void>;
8
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,iBAsCzC"}