eslint-interactive 13.0.1 → 14.0.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 (111) hide show
  1. package/README.md +19 -10
  2. package/dist/action/convert-error-to-warning-per-file.d.ts +2 -4
  3. package/dist/action/convert-error-to-warning-per-file.d.ts.map +1 -1
  4. package/dist/action/convert-error-to-warning-per-file.js +2 -2
  5. package/dist/action/convert-error-to-warning-per-file.js.map +1 -1
  6. package/dist/action/disable-per-file.d.ts +2 -4
  7. package/dist/action/disable-per-file.d.ts.map +1 -1
  8. package/dist/action/disable-per-file.js +2 -2
  9. package/dist/action/disable-per-file.js.map +1 -1
  10. package/dist/action/disable-per-line.d.ts +2 -4
  11. package/dist/action/disable-per-line.d.ts.map +1 -1
  12. package/dist/action/disable-per-line.js +2 -2
  13. package/dist/action/disable-per-line.js.map +1 -1
  14. package/dist/action/fix.d.ts +2 -4
  15. package/dist/action/fix.d.ts.map +1 -1
  16. package/dist/action/fix.js +2 -2
  17. package/dist/action/fix.js.map +1 -1
  18. package/dist/action/print-result-details.d.ts +2 -3
  19. package/dist/action/print-result-details.d.ts.map +1 -1
  20. package/dist/action/print-result-details.js +3 -2
  21. package/dist/action/print-result-details.js.map +1 -1
  22. package/dist/cli/log.d.ts +1 -0
  23. package/dist/cli/log.d.ts.map +1 -1
  24. package/dist/cli/log.js +25 -0
  25. package/dist/cli/log.js.map +1 -1
  26. package/dist/cli/parse-argv.d.ts.map +1 -1
  27. package/dist/cli/parse-argv.js +31 -10
  28. package/dist/cli/parse-argv.js.map +1 -1
  29. package/dist/cli/prompt.d.ts.map +1 -1
  30. package/dist/cli/prompt.js +53 -91
  31. package/dist/cli/prompt.js.map +1 -1
  32. package/dist/cli/run.d.ts +1 -3
  33. package/dist/cli/run.d.ts.map +1 -1
  34. package/dist/cli/run.js +3 -27
  35. package/dist/cli/run.js.map +1 -1
  36. package/dist/core.d.ts +2 -2
  37. package/dist/core.d.ts.map +1 -1
  38. package/dist/core.js +10 -7
  39. package/dist/core.js.map +1 -1
  40. package/dist/fix/disable-per-file.d.ts +1 -1
  41. package/dist/fix/disable-per-file.d.ts.map +1 -1
  42. package/dist/fix/disable-per-line.d.ts +1 -1
  43. package/dist/fix/disable-per-line.d.ts.map +1 -1
  44. package/dist/formatter/filter-rule-statistics.d.ts +9 -0
  45. package/dist/formatter/filter-rule-statistics.d.ts.map +1 -0
  46. package/dist/formatter/filter-rule-statistics.js +22 -0
  47. package/dist/formatter/filter-rule-statistics.js.map +1 -0
  48. package/dist/formatter/format-by-rules.d.ts +4 -3
  49. package/dist/formatter/format-by-rules.d.ts.map +1 -1
  50. package/dist/formatter/format-by-rules.js +7 -5
  51. package/dist/formatter/format-by-rules.js.map +1 -1
  52. package/dist/formatter/index.d.ts +3 -2
  53. package/dist/formatter/index.d.ts.map +1 -1
  54. package/dist/formatter/index.js +3 -2
  55. package/dist/formatter/index.js.map +1 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/scene/check-results.d.ts.map +1 -1
  60. package/dist/scene/check-results.js +2 -5
  61. package/dist/scene/check-results.js.map +1 -1
  62. package/dist/scene/lint.d.ts +2 -3
  63. package/dist/scene/lint.d.ts.map +1 -1
  64. package/dist/scene/lint.js +13 -9
  65. package/dist/scene/lint.js.map +1 -1
  66. package/dist/scene/select-action.d.ts +2 -3
  67. package/dist/scene/select-action.d.ts.map +1 -1
  68. package/dist/scene/select-action.js.map +1 -1
  69. package/dist/scene/select-rule-ids.d.ts +2 -3
  70. package/dist/scene/select-rule-ids.d.ts.map +1 -1
  71. package/dist/scene/select-rule-ids.js.map +1 -1
  72. package/dist/type.d.ts +2 -0
  73. package/dist/type.d.ts.map +1 -1
  74. package/dist/util/terminal-link.d.ts +2 -0
  75. package/dist/util/terminal-link.d.ts.map +1 -0
  76. package/dist/util/terminal-link.js +16 -0
  77. package/dist/util/terminal-link.js.map +1 -0
  78. package/package.json +5 -6
  79. package/src/action/convert-error-to-warning-per-file.ts +4 -6
  80. package/src/action/disable-per-file.ts +4 -6
  81. package/src/action/disable-per-line.ts +4 -6
  82. package/src/action/fix.ts +4 -10
  83. package/src/action/print-result-details.ts +5 -9
  84. package/src/cli/log.ts +25 -0
  85. package/src/cli/parse-argv.ts +32 -11
  86. package/src/cli/prompt.ts +56 -92
  87. package/src/cli/run.ts +3 -29
  88. package/src/core.ts +13 -6
  89. package/src/fix/disable-per-file.ts +1 -1
  90. package/src/fix/disable-per-line.ts +1 -1
  91. package/src/formatter/filter-rule-statistics.ts +27 -0
  92. package/src/formatter/format-by-rules.ts +10 -7
  93. package/src/formatter/index.ts +4 -3
  94. package/src/index.ts +1 -1
  95. package/src/scene/check-results.ts +2 -5
  96. package/src/scene/lint.ts +14 -12
  97. package/src/scene/select-action.ts +2 -4
  98. package/src/scene/select-rule-ids.ts +2 -6
  99. package/src/type.ts +2 -0
  100. package/src/util/terminal-link.ts +16 -0
  101. package/dist/cli/spinner.d.ts +0 -4
  102. package/dist/cli/spinner.d.ts.map +0 -1
  103. package/dist/cli/spinner.js +0 -20
  104. package/dist/cli/spinner.js.map +0 -1
  105. package/dist/core-worker.d.ts +0 -21
  106. package/dist/core-worker.d.ts.map +0 -1
  107. package/dist/core-worker.js +0 -47
  108. package/dist/core-worker.js.map +0 -1
  109. package/src/cli/spinner.ts +0 -22
  110. package/src/core-worker.ts +0 -55
  111. package/src/typings/enquirer.d.ts +0 -7
