eslint-interactive 11.0.3 → 12.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.
- package/README.md +10 -9
- package/bin/eslint-interactive.js +1 -5
- package/dist/action/apply-suggestions.d.ts +4 -4
- package/dist/action/apply-suggestions.d.ts.map +1 -1
- package/dist/action/apply-suggestions.js +2 -3
- package/dist/action/apply-suggestions.js.map +1 -1
- package/dist/action/convert-error-to-warning-per-file.d.ts +4 -4
- package/dist/action/convert-error-to-warning-per-file.d.ts.map +1 -1
- package/dist/action/convert-error-to-warning-per-file.js +1 -1
- package/dist/action/convert-error-to-warning-per-file.js.map +1 -1
- package/dist/action/disable-per-file.d.ts +4 -4
- package/dist/action/disable-per-file.d.ts.map +1 -1
- package/dist/action/disable-per-file.js +1 -1
- package/dist/action/disable-per-file.js.map +1 -1
- package/dist/action/disable-per-line.d.ts +4 -4
- package/dist/action/disable-per-line.d.ts.map +1 -1
- package/dist/action/disable-per-line.js +1 -1
- package/dist/action/disable-per-line.js.map +1 -1
- package/dist/action/fix.d.ts +4 -4
- package/dist/action/fix.d.ts.map +1 -1
- package/dist/action/fix.js +1 -1
- package/dist/action/fix.js.map +1 -1
- package/dist/action/make-fixable-and-fix.d.ts +4 -4
- package/dist/action/make-fixable-and-fix.d.ts.map +1 -1
- package/dist/action/make-fixable-and-fix.js +2 -3
- package/dist/action/make-fixable-and-fix.js.map +1 -1
- package/dist/action/print-result-details.d.ts +3 -3
- package/dist/action/print-result-details.d.ts.map +1 -1
- package/dist/action/print-result-details.js +8 -6
- package/dist/action/print-result-details.js.map +1 -1
- package/dist/cli/log.d.ts.map +1 -1
- package/dist/cli/log.js +2 -2
- package/dist/cli/log.js.map +1 -1
- package/dist/cli/package.js +1 -1
- package/dist/cli/package.js.map +1 -1
- package/dist/cli/pager.d.ts.map +1 -1
- package/dist/cli/pager.js +26 -26
- package/dist/cli/pager.js.map +1 -1
- package/dist/cli/parse-argv.d.ts +2 -2
- package/dist/cli/parse-argv.d.ts.map +1 -1
- package/dist/cli/parse-argv.js +72 -86
- package/dist/cli/parse-argv.js.map +1 -1
- package/dist/cli/prompt.d.ts +1 -1
- package/dist/cli/prompt.d.ts.map +1 -1
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +4 -4
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/{ora.d.ts → spinner.d.ts} +1 -1
- package/dist/cli/spinner.d.ts.map +1 -0
- package/dist/cli/spinner.js +20 -0
- package/dist/cli/spinner.js.map +1 -0
- package/dist/config.d.ts +7 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -1
- package/dist/config.js.map +1 -1
- package/dist/core-worker.d.ts +2 -2
- package/dist/core-worker.d.ts.map +1 -1
- package/dist/core-worker.js +0 -1
- package/dist/core-worker.js.map +1 -1
- package/dist/core.d.ts +13 -13
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +37 -31
- package/dist/core.js.map +1 -1
- package/dist/eslint/linter.d.ts +4 -3
- package/dist/eslint/linter.d.ts.map +1 -1
- package/dist/eslint/linter.js +9 -5
- package/dist/eslint/linter.js.map +1 -1
- package/dist/eslint/report-translator.d.ts +1 -1
- package/dist/eslint/report-translator.d.ts.map +1 -1
- package/dist/eslint/report-translator.js +0 -2
- package/dist/eslint/report-translator.js.map +1 -1
- package/dist/eslint/rule-fixer.d.ts +1 -1
- package/dist/eslint/rule-fixer.d.ts.map +1 -1
- package/dist/eslint/rule-fixer.js +0 -4
- package/dist/eslint/rule-fixer.js.map +1 -1
- package/dist/eslint/source-code-fixer.d.ts +1 -1
- package/dist/eslint/source-code-fixer.d.ts.map +1 -1
- package/dist/eslint/source-code-fixer.js.map +1 -1
- package/dist/eslint/use-at-your-own-risk.d.ts +5 -0
- package/dist/eslint/use-at-your-own-risk.d.ts.map +1 -0
- package/dist/eslint/use-at-your-own-risk.js +6 -0
- package/dist/eslint/use-at-your-own-risk.js.map +1 -0
- package/dist/fix/apply-auto-fixes.d.ts +2 -2
- package/dist/fix/apply-auto-fixes.d.ts.map +1 -1
- package/dist/fix/apply-suggestions.d.ts +2 -2
- package/dist/fix/apply-suggestions.d.ts.map +1 -1
- package/dist/fix/apply-suggestions.js.map +1 -1
- package/dist/fix/convert-error-to-warning-per-file.d.ts +2 -2
- package/dist/fix/convert-error-to-warning-per-file.d.ts.map +1 -1
- package/dist/fix/disable-per-file.d.ts +3 -3
- package/dist/fix/disable-per-file.d.ts.map +1 -1
- package/dist/fix/disable-per-file.js +7 -7
- package/dist/fix/disable-per-file.js.map +1 -1
- package/dist/fix/disable-per-line.d.ts +3 -3
- package/dist/fix/disable-per-line.d.ts.map +1 -1
- package/dist/fix/disable-per-line.js +18 -7
- package/dist/fix/disable-per-line.js.map +1 -1
- package/dist/fix/index.d.ts +1 -1
- package/dist/fix/index.d.ts.map +1 -1
- package/dist/fix/make-fixable-and-fix.d.ts +2 -2
- package/dist/fix/make-fixable-and-fix.d.ts.map +1 -1
- package/dist/fix/make-fixable-and-fix.js +2 -0
- package/dist/fix/make-fixable-and-fix.js.map +1 -1
- package/dist/formatter/colors.d.ts.map +1 -1
- package/dist/formatter/format-by-files.d.ts +1 -1
- package/dist/formatter/format-by-files.d.ts.map +1 -1
- package/dist/formatter/format-by-files.js +5 -5
- package/dist/formatter/format-by-files.js.map +1 -1
- package/dist/formatter/format-by-rules.d.ts +1 -1
- package/dist/formatter/format-by-rules.d.ts.map +1 -1
- package/dist/formatter/format-by-rules.js +7 -20
- package/dist/formatter/format-by-rules.js.map +1 -1
- package/dist/formatter/format-table.d.ts +4 -0
- package/dist/formatter/format-table.d.ts.map +1 -0
- package/dist/formatter/format-table.js +62 -0
- package/dist/formatter/format-table.js.map +1 -0
- package/dist/formatter/index.d.ts +1 -1
- package/dist/formatter/index.d.ts.map +1 -1
- package/dist/formatter/take-rule-statistics.d.ts +1 -1
- package/dist/formatter/take-rule-statistics.d.ts.map +1 -1
- package/dist/formatter/take-rule-statistics.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +4 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +73 -0
- package/dist/plugin.js.map +1 -0
- package/dist/scene/check-results.d.ts +4 -4
- package/dist/scene/check-results.d.ts.map +1 -1
- package/dist/scene/check-results.js +1 -1
- package/dist/scene/check-results.js.map +1 -1
- package/dist/scene/index.d.ts +1 -1
- package/dist/scene/index.d.ts.map +1 -1
- package/dist/scene/lint.d.ts +3 -3
- package/dist/scene/lint.d.ts.map +1 -1
- package/dist/scene/lint.js +1 -1
- package/dist/scene/lint.js.map +1 -1
- package/dist/scene/select-action.d.ts +5 -5
- package/dist/scene/select-action.d.ts.map +1 -1
- package/dist/scene/select-action.js.map +1 -1
- package/dist/scene/select-rule-ids.d.ts +4 -4
- package/dist/scene/select-rule-ids.d.ts.map +1 -1
- package/dist/scene/select-rule-ids.js.map +1 -1
- package/dist/util/array.js.map +1 -1
- package/dist/util/eslint.d.ts +5 -1
- package/dist/util/eslint.d.ts.map +1 -1
- package/dist/util/eslint.js +23 -4
- package/dist/util/eslint.js.map +1 -1
- package/dist/util/file-system.d.ts +5 -0
- package/dist/util/file-system.d.ts.map +1 -0
- package/dist/util/file-system.js +10 -0
- package/dist/util/file-system.js.map +1 -0
- package/dist/util/filter-script.js +4 -4
- package/dist/util/filter-script.js.map +1 -1
- package/package.json +20 -35
- package/src/action/apply-suggestions.ts +6 -7
- package/src/action/convert-error-to-warning-per-file.ts +5 -5
- package/src/action/disable-per-file.ts +7 -6
- package/src/action/disable-per-line.ts +7 -6
- package/src/action/fix.ts +5 -5
- package/src/action/make-fixable-and-fix.ts +6 -7
- package/src/action/print-result-details.ts +11 -9
- package/src/cli/log.ts +2 -4
- package/src/cli/package.ts +1 -1
- package/src/cli/pager.ts +24 -26
- package/src/cli/parse-argv.ts +79 -87
- package/src/cli/prompt.ts +1 -1
- package/src/cli/run.ts +6 -6
- package/src/cli/spinner.ts +22 -0
- package/src/config.ts +18 -7
- package/src/core-worker.ts +3 -3
- package/src/core.ts +53 -58
- package/src/eslint/linter.ts +14 -10
- package/src/eslint/report-translator.ts +3 -3
- package/src/eslint/rule-fixer.ts +1 -5
- package/src/eslint/source-code-fixer.ts +1 -1
- package/src/eslint/use-at-your-own-risk.js +6 -0
- package/src/fix/apply-auto-fixes.ts +3 -3
- package/src/fix/apply-suggestions.ts +2 -2
- package/src/fix/convert-error-to-warning-per-file.ts +2 -2
- package/src/fix/disable-per-file.ts +13 -11
- package/src/fix/disable-per-line.ts +23 -9
- package/src/fix/index.ts +1 -1
- package/src/fix/make-fixable-and-fix.ts +4 -2
- package/src/formatter/format-by-files.ts +6 -6
- package/src/formatter/format-by-rules.ts +9 -25
- package/src/formatter/format-table.ts +71 -0
- package/src/formatter/index.ts +1 -1
- package/src/formatter/take-rule-statistics.ts +1 -1
- package/src/plugin.ts +71 -0
- package/src/scene/check-results.ts +6 -5
- package/src/scene/index.ts +1 -1
- package/src/scene/lint.ts +4 -4
- package/src/scene/select-action.ts +7 -6
- package/src/scene/select-rule-ids.ts +4 -4
- package/src/typings/estree.d.ts +1 -1
- package/src/typings/stream-match.d.ts +0 -1
- package/src/util/eslint.ts +28 -5
- package/src/util/file-system.ts +10 -0
- package/src/util/filter-script.ts +4 -4
- package/dist/cli/ora.d.ts.map +0 -1
- package/dist/cli/ora.js +0 -23
- package/dist/cli/ora.js.map +0 -1
- package/dist/util/cache.d.ts +0 -5
- package/dist/util/cache.d.ts.map +0 -1
- package/dist/util/cache.js +0 -15
- package/dist/util/cache.js.map +0 -1
- package/src/cli/ora.ts +0 -25
- package/src/util/cache.ts +0 -15
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ It also supports the following actions in addition to `eslint --fix`. All action
|
|
|
40
40
|
|
|
41
41
|
## Requirements
|
|
42
42
|
|
|
43
|
-
- Node.js
|
|
43
|
+
- Node.js `^20.19.0 || >=22.12.0`
|
|
44
44
|
- ESLint `>=8.45.0`
|
|
45
45
|
- If you use ESLint `<8.45.0`, use `eslint-interactive@^10`.
|
|
46
46
|
|
|
@@ -80,11 +80,12 @@ Options:
|
|
|
80
80
|
--ext Specify JavaScript file extensions [array]
|
|
81
81
|
--rulesdir Use additional rules from this directory [array]
|
|
82
82
|
--ignore-path Specify path of ignore file [string]
|
|
83
|
-
--format Specify the format to be used for the `Display problem messages` action
|
|
83
|
+
--format Specify the format to be used for the `Display problem messages` action [string] [default: "stylish"]
|
|
84
84
|
--quiet Report errors only [boolean] [default: false]
|
|
85
|
-
--cache Only check changed files
|
|
86
|
-
--cache-location Path to the cache file or directory
|
|
87
|
-
|
|
85
|
+
--cache Only check changed files [boolean] [default: false]
|
|
86
|
+
--cache-location Path to the cache file or directory [string]
|
|
87
|
+
--flag Enable a feature flag (requires ESLint v9.6.0+) [array]
|
|
88
|
+
|
|
88
89
|
|
|
89
90
|
Examples:
|
|
90
91
|
eslint-interactive ./src Lint ./src/ directory
|
|
@@ -123,6 +124,10 @@ Actions can be executed per rule.
|
|
|
123
124
|
|
|
124
125
|
See [Programmable API documentation](./docs/programmable-api.md).
|
|
125
126
|
|
|
127
|
+
## Playground
|
|
128
|
+
|
|
129
|
+
https://stackblitz.com/edit/eslint-interactive-playground?file=src%2Findex.ts&view=editor
|
|
130
|
+
|
|
126
131
|
## FAQ
|
|
127
132
|
|
|
128
133
|
### What's _suggestions_?
|
|
@@ -158,7 +163,3 @@ Thanks, [@IanVS](https://github.com/IanVS).
|
|
|
158
163
|
`suppress-eslint-errors` uses [`jscodeshift`](https://github.com/facebook/jscodeshift) to insert comments. `jscodeshift` modifies the file in parallel, so `suppress-eslint-errors` has the advantage of being able to insert comments faster. However, `jscodeshift` cannot reuse the AST of ESLint, so you need to reparse the code in `jscodeshift`. This means that you have to pass `jscodeshift` the information it needs to parse your code (parser type, parser options). In fact, `suppress-eslint-errors` requires `--extensions` and `--parser` command line option. Normally, users specify the parsing options in `.eslintrc`, so passing these options may seem cumbersome. Also, due to the difference in the way ESLint and `jscodeshift` parse, it may not be possible to insert comments correctly.
|
|
159
164
|
|
|
160
165
|
On the other hand, `eslint-interactive` uses [`ESLint.outputFixes`](https://eslint.org/docs/developer-guide/nodejs-api#-eslintoutputfixesresults) to insert comments. It uses ESLint's API to do everything from parsing the code to inserting the comments, so it works as expected in many cases. Also, `eslint-interactive` will parse the code using the parsing options specified in `.eslintrc`. Therefore, comments can be inserted without any additional command line options. By the way, comment insertion is slower than `suppress-eslint-errors` because, unlike `suppress-eslint-errors`, it cannot modify files in parallel. However, this limitation may be improved when ESLint supports parallel processing in the near future.
|
|
161
|
-
|
|
162
|
-
## Benchmark
|
|
163
|
-
|
|
164
|
-
- https://mizdra.github.io/eslint-interactive/dev/bench/
|
|
@@ -10,8 +10,4 @@ const dir = join(dirname(fileURLToPath(import.meta.url)));
|
|
|
10
10
|
|
|
11
11
|
const scriptFile = resolve(dir, '_eslint-interactive.js');
|
|
12
12
|
|
|
13
|
-
spawnSync(
|
|
14
|
-
'node',
|
|
15
|
-
['--unhandled-rejections=strict', '--experimental-import-meta-resolve', scriptFile, ...process.argv.slice(2)],
|
|
16
|
-
{ stdio: 'inherit' },
|
|
17
|
-
);
|
|
13
|
+
spawnSync('node', ['--unhandled-rejections=strict', scriptFile, ...process.argv.slice(2)], { stdio: 'inherit' });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
5
|
export declare function doApplySuggestionsAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
6
|
//# sourceMappingURL=apply-suggestions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-suggestions.d.ts","sourceRoot":"","sources":["../../src/action/apply-suggestions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"apply-suggestions.d.ts","sourceRoot":"","sources":["../../src/action/apply-suggestions.ts"],"names":[],"mappings":"AAEA,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;AAO1D,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
|
-
import { fixingSpinner } from '../cli/ora.js';
|
|
4
3
|
import { promptToInputReuseFilterScript } from '../cli/prompt.js';
|
|
4
|
+
import { fixingSpinner } from '../cli/spinner.js';
|
|
5
5
|
import { editFileWithEditor, generateExampleFilterScriptFilePath, generateFilterScriptFilePath, } from '../util/filter-script.js';
|
|
6
6
|
export async function doApplySuggestionsAction(core, results, selectedRuleIds) {
|
|
7
7
|
const exampleScript = await readFile(generateExampleFilterScriptFilePath(), 'utf8');
|
|
@@ -16,8 +16,7 @@ export async function doApplySuggestionsAction(core, results, selectedRuleIds) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
//
|
|
20
|
-
await mkdir(dirname(filterScriptFilePath), { recursive: true });
|
|
19
|
+
await mkdir(dirname(filterScriptFilePath), { recursive: true }); // Create the directory because it might not exist
|
|
21
20
|
await writeFile(filterScriptFilePath, exampleScript);
|
|
22
21
|
}
|
|
23
22
|
console.log('Opening editor...');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-suggestions.js","sourceRoot":"","sources":["../../src/action/apply-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"apply-suggestions.js","sourceRoot":"","sources":["../../src/action/apply-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EACL,kBAAkB,EAClB,mCAAmC,EACnC,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,mCAAmC,EAAE,EAAE,MAAM,CAAC,CAAC;IACpF,MAAM,oBAAoB,GAAG,4BAA4B,CAAC,eAAe,CAAC,CAAC;IAC3E,MAAM,mBAAmB,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC;SAC3D,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;SAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,IAAI,mBAAmB,EAAE,CAAC;QACxB,MAAM,iBAAiB,GAAG,MAAM,8BAA8B,EAAE,CAAC;QACjE,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,MAAM,SAAS,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,kDAAkD;QACnH,MAAM,SAAS,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAEjC,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;IAC5G,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
5
|
export declare function doConvertErrorToWarningPerFileAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
6
|
//# sourceMappingURL=convert-error-to-warning-per-file.d.ts.map
|
|
@@ -1 +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,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fixingSpinner } from '../cli/ora.js';
|
|
2
1
|
import { promptToInputDescription } from '../cli/prompt.js';
|
|
2
|
+
import { fixingSpinner } from '../cli/spinner.js';
|
|
3
3
|
export async function doConvertErrorToWarningPerFileAction(core, results, selectedRuleIds) {
|
|
4
4
|
const description = await promptToInputDescription();
|
|
5
5
|
const undo = await fixingSpinner(async () => core.convertErrorToWarningPerFile(results, selectedRuleIds, description));
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
5
|
export declare function doDisablePerFileAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
6
|
//# sourceMappingURL=disable-per-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable-per-file.d.ts","sourceRoot":"","sources":["../../src/action/disable-per-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fixingSpinner } from '../cli/ora.js';
|
|
2
1
|
import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.js';
|
|
2
|
+
import { fixingSpinner } from '../cli/spinner.js';
|
|
3
3
|
export async function doDisablePerFileAction(core, results, selectedRuleIds) {
|
|
4
4
|
const description = await promptToInputDescription();
|
|
5
5
|
let descriptionPosition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable-per-file.js","sourceRoot":"","sources":["../../src/action/disable-per-file.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
5
|
export declare function doDisablePerLineAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
6
|
//# sourceMappingURL=disable-per-line.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable-per-line.d.ts","sourceRoot":"","sources":["../../src/action/disable-per-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fixingSpinner } from '../cli/ora.js';
|
|
2
1
|
import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.js';
|
|
2
|
+
import { fixingSpinner } from '../cli/spinner.js';
|
|
3
3
|
export async function doDisablePerLineAction(core, results, selectedRuleIds) {
|
|
4
4
|
const description = await promptToInputDescription();
|
|
5
5
|
let descriptionPosition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disable-per-line.js","sourceRoot":"","sources":["../../src/action/disable-per-line.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/action/fix.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
5
|
export declare function doFixAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
6
|
//# sourceMappingURL=fix.d.ts.map
|
package/dist/action/fix.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.d.ts","sourceRoot":"","sources":["../../src/action/fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
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"}
|
package/dist/action/fix.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fixingSpinner } from '../cli/
|
|
1
|
+
import { fixingSpinner } from '../cli/spinner.js';
|
|
2
2
|
export async function doFixAction(core, results, selectedRuleIds) {
|
|
3
3
|
const undo = await fixingSpinner(async () => core.applyAutoFixes(results, selectedRuleIds));
|
|
4
4
|
return undo;
|
package/dist/action/fix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.js","sourceRoot":"","sources":["../../src/action/fix.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
5
|
export declare function doMakeFixableAndFixAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
6
|
//# sourceMappingURL=make-fixable-and-fix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-fixable-and-fix.d.ts","sourceRoot":"","sources":["../../src/action/make-fixable-and-fix.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"make-fixable-and-fix.d.ts","sourceRoot":"","sources":["../../src/action/make-fixable-and-fix.ts"],"names":[],"mappings":"AAEA,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;AAO1D,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
|
-
import { fixingSpinner } from '../cli/ora.js';
|
|
4
3
|
import { promptToInputReuseScript } from '../cli/prompt.js';
|
|
4
|
+
import { fixingSpinner } from '../cli/spinner.js';
|
|
5
5
|
import { editFileWithEditor, generateExampleFixableMakerScriptFilePath, generateFixableMakerScriptFilePath, } from '../util/filter-script.js';
|
|
6
6
|
export async function doMakeFixableAndFixAction(core, results, selectedRuleIds) {
|
|
7
7
|
const exampleScript = await readFile(generateExampleFixableMakerScriptFilePath(), 'utf8');
|
|
@@ -16,8 +16,7 @@ export async function doMakeFixableAndFixAction(core, results, selectedRuleIds)
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
//
|
|
20
|
-
await mkdir(dirname(fixableMakerScriptFilePath), { recursive: true });
|
|
19
|
+
await mkdir(dirname(fixableMakerScriptFilePath), { recursive: true }); // Create the directory because it might not exist
|
|
21
20
|
await writeFile(fixableMakerScriptFilePath, exampleScript);
|
|
22
21
|
}
|
|
23
22
|
console.log('Opening editor...');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-fixable-and-fix.js","sourceRoot":"","sources":["../../src/action/make-fixable-and-fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"make-fixable-and-fix.js","sourceRoot":"","sources":["../../src/action/make-fixable-and-fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EACL,kBAAkB,EAClB,yCAAyC,EACzC,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,yCAAyC,EAAE,EAAE,MAAM,CAAC,CAAC;IAC1F,MAAM,0BAA0B,GAAG,kCAAkC,CAAC,eAAe,CAAC,CAAC;IACvF,MAAM,yBAAyB,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC;SACvE,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;SAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;IACtB,IAAI,yBAAyB,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,wBAAwB,EAAE,CAAC;QACrD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,SAAS,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,kDAAkD;QACzH,MAAM,SAAS,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAEjC,MAAM,kBAAkB,GAAG,MAAM,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;IAChF,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACnH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Remote } from 'comlink';
|
|
2
|
-
import { ESLint } from 'eslint';
|
|
3
|
-
import { SerializableCore } from '../core-worker.js';
|
|
1
|
+
import type { Remote } from 'comlink';
|
|
2
|
+
import type { ESLint } from 'eslint';
|
|
3
|
+
import type { SerializableCore } from '../core-worker.js';
|
|
4
4
|
export declare function doPrintResultDetailsAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=print-result-details.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-result-details.d.ts","sourceRoot":"","sources":["../../src/action/print-result-details.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"print-result-details.d.ts","sourceRoot":"","sources":["../../src/action/print-result-details.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,iBAkB1B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import { mkdir } from 'node:fs/promises';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
|
-
import
|
|
4
|
-
import stripAnsi from 'strip-ansi';
|
|
4
|
+
import { stripVTControlCharacters, styleText } from 'node:util';
|
|
5
5
|
import { pager } from '../cli/pager.js';
|
|
6
6
|
import { promptToInputDisplayMode } from '../cli/prompt.js';
|
|
7
|
-
import {
|
|
7
|
+
import { getTempDir } from '../util/file-system.js';
|
|
8
8
|
import { unreachable } from '../util/type-check.js';
|
|
9
9
|
export async function doPrintResultDetailsAction(core, results, selectedRuleIds) {
|
|
10
10
|
const displayMode = await promptToInputDisplayMode();
|
|
@@ -16,9 +16,11 @@ export async function doPrintResultDetailsAction(core, results, selectedRuleIds)
|
|
|
16
16
|
await pager(formattedResultDetails);
|
|
17
17
|
}
|
|
18
18
|
else if (displayMode === 'writeToFile') {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const tempDir = getTempDir();
|
|
20
|
+
const filePath = join(tempDir, 'lint-result-details.txt');
|
|
21
|
+
await mkdir(tempDir, { recursive: true }); // Create the directory because it might not exist
|
|
22
|
+
await writeFile(filePath, stripVTControlCharacters(formattedResultDetails), 'utf8');
|
|
23
|
+
console.log(styleText('cyan', `Wrote to ${filePath}`));
|
|
22
24
|
}
|
|
23
25
|
else {
|
|
24
26
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
@@ -1 +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,
|
|
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,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,IAA8B,EAC9B,OAA4B,EAC5B,eAAyB;IAEzB,MAAM,WAAW,GAAG,MAAM,wBAAwB,EAAE,CAAC;IACrD,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACxF,IAAI,WAAW,KAAK,iBAAiB,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;SAAM,IAAI,WAAW,KAAK,0BAA0B,EAAE,CAAC;QACtD,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtC,CAAC;SAAM,IAAI,WAAW,KAAK,aAAa,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;QAC1D,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,kDAAkD;QAC7F,MAAM,SAAS,CAAC,QAAQ,EAAE,wBAAwB,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC,CAAC;QACpF,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,QAAQ,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,4EAA4E;QAC5E,WAAW,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
|
package/dist/cli/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,QAEnC"}
|
package/dist/cli/log.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { styleText } from 'node:util';
|
|
2
2
|
/**
|
|
3
3
|
* Log a warning message to stderr
|
|
4
4
|
* @param message The message to warn
|
|
5
5
|
*/
|
|
6
6
|
export function warn(message) {
|
|
7
|
-
|
|
7
|
+
process.stderr.write(styleText('yellow', 'Warning') + ': ' + message + '\n');
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=log.js.map
|
package/dist/cli/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAC/E,CAAC"}
|
package/dist/cli/package.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
const PACKAGE_JSON = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json'), 'utf8'));
|
|
5
5
|
export const VERSION = PACKAGE_JSON.version;
|
package/dist/cli/package.js.map
CHANGED
|
@@ -1 +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,
|
|
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"}
|
package/dist/cli/pager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../src/cli/pager.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/cli/pager.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { writeFile } from 'node:fs/promises';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { getCacheDir } from '../util/cache.js';
|
|
5
|
-
const PAGER_CONTENT_FILE_PATH = join(getCacheDir(), 'pager-content.txt');
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
6
2
|
export async function pager(content) {
|
|
7
3
|
if (process.platform === 'win32') {
|
|
8
|
-
return
|
|
4
|
+
return spawnPager('more', [], content);
|
|
9
5
|
}
|
|
10
6
|
else {
|
|
11
|
-
return
|
|
7
|
+
return spawnPager('less', ['-R'], content);
|
|
12
8
|
}
|
|
13
9
|
}
|
|
14
|
-
async function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
33
|
}
|
|
34
34
|
//# sourceMappingURL=pager.js.map
|
package/dist/cli/pager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pager.js","sourceRoot":"","sources":["../../src/cli/pager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
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"}
|
package/dist/cli/parse-argv.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ export type ParsedCLIOptions = {
|
|
|
10
10
|
cache: boolean | undefined;
|
|
11
11
|
cacheLocation: string | undefined;
|
|
12
12
|
resolvePluginsRelativeTo: string | undefined;
|
|
13
|
+
flags: string[] | undefined;
|
|
13
14
|
};
|
|
14
15
|
/** Default CLI Options */
|
|
15
16
|
export declare const cliOptionsDefaults: {
|
|
16
17
|
formatterName: string;
|
|
17
18
|
quiet: false;
|
|
18
19
|
useEslintrc: true;
|
|
19
|
-
cache:
|
|
20
|
-
cacheLocation: string;
|
|
20
|
+
cache: false;
|
|
21
21
|
};
|
|
22
22
|
/** Parse CLI options */
|
|
23
23
|
export declare function parseArgv(argv: string[]): ParsedCLIOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-argv.d.ts","sourceRoot":"","sources":["../../src/cli/parse-argv.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-argv.d.ts","sourceRoot":"","sources":["../../src/cli/parse-argv.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB;;;;;CAKU,CAAC;AAE1C,wBAAwB;AACxB,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAiF1D"}
|