Skip to content

Commit 06dbd1a

Browse files
committed
fix mistakes in code generation by Copilot
1 parent 7427b24 commit 06dbd1a

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

Diff for: src/cli/parse-argv.ts

+29-16
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const cliOptionsDefaults = {
3131
export function parseArgv(argv: string[]): ParsedCLIOptions {
3232
const options = {
3333
'eslintrc': { type: 'boolean', default: cliOptionsDefaults.useEslintrc },
34-
'config': { type: 'string' },
34+
'config': { type: 'string', short: 'c' },
3535
'ext': { type: 'string', multiple: true },
3636
'resolve-plugins-relative-to': { type: 'string' },
3737
'rulesdir': { type: 'string', multiple: true },
@@ -53,25 +53,38 @@ export function parseArgv(argv: string[]): ParsedCLIOptions {
5353
});
5454

5555
if (values.version) {
56-
console.log(`Version: ${VERSION}`);
56+
console.log(VERSION);
57+
// eslint-disable-next-line n/no-process-exit
5758
process.exit(0);
5859
}
5960

6061
if (values.help) {
61-
console.log(`Usage: eslint [options] [file|dir|glob]`);
62-
console.log(`Options:`);
63-
console.log(` --version Show version number`);
64-
console.log(` --help Show help`);
65-
console.log(` --eslintrc Use configuration from .eslintrc`);
66-
console.log(` --config Use this configuration, overriding .eslintrc`);
67-
console.log(` --ext Specify JavaScript file extensions`);
68-
console.log(` --resolve-plugins-relative-to A folder where plugins should be resolved from`);
69-
console.log(` --rulesdir Use additional rules from this directory`);
70-
console.log(` --ignore-path Specify path of ignore file`);
71-
console.log(` --format Use a specific output format`);
72-
console.log(` --quiet Report errors only`);
73-
console.log(` --cache Only check changed files`);
74-
console.log(` --cache-location Path to the cache file or directory`);
62+
console.log(`
63+
eslint-interactive [file.js] [dir]
64+
65+
Options:
66+
--help Show help [boolean]
67+
--version Show version number [boolean]
68+
--eslintrc Enable use of configuration from .eslintrc.* [boolean] [default: true]
69+
-c, --config Use this configuration, overriding .eslintrc.* config options if present [string]
70+
--resolve-plugins-relative-to A folder where plugins should be resolved from, CWD by default [string]
71+
--ext Specify JavaScript file extensions [array]
72+
--rulesdir Use additional rules from this directory [array]
73+
--ignore-path Specify path of ignore file [string]
74+
--format Specify the format to be used for the \`Display problem messages\` action [string] [default: "codeframe"]
75+
--quiet Report errors only [boolean] [default: false]
76+
--cache Only check changed files [boolean] [default: true]
77+
--cache-location Path to the cache file or directory
78+
79+
Examples:
80+
eslint-interactive ./src Lint ./src/ directory
81+
eslint-interactive ./src ./test Lint multiple directories
82+
eslint-interactive './src/**/*.{ts,tsx,vue}' Lint with glob pattern
83+
eslint-interactive ./src --ext .ts,.tsx,.vue Lint with custom extensions
84+
eslint-interactive ./src --rulesdir ./rules Lint with custom rules
85+
eslint-interactive ./src --no-eslintrc --config ./.eslintrc.ci.js Lint with custom config
86+
`);
87+
// eslint-disable-next-line n/no-process-exit
7588
process.exit(0);
7689
}
7790

0 commit comments

Comments
 (0)