@@ -1,5 +1,5 @@
1
+ import { withProgress } from '../cli/log.js';
1
2
  import { promptToInputWhatToDoNext } from '../cli/prompt.js';
2
- import { undoingSpinner } from '../cli/spinner.js';
3
3
  /**
4
4
  * Run the scene where a user check the fix results.
5
5
  */
@@ -8,15 +8,12 @@ export async function checkResults({ results, ruleIdsInResults, selectedRuleIds,
8
8
  if (nextStep === 'exit')
9
9
  return { name: 'exit' };
10
10
  if (nextStep === 'undoTheFix') {
11
- await undoingSpinner(async () => undo());
11
+ await withProgress('Undoing', async () => undo());
12
12
  return {
13
13
  name: 'selectAction',
14
14
  args: { results, ruleIdsInResults, selectedRuleIds, initialAction: selectedAction },
15
15
  };
16
16
  }
17
- console.log();
18
- console.log('─'.repeat(process.stdout.columns));
19
- console.log();
20
17
  return { name: 'lint' };
21
18
  }
22
19
  //# sourceMappingURL=check-results.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-results.js","sourceRoot":"","sources":["../../src/scene/check-results.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiBnD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,cAAc,GACG;IACjB,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC;IACnD,IAAI,QAAQ,KAAK,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACjD,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC9B,MAAM,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACzC,OAAO;YACL,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE;SACpF,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"check-results.js","sourceRoot":"","sources":["../../src/scene/check-results.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAiB7D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EACjC,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,cAAc,GACG;IACjB,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC;IACnD,IAAI,QAAQ,KAAK,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACjD,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC9B,MAAM,YAAY,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,OAAO;YACL,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE;SACpF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC"}
@@ -1,8 +1,7 @@
1
- import type { Remote } from 'comlink';
2
- import type { SerializableCore } from '../core-worker.js';
1
+ import type { Core } from '../core.js';
3
2
  import type { NextScene } from './index.js';
4
3
  /**
5
4
  * Run the scene to lint.
6
5
  */
7
- export declare function lint(core: Remote<SerializableCore>): Promise<NextScene>;
6
+ export declare function lint(core: Core): Promise<NextScene>;
8
7
  //# sourceMappingURL=lint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/scene/lint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CA6B7E"}
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/scene/lint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,CAgCzD"}
@@ -1,11 +1,10 @@
1
- import { error } from '../cli/log.js';
2
- import { lintingSpinner } from '../cli/spinner.js';
1
+ import { log } from '@clack/prompts';
2
+ import { error, withProgress } from '../cli/log.js';
3
3
  /**
4
4
  * Run the scene to lint.
5
5
  */
6
6
  export async function lint(core) {
7
- const results = await lintingSpinner(async () => core.lint());
8
- console.log();
7
+ const results = await withProgress('Linting', async () => core.lint());
9
8
  // Check for ESLint core problems (ruleId === null) first.
10
9
  // These represent config errors, syntax errors, etc. that eslint-interactive cannot fix.
11
10
  const hasESLintCoreProblems = results.flatMap((result) => result.messages).some((message) => message.ruleId === null);
@@ -14,17 +13,22 @@ export async function lint(core) {
14
13
  'The problems cannot be fixed by eslint-interactive. ' +
15
14
  'Check the details of the problem and fix it. ' +
16
15
  'This is usually caused by the invalid eslint config or the invalid syntax of the linted code.');
17
- console.log(await core.formatResultDetails(results, [null]));
16
+ log.message(await core.formatResultDetails(results, [null]), {});
18
17
  // eslint-disable-next-line n/no-process-exit
19
18
  process.exit(1);
20
19
  }
21
- const ruleIdsInResults = await core.getSortedRuleIdsInResults(results);
20
+ const ruleIdsInResults = core.getFilteredAndSortedRuleIds(results);
22
21
  if (ruleIdsInResults.length === 0) {
23
- console.log('💚 No error found.');
22
+ const hasAnyMessage = results.some((result) => result.messages.length > 0);
23
+ if (hasAnyMessage) {
24
+ log.message('💚 No rules match the given --filter.');
25
+ }
26
+ else {
27
+ log.message('💚 No rules with problems.');
28
+ }
24
29
  return { name: 'exit' };
25
30
  }
26
- console.log(await core.formatResultSummary(results));
27
- console.log();
31
+ log.message(core.formatResultSummary(results));
28
32
  return { name: 'selectRuleIds', args: { results, ruleIdsInResults } };
29
33
  }
