eslint-interactive 11.0.0 → 11.0.2
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/dist/action/apply-suggestions.d.ts +6 -0
- package/dist/action/apply-suggestions.d.ts.map +1 -0
- package/dist/action/apply-suggestions.js +28 -0
- package/dist/action/apply-suggestions.js.map +1 -0
- package/dist/action/convert-error-to-warning-per-file.d.ts +6 -0
- package/dist/action/convert-error-to-warning-per-file.d.ts.map +1 -0
- package/dist/action/convert-error-to-warning-per-file.js +8 -0
- package/dist/action/convert-error-to-warning-per-file.js.map +1 -0
- package/dist/action/disable-per-file.d.ts +6 -0
- package/dist/action/disable-per-file.d.ts.map +1 -0
- package/dist/action/disable-per-file.js +12 -0
- package/dist/action/disable-per-file.js.map +1 -0
- package/dist/action/disable-per-line.d.ts +6 -0
- package/dist/action/disable-per-line.d.ts.map +1 -0
- package/dist/action/disable-per-line.js +12 -0
- package/dist/action/disable-per-line.js.map +1 -0
- package/dist/action/fix.d.ts +6 -0
- package/dist/action/fix.d.ts.map +1 -0
- package/dist/action/fix.js +6 -0
- package/dist/action/fix.js.map +1 -0
- package/dist/action/index.d.ts +8 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +8 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/make-fixable-and-fix.d.ts +6 -0
- package/dist/action/make-fixable-and-fix.d.ts.map +1 -0
- package/dist/action/make-fixable-and-fix.js +28 -0
- package/dist/action/make-fixable-and-fix.js.map +1 -0
- package/dist/action/print-result-details.d.ts +5 -0
- package/dist/action/print-result-details.d.ts.map +1 -0
- package/dist/action/print-result-details.js +28 -0
- package/dist/action/print-result-details.js.map +1 -0
- package/dist/cli/log.d.ts +6 -0
- package/dist/cli/log.d.ts.map +1 -0
- package/dist/cli/log.js +9 -0
- package/dist/cli/log.js.map +1 -0
- package/dist/cli/ora.d.ts +4 -0
- package/dist/cli/ora.d.ts.map +1 -0
- package/dist/cli/ora.js +23 -0
- package/dist/cli/ora.js.map +1 -0
- package/dist/cli/package.d.ts +2 -0
- package/dist/cli/package.d.ts.map +1 -0
- package/dist/cli/package.js +6 -0
- package/dist/cli/package.js.map +1 -0
- package/dist/cli/pager.d.ts +2 -0
- package/dist/cli/pager.d.ts.map +1 -0
- package/dist/cli/pager.js +34 -0
- package/dist/cli/pager.js.map +1 -0
- package/dist/cli/parse-argv.d.ts +24 -0
- package/dist/cli/parse-argv.d.ts.map +1 -0
- package/dist/cli/parse-argv.js +102 -0
- package/dist/cli/parse-argv.js.map +1 -0
- package/dist/cli/prompt.d.ts +61 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +176 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/run.d.ts +8 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +66 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/config.d.ts +46 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +91 -0
- package/dist/config.js.map +1 -0
- package/dist/core-worker.d.ts +23 -0
- package/dist/core-worker.d.ts.map +1 -0
- package/dist/core-worker.js +55 -0
- package/dist/core-worker.js.map +1 -0
- package/dist/core.d.ts +79 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +159 -0
- package/dist/core.js.map +1 -0
- package/dist/eslint/linter.d.ts +18 -0
- package/dist/eslint/linter.d.ts.map +1 -0
- package/dist/eslint/linter.js +67 -0
- package/dist/eslint/linter.js.map +1 -0
- package/dist/eslint/report-translator.d.ts +9 -0
- package/dist/eslint/report-translator.d.ts.map +1 -0
- package/dist/eslint/report-translator.js +77 -0
- package/dist/eslint/report-translator.js.map +1 -0
- package/dist/eslint/rule-fixer.d.ts +80 -0
- package/dist/eslint/rule-fixer.d.ts.map +1 -0
- package/dist/eslint/rule-fixer.js +118 -0
- package/dist/eslint/rule-fixer.js.map +1 -0
- package/dist/eslint/source-code-fixer.d.ts +19 -0
- package/dist/eslint/source-code-fixer.d.ts.map +1 -0
- package/dist/eslint/source-code-fixer.js +131 -0
- package/dist/eslint/source-code-fixer.js.map +1 -0
- package/dist/fix/apply-auto-fixes.d.ts +8 -0
- package/dist/fix/apply-auto-fixes.d.ts.map +1 -0
- package/dist/fix/apply-auto-fixes.js +8 -0
- package/dist/fix/apply-auto-fixes.js.map +1 -0
- package/dist/fix/apply-suggestions.d.ts +11 -0
- package/dist/fix/apply-suggestions.d.ts.map +1 -0
- package/dist/fix/apply-suggestions.js +25 -0
- package/dist/fix/apply-suggestions.js.map +1 -0
- package/dist/fix/convert-error-to-warning-per-file.d.ts +10 -0
- package/dist/fix/convert-error-to-warning-per-file.d.ts.map +1 -0
- package/dist/fix/convert-error-to-warning-per-file.js +28 -0
- package/dist/fix/convert-error-to-warning-per-file.js.map +1 -0
- package/dist/fix/disable-per-file.d.ts +12 -0
- package/dist/fix/disable-per-file.d.ts.map +1 -0
- package/dist/fix/disable-per-file.js +63 -0
- package/dist/fix/disable-per-file.js.map +1 -0
- package/dist/fix/disable-per-line.d.ts +12 -0
- package/dist/fix/disable-per-line.d.ts.map +1 -0
- package/dist/fix/disable-per-line.js +61 -0
- package/dist/fix/disable-per-line.js.map +1 -0
- package/dist/fix/index.d.ts +19 -0
- package/dist/fix/index.d.ts.map +1 -0
- package/dist/fix/index.js +8 -0
- package/dist/fix/index.js.map +1 -0
- package/dist/fix/make-fixable-and-fix.d.ts +12 -0
- package/dist/fix/make-fixable-and-fix.d.ts.map +1 -0
- package/dist/fix/make-fixable-and-fix.js +60 -0
- package/dist/fix/make-fixable-and-fix.js.map +1 -0
- package/dist/formatter/colors.d.ts +4 -0
- package/dist/formatter/colors.d.ts.map +1 -0
- package/dist/formatter/colors.js +5 -0
- package/dist/formatter/colors.js.map +1 -0
- package/dist/formatter/format-by-files.d.ts +3 -0
- package/dist/formatter/format-by-files.d.ts.map +1 -0
- package/dist/formatter/format-by-files.js +41 -0
- package/dist/formatter/format-by-files.js.map +1 -0
- package/dist/formatter/format-by-rules.d.ts +3 -0
- package/dist/formatter/format-by-rules.d.ts.map +1 -0
- package/dist/formatter/format-by-rules.js +39 -0
- package/dist/formatter/format-by-rules.js.map +1 -0
- package/dist/formatter/index.d.ts +4 -0
- package/dist/formatter/index.d.ts.map +1 -0
- package/dist/formatter/index.js +7 -0
- package/dist/formatter/index.js.map +1 -0
- package/dist/formatter/take-rule-statistics.d.ts +18 -0
- package/dist/formatter/take-rule-statistics.d.ts.map +1 -0
- package/dist/formatter/take-rule-statistics.js +51 -0
- package/dist/formatter/take-rule-statistics.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/scene/check-results.d.ts +21 -0
- package/dist/scene/check-results.d.ts.map +1 -0
- package/dist/scene/check-results.js +22 -0
- package/dist/scene/check-results.js.map +1 -0
- package/dist/scene/index.d.ts +25 -0
- package/dist/scene/index.d.ts.map +1 -0
- package/dist/scene/index.js +6 -0
- package/dist/scene/index.js.map +1 -0
- package/dist/scene/lint.d.ts +8 -0
- package/dist/scene/lint.d.ts.map +1 -0
- package/dist/scene/lint.js +31 -0
- package/dist/scene/lint.js.map +1 -0
- package/dist/scene/select-action.d.ts +20 -0
- package/dist/scene/select-action.d.ts.map +1 -0
- package/dist/scene/select-action.js +50 -0
- package/dist/scene/select-action.js.map +1 -0
- package/dist/scene/select-rule-ids.d.ts +15 -0
- package/dist/scene/select-rule-ids.d.ts.map +1 -0
- package/dist/scene/select-rule-ids.js +10 -0
- package/dist/scene/select-rule-ids.js.map +1 -0
- package/dist/util/array.d.ts +3 -0
- package/dist/util/array.d.ts.map +1 -0
- package/dist/util/array.js +14 -0
- package/dist/util/array.js.map +1 -0
- package/dist/util/cache.d.ts +5 -0
- package/dist/util/cache.d.ts.map +1 -0
- package/dist/util/cache.js +15 -0
- package/dist/util/cache.js.map +1 -0
- package/dist/util/eslint.d.ts +99 -0
- package/dist/util/eslint.d.ts.map +1 -0
- package/dist/util/eslint.js +201 -0
- package/dist/util/eslint.js.map +1 -0
- package/dist/util/filter-script.d.ts +6 -0
- package/dist/util/filter-script.d.ts.map +1 -0
- package/dist/util/filter-script.js +38 -0
- package/dist/util/filter-script.js.map +1 -0
- package/dist/util/type-check.d.ts +6 -0
- package/dist/util/type-check.d.ts.map +1 -0
- package/dist/util/type-check.js +8 -0
- package/dist/util/type-check.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { SerializableCore } from '../core-worker.js';
|
|
4
|
+
import { Undo } from '../core.js';
|
|
5
|
+
export declare function doApplySuggestionsAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
|
+
//# sourceMappingURL=apply-suggestions.d.ts.map
|
|
@@ -0,0 +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;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAOlC,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,CAqBf"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { fixingSpinner } from '../cli/ora.js';
|
|
4
|
+
import { promptToInputReuseFilterScript } from '../cli/prompt.js';
|
|
5
|
+
import { editFileWithEditor, generateExampleFilterScriptFilePath, generateFilterScriptFilePath, } from '../util/filter-script.js';
|
|
6
|
+
export async function doApplySuggestionsAction(core, results, selectedRuleIds) {
|
|
7
|
+
const exampleScript = await readFile(generateExampleFilterScriptFilePath(), 'utf8');
|
|
8
|
+
const filterScriptFilePath = generateFilterScriptFilePath(selectedRuleIds);
|
|
9
|
+
const isFilterScriptExist = await access(filterScriptFilePath)
|
|
10
|
+
.then(() => true)
|
|
11
|
+
.catch(() => false);
|
|
12
|
+
if (isFilterScriptExist) {
|
|
13
|
+
const reuseFilterScript = await promptToInputReuseFilterScript();
|
|
14
|
+
if (!reuseFilterScript) {
|
|
15
|
+
await writeFile(filterScriptFilePath, exampleScript);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// ディレクトリがない可能性を考慮して作成しておく
|
|
20
|
+
await mkdir(dirname(filterScriptFilePath), { recursive: true });
|
|
21
|
+
await writeFile(filterScriptFilePath, exampleScript);
|
|
22
|
+
}
|
|
23
|
+
console.log('Opening editor...');
|
|
24
|
+
const filterScript = await editFileWithEditor(filterScriptFilePath);
|
|
25
|
+
const undo = await fixingSpinner(async () => core.applySuggestions(results, selectedRuleIds, filterScript));
|
|
26
|
+
return undo;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=apply-suggestions.js.map
|
|
@@ -0,0 +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,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAGlE,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;QACvB,MAAM,iBAAiB,GAAG,MAAM,8BAA8B,EAAE,CAAC;QACjE,IAAI,CAAC,iBAAiB,EAAE;YACtB,MAAM,SAAS,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;SACtD;KACF;SAAM;QACL,0BAA0B;QAC1B,MAAM,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC;KACtD;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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { SerializableCore } from '../core-worker.js';
|
|
4
|
+
import { Undo } from '../core.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,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,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 { fixingSpinner } from '../cli/ora.js';
|
|
2
|
+
import { promptToInputDescription } from '../cli/prompt.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,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,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 { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { SerializableCore } from '../core-worker.js';
|
|
4
|
+
import { Undo } from '../core.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,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,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 { fixingSpinner } from '../cli/ora.js';
|
|
2
|
+
import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.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":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAuB,wBAAwB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAInH,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;QACf,mBAAmB,GAAG,MAAM,gCAAgC,EAAE,CAAC;KAChE;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 { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { SerializableCore } from '../core-worker.js';
|
|
4
|
+
import { Undo } from '../core.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,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,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 { fixingSpinner } from '../cli/ora.js';
|
|
2
|
+
import { promptToInputDescription, promptToInputDescriptionPosition } from '../cli/prompt.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":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAuB,wBAAwB,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAInH,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;QACf,mBAAmB,GAAG,MAAM,gCAAgC,EAAE,CAAC;KAChE;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 { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { SerializableCore } from '../core-worker.js';
|
|
4
|
+
import { Undo } from '../core.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,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,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 @@
|
|
|
1
|
+
{"version":3,"file":"fix.js","sourceRoot":"","sources":["../../src/action/fix.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI9C,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,8 @@
|
|
|
1
|
+
export { doApplySuggestionsAction } from './apply-suggestions.js';
|
|
2
|
+
export { doDisablePerFileAction } from './disable-per-file.js';
|
|
3
|
+
export { doDisablePerLineAction } from './disable-per-line.js';
|
|
4
|
+
export { doConvertErrorToWarningPerFileAction } from './convert-error-to-warning-per-file.js';
|
|
5
|
+
export { doFixAction } from './fix.js';
|
|
6
|
+
export { doMakeFixableAndFixAction } from './make-fixable-and-fix.js';
|
|
7
|
+
export { doPrintResultDetailsAction } from './print-result-details.js';
|
|
8
|
+
//# 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,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,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,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { doApplySuggestionsAction } from './apply-suggestions.js';
|
|
2
|
+
export { doDisablePerFileAction } from './disable-per-file.js';
|
|
3
|
+
export { doDisablePerLineAction } from './disable-per-line.js';
|
|
4
|
+
export { doConvertErrorToWarningPerFileAction } from './convert-error-to-warning-per-file.js';
|
|
5
|
+
export { doFixAction } from './fix.js';
|
|
6
|
+
export { doMakeFixableAndFixAction } from './make-fixable-and-fix.js';
|
|
7
|
+
export { doPrintResultDetailsAction } from './print-result-details.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,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,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { SerializableCore } from '../core-worker.js';
|
|
4
|
+
import { Undo } from '../core.js';
|
|
5
|
+
export declare function doMakeFixableAndFixAction(core: Remote<SerializableCore>, results: ESLint.LintResult[], selectedRuleIds: string[]): Promise<Undo>;
|
|
6
|
+
//# sourceMappingURL=make-fixable-and-fix.d.ts.map
|
|
@@ -0,0 +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;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAOlC,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,CAqBf"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
import { fixingSpinner } from '../cli/ora.js';
|
|
4
|
+
import { promptToInputReuseScript } from '../cli/prompt.js';
|
|
5
|
+
import { editFileWithEditor, generateExampleFixableMakerScriptFilePath, generateFixableMakerScriptFilePath, } from '../util/filter-script.js';
|
|
6
|
+
export async function doMakeFixableAndFixAction(core, results, selectedRuleIds) {
|
|
7
|
+
const exampleScript = await readFile(generateExampleFixableMakerScriptFilePath(), 'utf8');
|
|
8
|
+
const fixableMakerScriptFilePath = generateFixableMakerScriptFilePath(selectedRuleIds);
|
|
9
|
+
const isFixableMakerScriptExist = await access(fixableMakerScriptFilePath)
|
|
10
|
+
.then(() => true)
|
|
11
|
+
.catch(() => false);
|
|
12
|
+
if (isFixableMakerScriptExist) {
|
|
13
|
+
const reuseScript = await promptToInputReuseScript();
|
|
14
|
+
if (!reuseScript) {
|
|
15
|
+
await writeFile(fixableMakerScriptFilePath, exampleScript);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// ディレクトリがない可能性を考慮して作成しておく
|
|
20
|
+
await mkdir(dirname(fixableMakerScriptFilePath), { recursive: true });
|
|
21
|
+
await writeFile(fixableMakerScriptFilePath, exampleScript);
|
|
22
|
+
}
|
|
23
|
+
console.log('Opening editor...');
|
|
24
|
+
const fixableMakerScript = await editFileWithEditor(fixableMakerScriptFilePath);
|
|
25
|
+
const undo = await fixingSpinner(async () => core.makeFixableAndFix(results, selectedRuleIds, fixableMakerScript));
|
|
26
|
+
return undo;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=make-fixable-and-fix.js.map
|
|
@@ -0,0 +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,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,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;QAC7B,MAAM,WAAW,GAAG,MAAM,wBAAwB,EAAE,CAAC;QACrD,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,SAAS,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;SAC5D;KACF;SAAM;QACL,0BAA0B;QAC1B,MAAM,KAAK,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,MAAM,SAAS,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;KAC5D;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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Remote } from 'comlink';
|
|
2
|
+
import { ESLint } from 'eslint';
|
|
3
|
+
import { 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":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC9B,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,EAC5B,eAAe,EAAE,MAAM,EAAE,iBAgB1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import stripAnsi from 'strip-ansi';
|
|
5
|
+
import { pager } from '../cli/pager.js';
|
|
6
|
+
import { promptToInputDisplayMode } from '../cli/prompt.js';
|
|
7
|
+
import { getCacheDir } from '../util/cache.js';
|
|
8
|
+
import { unreachable } from '../util/type-check.js';
|
|
9
|
+
export async function doPrintResultDetailsAction(core, results, selectedRuleIds) {
|
|
10
|
+
const displayMode = await promptToInputDisplayMode();
|
|
11
|
+
const formattedResultDetails = await core.formatResultDetails(results, selectedRuleIds);
|
|
12
|
+
if (displayMode === 'printInTerminal') {
|
|
13
|
+
console.log(formattedResultDetails);
|
|
14
|
+
}
|
|
15
|
+
else if (displayMode === 'printInTerminalWithPager') {
|
|
16
|
+
await pager(formattedResultDetails);
|
|
17
|
+
}
|
|
18
|
+
else if (displayMode === 'writeToFile') {
|
|
19
|
+
const filePath = join(getCacheDir(), 'lint-result-details.txt');
|
|
20
|
+
await writeFile(filePath, stripAnsi(formattedResultDetails), 'utf8');
|
|
21
|
+
console.log(chalk.cyan(`Wrote to ${filePath}`));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
25
|
+
unreachable(`Unknown display mode: ${displayMode}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# 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,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,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;QACrC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;KACrC;SAAM,IAAI,WAAW,KAAK,0BAA0B,EAAE;QACrD,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACrC;SAAM,IAAI,WAAW,KAAK,aAAa,EAAE;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,yBAAyB,CAAC,CAAC;QAChE,MAAM,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,QAAQ,EAAE,CAAC,CAAC,CAAC;KACjD;SAAM;QACL,4EAA4E;QAC5E,WAAW,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;KACrD;AACH,CAAC"}
|
|
@@ -0,0 +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,QAInC"}
|
package/dist/cli/log.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import boxen from 'boxen';
|
|
2
|
+
/**
|
|
3
|
+
* Log a warning message to stderr
|
|
4
|
+
* @param message The message to warn
|
|
5
|
+
*/
|
|
6
|
+
export function warn(message) {
|
|
7
|
+
console.error(boxen(message, { title: 'WARNING', borderColor: 'yellow', padding: { top: 0, left: 1, right: 1, bottom: 0 } }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/cli/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAC/G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ora.d.ts","sourceRoot":"","sources":["../../src/cli/ora.ts"],"names":[],"mappings":"AAEA,wBAAsB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMxE;AAED,wBAAsB,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMvE;AAED,wBAAsB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMxE"}
|
package/dist/cli/ora.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { oraPromise } from 'ora';
|
|
2
|
+
export async function lintingSpinner(cb) {
|
|
3
|
+
return oraPromise(cb, {
|
|
4
|
+
text: 'Linting...',
|
|
5
|
+
spinner: 'clock',
|
|
6
|
+
successText: 'Linting done.',
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export async function fixingSpinner(cb) {
|
|
10
|
+
return oraPromise(cb, {
|
|
11
|
+
text: 'Fixing...',
|
|
12
|
+
spinner: 'clock',
|
|
13
|
+
successText: 'Fixing done.',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export async function undoingSpinner(cb) {
|
|
17
|
+
return oraPromise(cb, {
|
|
18
|
+
text: 'Undoing...',
|
|
19
|
+
spinner: 'timeTravel',
|
|
20
|
+
successText: 'Undoing done.',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ora.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ora.js","sourceRoot":"","sources":["../../src/cli/ora.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,EAAoB;IAC1D,OAAO,UAAU,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,eAAe;KAC7B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,EAAoB;IACzD,OAAO,UAAU,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,cAAc;KAC5B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,EAAoB;IAC1D,OAAO,UAAU,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,YAAY;QACrB,WAAW,EAAE,eAAe;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -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 { join, dirname } 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,IAAI,EAAE,OAAO,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 @@
|
|
|
1
|
+
{"version":3,"file":"pager.d.ts","sourceRoot":"","sources":["../../src/cli/pager.ts"],"names":[],"mappings":"AAOA,wBAAsB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
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');
|
|
6
|
+
export async function pager(content) {
|
|
7
|
+
if (process.platform === 'win32') {
|
|
8
|
+
return pagerForWindows(content);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return pagerForPOSIX(content);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function pagerForWindows(content) {
|
|
15
|
+
await writeFile(PAGER_CONTENT_FILE_PATH, content, 'utf-8');
|
|
16
|
+
try {
|
|
17
|
+
spawnSync('more', [PAGER_CONTENT_FILE_PATH], { shell: true, stdio: 'inherit' });
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
console.error('Failed to execute `more` command. Please install `more` command.');
|
|
21
|
+
throw e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function pagerForPOSIX(content) {
|
|
25
|
+
await writeFile(PAGER_CONTENT_FILE_PATH, content, 'utf-8');
|
|
26
|
+
try {
|
|
27
|
+
spawnSync('less', ['-R', PAGER_CONTENT_FILE_PATH], { shell: true, stdio: 'inherit' });
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
console.error('Failed to execute `less` command. Please install `less` command.');
|
|
31
|
+
throw e;
|
|
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,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,mBAAmB,CAAC,CAAC;AAEzE,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAe;IACzC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;KACjC;SAAM;QACL,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;KAC/B;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,OAAe;IAC5C,MAAM,SAAS,CAAC,uBAAuB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI;QACF,SAAS,CAAC,MAAM,EAAE,CAAC,uBAAuB,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;KACjF;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;QAClF,MAAM,CAAC,CAAC;KACT;AACH,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,OAAe;IAC1C,MAAM,SAAS,CAAC,uBAAuB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI;QACF,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;KACvF;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;QAClF,MAAM,CAAC,CAAC;KACT;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ParsedCLIOptions = {
|
|
2
|
+
patterns: string[];
|
|
3
|
+
formatterName: string | undefined;
|
|
4
|
+
quiet: boolean | undefined;
|
|
5
|
+
useEslintrc: boolean | undefined;
|
|
6
|
+
overrideConfigFile: string | undefined;
|
|
7
|
+
extensions: string[] | undefined;
|
|
8
|
+
rulePaths: string[] | undefined;
|
|
9
|
+
ignorePath: string | undefined;
|
|
10
|
+
cache: boolean | undefined;
|
|
11
|
+
cacheLocation: string | undefined;
|
|
12
|
+
resolvePluginsRelativeTo: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** Default CLI Options */
|
|
15
|
+
export declare const cliOptionsDefaults: {
|
|
16
|
+
formatterName: string;
|
|
17
|
+
quiet: false;
|
|
18
|
+
useEslintrc: true;
|
|
19
|
+
cache: true;
|
|
20
|
+
cacheLocation: string;
|
|
21
|
+
};
|
|
22
|
+
/** Parse CLI options */
|
|
23
|
+
export declare function parseArgv(argv: string[]): ParsedCLIOptions;
|
|
24
|
+
//# 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":"AAMA,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;CAC9C,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB;;;;;;CAMU,CAAC;AAE1C,wBAAwB;AACxB,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAuF1D"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { join, relative } from 'node:path';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { getCacheDir } from '../util/cache.js';
|
|
4
|
+
import { VERSION } from './package.js';
|
|
5
|
+
/** Default CLI Options */
|
|
6
|
+
export const cliOptionsDefaults = {
|
|
7
|
+
formatterName: 'codeframe',
|
|
8
|
+
quiet: false,
|
|
9
|
+
useEslintrc: true,
|
|
10
|
+
cache: true,
|
|
11
|
+
cacheLocation: relative(process.cwd(), join(getCacheDir(), '.eslintcache')),
|
|
12
|
+
};
|
|
13
|
+
/** Parse CLI options */
|
|
14
|
+
export function parseArgv(argv) {
|
|
15
|
+
const parsedArgv = yargs(argv.slice(2))
|
|
16
|
+
.wrap(Math.min(140, process.stdout.columns))
|
|
17
|
+
.scriptName('eslint-interactive')
|
|
18
|
+
.version(VERSION)
|
|
19
|
+
.usage('$0 [file.js] [dir]')
|
|
20
|
+
.detectLocale(false)
|
|
21
|
+
// NOTE: yargs doesn't support negative only option. So we use `--eslintrc` instead of `--no-eslintrc`.
|
|
22
|
+
.option('eslintrc', {
|
|
23
|
+
type: 'boolean',
|
|
24
|
+
describe: 'Enable use of configuration from .eslintrc.*',
|
|
25
|
+
default: cliOptionsDefaults.useEslintrc,
|
|
26
|
+
})
|
|
27
|
+
.option('config', {
|
|
28
|
+
alias: 'c',
|
|
29
|
+
type: 'string',
|
|
30
|
+
describe: 'Use this configuration, overriding .eslintrc.* config options if present',
|
|
31
|
+
})
|
|
32
|
+
.option('ext', {
|
|
33
|
+
type: 'array',
|
|
34
|
+
describe: 'Specify JavaScript file extensions',
|
|
35
|
+
})
|
|
36
|
+
.nargs('ext', 1)
|
|
37
|
+
.option('resolve-plugins-relative-to', {
|
|
38
|
+
type: 'string',
|
|
39
|
+
describe: 'A folder where plugins should be resolved from, CWD by default',
|
|
40
|
+
})
|
|
41
|
+
.option('rulesdir', {
|
|
42
|
+
type: 'array',
|
|
43
|
+
describe: 'Use additional rules from this directory',
|
|
44
|
+
})
|
|
45
|
+
.nargs('rulesdir', 1)
|
|
46
|
+
// Following ESLint, --ignore-path accepts only one path. However, this limitation may be relaxed in the future.
|
|
47
|
+
// ref: https://github.com/eslint/eslint/issues/9794
|
|
48
|
+
.option('ignore-path', {
|
|
49
|
+
type: 'string',
|
|
50
|
+
describe: 'Specify path of ignore file',
|
|
51
|
+
})
|
|
52
|
+
.option('format', {
|
|
53
|
+
type: 'string',
|
|
54
|
+
describe: 'Specify the format to be used for the `Display problem messages` action',
|
|
55
|
+
default: cliOptionsDefaults.formatterName,
|
|
56
|
+
})
|
|
57
|
+
.option('quiet', {
|
|
58
|
+
type: 'boolean',
|
|
59
|
+
describe: 'Report errors only',
|
|
60
|
+
default: cliOptionsDefaults.quiet,
|
|
61
|
+
})
|
|
62
|
+
.option('cache', {
|
|
63
|
+
type: 'boolean',
|
|
64
|
+
describe: 'Only check changed files',
|
|
65
|
+
default: cliOptionsDefaults.cache,
|
|
66
|
+
})
|
|
67
|
+
.option('cache-location', {
|
|
68
|
+
type: 'string',
|
|
69
|
+
describe: `Path to the cache file or directory`,
|
|
70
|
+
default: cliOptionsDefaults.cacheLocation,
|
|
71
|
+
})
|
|
72
|
+
.example('$0 ./src', 'Lint ./src/ directory')
|
|
73
|
+
.example('$0 ./src ./test', 'Lint multiple directories')
|
|
74
|
+
.example("$0 './src/**/*.{ts,tsx,vue}'", 'Lint with glob pattern')
|
|
75
|
+
.example('$0 ./src --ext .ts,.tsx,.vue', 'Lint with custom extensions')
|
|
76
|
+
.example('$0 ./src --rulesdir ./rules', 'Lint with custom rules')
|
|
77
|
+
.example('$0 ./src --no-eslintrc --config ./.eslintrc.ci.js', 'Lint with custom config')
|
|
78
|
+
.parseSync();
|
|
79
|
+
// NOTE: convert `string` type because yargs convert `'10'` (`string` type) into `10` (`number` type)
|
|
80
|
+
// and `lintFiles` only accepts `string[]`.
|
|
81
|
+
const patterns = parsedArgv._.map((pattern) => pattern.toString());
|
|
82
|
+
const rulePaths = parsedArgv.rulesdir?.map((rulePath) => rulePath.toString());
|
|
83
|
+
const extensions = parsedArgv.ext
|
|
84
|
+
?.map((extension) => extension.toString())
|
|
85
|
+
// map '.js,.ts' into ['.js', '.ts']
|
|
86
|
+
.flatMap((extension) => extension.split(','));
|
|
87
|
+
const formatterName = parsedArgv.format;
|
|
88
|
+
return {
|
|
89
|
+
patterns,
|
|
90
|
+
formatterName,
|
|
91
|
+
quiet: parsedArgv.quiet,
|
|
92
|
+
useEslintrc: parsedArgv.eslintrc,
|
|
93
|
+
overrideConfigFile: parsedArgv.config,
|
|
94
|
+
extensions,
|
|
95
|
+
rulePaths,
|
|
96
|
+
ignorePath: parsedArgv.ignorePath,
|
|
97
|
+
cache: parsedArgv.cache,
|
|
98
|
+
cacheLocation: parsedArgv['cache-location'],
|
|
99
|
+
resolvePluginsRelativeTo: parsedArgv['resolve-plugins-relative-to'],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=parse-argv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-argv.js","sourceRoot":"","sources":["../../src/cli/parse-argv.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { 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' | 'applySuggestions' | 'makeFixableAndFix' | '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
|
+
/**
|
|
51
|
+
* Ask the user if they want to reuse the filter script.
|
|
52
|
+
* @returns If it reuses, `true`, if not, `false`.
|
|
53
|
+
*/
|
|
54
|
+
export declare function promptToInputReuseFilterScript(): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Ask the user if they want to reuse the script.
|
|
57
|
+
* @returns If it reuses, `true`, if not, `false`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function promptToInputReuseScript(): Promise<boolean>;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=prompt.d.ts.map
|