30
34
  //# sourceMappingURL=lint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/scene/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAA8B;IACvD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,0DAA0D;IAC1D,yFAAyF;IACzF,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;IACtH,IAAI,qBAAqB,EAAE,CAAC;QAC1B,KAAK,CACH,kCAAkC;YAChC,sDAAsD;YACtD,+CAA+C;YAC/C,+FAA+F,CAClG,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,6CAA6C;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEvE,IAAI,gBAAgB,CAAC,MA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CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAEnE,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3E,IAAI,aAAa,EAAE,CAAC;YAClB,GAAG,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC;IACD,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE/C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC;AACxE,CAAC"}
@@ -1,7 +1,6 @@
1
- import type { Remote } from 'comlink';
2
1
  import type { ESLint } from 'eslint';
3
2
  import type { Action } from '../cli/prompt.js';
4
- import type { SerializableCore } from '../core-worker.js';
3
+ import type { Core } from '../core.js';
5
4
  import type { NextScene } from './index.js';
6
5
  export type SelectActionArgs = {
7
6
  /** The lint results of the project */
@@ -16,5 +15,5 @@ export type SelectActionArgs = {
16
15
  /**
17
16
  * Run the scene where a user select the action to be performed for the problems of selected rules.
18
17
  */
19
- export declare function selectAction(core: Remote<SerializableCore>, { results, ruleIdsInResults, selectedRuleIds, initialAction }: SelectActionArgs): Promise<NextScene>;
18
+ export declare function selectAction(core: Core, { results, ruleIdsInResults, selectedRuleIds, initialAction }: SelectActionArgs): Promise<NextScene>;
20
19
  //# sourceMappingURL=select-action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-action.d.ts","sourceRoot":"","sources":["../../src/scene/select-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,0CAA0C;IAC1C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE,gBAAgB,GAC9E,OAAO,CAAC,SAAS,CAAC,CAkCpB"}
1
+ {"version":3,"file":"select-action.d.ts","sourceRoot":"","sources":["../../src/scene/select-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B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CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC/D,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,cAAc,KAAK,gBAAgB,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,sBAAsB,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC1E,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,cAAc,KAAK,gBAAgB,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,sBAAsB,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC1E,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,cAAc,KAAK,8BAA8B,EAAE,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,oCAAoC,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QACxF,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,4EAA4E;IAC5E,OAAO,WAAW,CAAC,mBAAmB,cAAc,EAAE,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,6 +1,5 @@
1
- import type { Remote } from 'comlink';
2
1
  import type { ESLint } from 'eslint';
3
- import type { SerializableCore } from '../core-worker.js';
2
+ import type { Core } from '../core.js';
4
3
  import type { NextScene } from './index.js';
5
4
  export type SelectRuleIdsArgs = {
6
5
  /** The lint results of the project */
@@ -11,5 +10,5 @@ export type SelectRuleIdsArgs = {
11
10
  /**
12
11
  * Run the scene where a user select rule ids.
13
12
  */
14
- export declare function selectRuleIds(core: Remote<SerializableCore>, { results, ruleIdsInResults }: SelectRuleIdsArgs): Promise<NextScene>;
13
+ export declare function selectRuleIds(core: Core, { results, ruleIdsInResults }: SelectRuleIdsArgs): Promise<NextScene>;
15
14
  //# sourceMappingURL=select-rule-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select-rule-ids.d.ts","sourceRoot":"","sources":["../../src/scene/select-rule-ids.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,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,iBAAiB,GAC/C,OAAO,CAAC,SAAS,CAAC,CAGpB"}
1
+ {"version":3,"file":"select-rule-ids.d.ts","sourceRoot":"","sources":["../../src/scene/select-rule-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAGpH"}
@@ -1 +1 @@
1
- {"version":3,"file":"select-rule-ids.js","sourceRoot":"","sources":["../../src/scene/select-rule-ids.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASlD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAA8B,EAC9B,EAAE,OAAO,EAAE,gBAAgB,EAAqB;IAEhD,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACrE,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC,CAAC;AAC5E,CAAC"}
1
+ {"version":3,"file":"select-rule-ids.js","sourceRoot":"","sources":["../../src/scene/select-rule-ids.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASlD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAU,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAqB;IAC9F,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACrE,OAAO,YAAY,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC,CAAC;AAC5E,CAAC"}
package/dist/type.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ESLint } from 'eslint';
2
2
  export type SortField = 'rule' | 'error' | 'warning' | 'fixable' | 'suggestions';
3
3
  export type SortOrder = 'asc' | 'desc';
4
+ export type FilterCriterion = 'fixable' | 'has-suggestions';
4
5
  /** The config of eslint-interactive */
5
6
  export type Config = ESLint.Options & {
6
7
  patterns: string[];
@@ -8,5 +9,6 @@ export type Config = ESLint.Options & {
8
9
  quiet?: boolean | undefined;
9
10
  sort?: SortField | undefined;
10
11
  sortOrder?: SortOrder | undefined;
12
+ filters?: FilterCriterion[] | undefined;
11
13
  };
12
14
  //# sourceMappingURL=type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AACjF,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,uCAAuC;AACvC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG;IACpC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACnC,CAAC"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AACjF,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,iBAAiB,CAAC;AAE5D,uCAAuC;AACvC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG;IACpC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;CACzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function terminalLink(text: string, url: string): string;
2
+ //# sourceMappingURL=terminal-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-link.d.ts","sourceRoot":"","sources":["../../src/util/terminal-link.ts"],"names":[],"mappings":"AAaA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,16 @@
1
+ const OSC = '\x1B]';
2
+ const BEL = '\x07';
3
+ function buildOsc8Link(text, url) {
4
+ return `${OSC}8;;${url}${BEL}${text}${OSC}8;;${BEL}`;
5
+ }
6
+ function supportsHyperlinks() {
7
+ if (process.env['FORCE_HYPERLINK'] === '1')
8
+ return true;
9
+ if (process.env['FORCE_HYPERLINK'] === '0')
10
+ return false;
11
+ return process.stdout.isTTY;
12
+ }
13
+ export function terminalLink(text, url) {
14
+ return supportsHyperlinks() ? buildOsc8Link(text, url) : text;
15
+ }
16
+ //# sourceMappingURL=terminal-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-link.js","sourceRoot":"","sources":["../../src/util/terminal-link.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC;AACpB,MAAM,GAAG,GAAG,MAAM,CAAC;AAEnB,SAAS,aAAa,CAAC,IAAY,EAAE,GAAW;IAC9C,OAAO,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,MAAM,GAAG,EAAE,CAAC;AACvD,CAAC;AAED,SAAS,kBAAkB;IACzB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,OAAO,kBAAkB,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-interactive",
3
3
  "description": "The CLI tool to run `eslint --fix` for each rule",
4
- "version": "13.0.1",
4
+ "version": "14.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/mizdra/eslint-interactive.git"
@@ -28,22 +28,21 @@
28
28
  "@types/node": "^22.15.3",
29
29
  "dedent": "^1.5.3",
30
30
  "eslint": "^10.0.1",
31
+ "eslint-v10": "npm:eslint@^10.0.1",
32
+ "eslint-v9": "npm:eslint@^9.39.4",
31
33
  "prettier": "3.5.3",
32
34
  "stream-match": "^4.1.0",
33
35
  "typescript": "^5.8.3",
34
36
  "vitest": "^2.1.1"
35
37
  },
36
38
  "dependencies": {
37
- "comlink": "^4.4.1",
38
- "enquirer": "^2.4.1",
39
- "nanospinner": "^1.2.2",
40
- "terminal-link": "^3.0.0"
39
+ "@clack/prompts": "^1.3.0"
41
40
  },
42
41
  "peerDependencies": {
43
42
  "eslint": ">=9.0.0"
44
43
  },
45
44
  "engines": {
46
- "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
45
+ "node": "^22.12.0 || >=24.0.0"
47
46
  },
48
47
  "publishConfig": {
49
48
  "access": "public",
@@ -1,17 +1,15 @@
1
- import type { Remote } from 'comlink';
2
1
  import type { ESLint } from 'eslint';
2
+ import { withProgress } from '../cli/log.js';
3
3
  import { promptToInputDescription } from '../cli/prompt.js';
4
- import { fixingSpinner } from '../cli/spinner.js';
5
- import type { Undo } from '../core.js';
6
- import type { SerializableCore } from '../core-worker.js';
4
+ import type { Core, Undo } from '../core.js';
7
5
 
8
6
  export async function doConvertErrorToWarningPerFileAction(
9
- core: Remote<SerializableCore>,
7
+ core: Core,
10
8
  results: ESLint.LintResult[],
11
9
  selectedRuleIds: string[],
12
10
  ): Promise<Undo> {
13
11
  const description = await promptToInputDescription();
14
- const undo = await fixingSpinner(async () =>
12
+ const undo = await withProgress('Fixing', async () =>
15
13
  core.convertErrorToWarningPerFile(results, selectedRuleIds, description),
16
14
  );
17
15
  return undo;
@@ -1,13 +1,11 @@
1
- import type { Remote } from 'comlink';
2
1
  import type { ESLint } from 'eslint';
2
+ import { withProgress } from '../cli/log.js';
3
3
  import type { DescriptionPosition } from '../cli/prompt.js';
4
4
  import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.js';
5
- import { fixingSpinner } from '../cli/spinner.js';
6
- import type { Undo } from '../core.js';
7
- import type { SerializableCore } from '../core-worker.js';
5
+ import type { Core, Undo } from '../core.js';
8
6
 
9
7
  export async function doDisablePerFileAction(
10
- core: Remote<SerializableCore>,
8
+ core: Core,
11
9
  results: ESLint.LintResult[],
12
10
  selectedRuleIds: string[],
13
11
  ): Promise<Undo> {
@@ -16,7 +14,7 @@ export async function doDisablePerFileAction(
16
14
  if (description) {
17
15
  descriptionPosition = await promptToInputDescriptionPosition();
18
16
  }
19
- const undo = await fixingSpinner(async () =>
17
+ const undo = await withProgress('Fixing', async () =>
20
18
  core.disablePerFile(results, selectedRuleIds, description, descriptionPosition),
21
19
  );
22
20
  return undo;
@@ -1,13 +1,11 @@
1
- import type { Remote } from 'comlink';
2
1
  import type { ESLint } from 'eslint';
2
+ import { withProgress } from '../cli/log.js';
3
3
  import type { DescriptionPosition } from '../cli/prompt.js';
4
4
  import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.js';
5
- import { fixingSpinner } from '../cli/spinner.js';
6
- import type { Undo } from '../core.js';
7
- import type { SerializableCore } from '../core-worker.js';
5
+ import type { Core, Undo } from '../core.js';
8
6
 
9
7
  export async function doDisablePerLineAction(
10
- core: Remote<SerializableCore>,
8
+ core: Core,
11
9
  results: ESLint.LintResult[],
12
10
  selectedRuleIds: string[],
13
11
  ): Promise<Undo> {
@@ -16,7 +14,7 @@ export async function doDisablePerLineAction(
16
14
  if (description) {
17
15
  descriptionPosition = await promptToInputDescriptionPosition();
18
16
  }
19
- const undo = await fixingSpinner(async () =>
17
+ const undo = await withProgress('Fixing', async () =>
20
18
  core.disablePerLine(results, selectedRuleIds, description, descriptionPosition),
21
19
  );
22
20
  return undo;
package/src/action/fix.ts CHANGED
@@ -1,14 +1,8 @@
1
- import type { Remote } from 'comlink';
2
1
  import type { ESLint } from 'eslint';
3
- import { fixingSpinner } from '../cli/spinner.js';
4
- import type { Undo } from '../core.js';
5
- import type { SerializableCore } from '../core-worker.js';
2
+ import { withProgress } from '../cli/log.js';
3
+ import type { Core, Undo } from '../core.js';
6
4
 
7
- export async function doFixAction(
8
- core: Remote<SerializableCore>,
9
- results: ESLint.LintResult[],
10
- selectedRuleIds: string[],
11
- ): Promise<Undo> {
12
- const undo = await fixingSpinner(async () => core.applyAutoFixes(results, selectedRuleIds));
5
+ export async function doFixAction(core: Core, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo> {
6
+ const undo = await withProgress('Fixing', async () => core.applyAutoFixes(results, selectedRuleIds));
13
7
  return undo;
14
8
  }
@@ -4,23 +4,19 @@ import { tmpdir } from 'node:os';
4
4
  import { join } from 'node:path';
5
5
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
6
6
  import { stripVTControlCharacters, styleText } from 'node:util';
7
- import type { Remote } from 'comlink';
7
+ import { log } from '@clack/prompts';
8
8
  import type { ESLint } from 'eslint';
9
9
  import { VERSION } from '../cli/package.js';
10
10
  import { pager } from '../cli/pager.js';
11
11
  import { promptToInputDisplayMode } from '../cli/prompt.js';
12
- import type { SerializableCore } from '../core-worker.js';
12
+ import type { Core } from '../core.js';
13
13
  import { unreachable } from '../util/type-check.js';
14
14
 
15
- export async function doPrintResultDetailsAction(
16
- core: Remote<SerializableCore>,
17
- results: ESLint.LintResult[],
18
- selectedRuleIds: string[],
19
- ) {
15
+ export async function doPrintResultDetailsAction(core: Core, results: ESLint.LintResult[], selectedRuleIds: string[]) {
20
16
  const displayMode = await promptToInputDisplayMode();
21
17
  const formattedResultDetails = await core.formatResultDetails(results, selectedRuleIds);
22
18
  if (displayMode === 'printInTerminal') {
23
- console.log(formattedResultDetails);
19
+ log.message(formattedResultDetails);
24
20
  } else if (displayMode === 'printInTerminalWithPager') {
25
21
  await pager(formattedResultDetails);
26
22
  } else if (displayMode === 'writeToFile') {
@@ -28,7 +24,7 @@ export async function doPrintResultDetailsAction(
28
24
  const filePath = join(tempDir, 'lint-result-details.txt');
29
25
  await mkdir(tempDir, { recursive: true }); // Create the directory because it might not exist
30
26
  await writeFile(filePath, stripVTControlCharacters(formattedResultDetails), 'utf8');
31
- console.log(styleText('cyan', `Wrote to ${filePath}`));
27
+ log.message(styleText('cyan', `Wrote to ${filePath}`));
32
28
  } else {
33
29
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
34
30
  unreachable(`Unknown display mode: ${displayMode}`);
package/src/cli/log.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // eslint-disable-next-line n/no-unsupported-features/node-builtins
2
2
  import { styleText } from 'node:util';
3
+ import { taskLog } from '@clack/prompts';
3
4
 
4
5
  /**
5
6
  * Log an error message to stderr
@@ -8,3 +9,27 @@ import { styleText } from 'node:util';
8
9
  export function error(message: string) {
9
10
  process.stderr.write(styleText('red', 'Error') + ': ' + message + '\n');
10
11
  }
12
+
13
+ export async function withProgress<T>(taskName: 'Linting' | 'Fixing' | 'Undoing', cb: () => Promise<T>): Promise<T> {
14
+ const log = taskLog({
15
+ title: `${taskName}...`,
16
+ });
17
+ startProgress();
18
+ try {
19
+ const result = await cb();
20
+ log.success(`${taskName} completed.`);
21
+ return result;
22
+ } finally {
23
+ endProgress();
24
+ }
25
+ }
26
+
27
+ function startProgress(): void {
28
+ if (!process.stdout.isTTY) return;
29
+ process.stdout.write('\x1b]9;4;3\x07');
30
+ }
31
+
32
+ function endProgress(): void {
33
+ if (!process.stdout.isTTY) return;
34
+ process.stdout.write('\x1b]9;4;0\x07');
35
+ }
@@ -1,9 +1,10 @@
1
1
  import { parseArgs } from 'node:util';
2
- import type { Config, SortField, SortOrder } from '../type.js';
2
+ import type { Config, FilterCriterion, SortField, SortOrder } from '../type.js';
3
3
  import { VERSION } from './package.js';
4
4
 
5
5
  const VALID_SORT_FIELDS: readonly SortField[] = ['rule', 'error', 'warning', 'fixable', 'suggestions'];
6
6
  const VALID_SORT_ORDERS: readonly SortOrder[] = ['asc', 'desc'];
7
+ const VALID_FILTER_CRITERIA: readonly FilterCriterion[] = ['fixable', 'has-suggestions'];
7
8
 
8
9
  /** Parse CLI options */
9
10
  export function parseArgv(argv: string[]): Config {
@@ -11,6 +12,8 @@ export function parseArgv(argv: string[]): Config {
11
12
  'config': { type: 'string', short: 'c' },
12
13
  'format': { type: 'string' },
13
14
  'quiet': { type: 'boolean' },
15
+ 'ignore-pattern': { type: 'string', multiple: true },
16
+ 'ignore': { type: 'boolean' },
14
17
  'cache': { type: 'boolean' },
15
18
  'cache-location': { type: 'string' },
16
19
  'version': { type: 'boolean' },
@@ -18,6 +21,7 @@ export function parseArgv(argv: string[]): Config {
18
21
  'flag': { type: 'string', multiple: true },
19
22
  'sort': { type: 'string' },
20
23
  'sort-order': { type: 'string' },
24
+ 'filter': { type: 'string', multiple: true },
21
25
  } as const;
22
26
 
23
27
  const { values, positionals } = parseArgs({
@@ -41,6 +45,15 @@ export function parseArgv(argv: string[]): Config {
41
45
  // eslint-disable-next-line n/no-process-exit
42
46
  process.exit(1);
43
47
  }
48
+ if (values.filter !== undefined) {
49
+ for (const filter of values.filter) {
50
+ if (!VALID_FILTER_CRITERIA.includes(filter as FilterCriterion)) {
51
+ console.error(`Invalid --filter value: "${filter}". Must be one of: ${VALID_FILTER_CRITERIA.join(', ')}`);
52
+ // eslint-disable-next-line n/no-process-exit
53
+ process.exit(1);
54
+ }
55
+ }
56
+ }
44
57
 
45
58
  if (values.version) {
46
59
  console.log(VERSION);
@@ -54,16 +67,20 @@ export function parseArgv(argv: string[]): Config {
54
67
  eslint-interactive [...patterns]
55
68
 
56
69
  Options:
57
- --help Show help
58
- --version Show version number
59
- -c, --config <path> Use this configuration, overriding config options if present
60
- --format <nameOrPath> Specify the format to be used for the "Display problem messages" action
61
- --quiet Report errors only
62
- --cache Only check changed files
63
- --cache-location <path> Path to the cache file or directory
64
- --flag <name> Enable a feature flag (requires ESLint v9.6.0+)
65
- --sort <field> Sort rules by: rule, error, warning, fixable, suggestions
66
- --sort-order <direction> Sort direction: asc, desc (default: desc for counts, asc for rule)
70
+ --help Show help
71
+ --version Show version number
72
+ -c, --config <path> Use this configuration, overriding config options if present
73
+ --format <nameOrPath> Specify the format to be used for the "Display problem messages" action
74
+ --quiet Report errors only
75
+ --ignore-pattern <string> Patterns of files to ignore
76
+ --no-ignore Disable use of ignore files and patterns
77
+ --cache Only check changed files
78
+ --cache-location <path> Path to the cache file or directory
79
+ --flag <name> Enable a feature flag (requires ESLint v9.6.0+)
80
+ --sort <field> Sort rules by: rule, error, warning, fixable, suggestions
81
+ --sort-order <direction> Sort direction: asc, desc (default: desc for counts, asc for rule)
82
+ --filter <criterion> Show only rules matching the criterion: fixable, has-suggestions
83
+ (repeatable; multiple values are OR-ed)
67
84
 
68
85
  Examples:
69
86
  eslint-interactive Lint all files in the project
@@ -71,6 +88,7 @@ Examples:
71
88
  eslint-interactive 'src/**/*.{ts,tsx,vue}' Lint with glob pattern
72
89
  eslint-interactive --sort error Sort rules by error count (descending)
73
90
  eslint-interactive --sort rule Sort rules by rule name (ascending)
91
+ eslint-interactive --filter fixable Show only rules that have fixable problems
74
92
  `.trim(),
75
93
  );
76
94
  // eslint-disable-next-line n/no-process-exit
@@ -84,11 +102,14 @@ Examples:
84
102
  patterns,
85
103
  formatterName,
86
104
  quiet: values.quiet,
105
+ ignorePatterns: values['ignore-pattern'],
106
+ ignore: values.ignore,
87
107
  overrideConfigFile: values.config,
88
108
  cache: values.cache,
89
109
  cacheLocation: values['cache-location'],
90
110
  flags: values.flag,
91
111
  sort: values.sort as SortField | undefined,
92
112
  sortOrder: values['sort-order'] as SortOrder | undefined,
113
+ filters: values.filter as FilterCriterion[] | undefined,
93
114
  };
94
115
  }