Change Request: file glob for eslint --init is hard to figure out
See original GitHub issueESLint version
7.32.0
What problem do you want to solve?
When using eslint --init
on is asked Which file(s), path(s), or glob(s) should be examined?
. A lot of intuitive inputs like src/**/*.(ts|tsx)
, src/**/*.ts
and *ts
all don’t work for a project with .ts
and .tsx
files in src/
under the project root where yarn run eslint --init
is executed. It’s a frustrating first contact with eslint, especially since one has to start over with the questionaire and there’s no link to documentation in the output and no --help
for --init
. The only thing I could find rtfm-wise is the issue linked below which didn’t help me.
The specific error message is
No files matching the pattern "src/**/*.(ts|tsx)" were found.
Please check for typing mistakes in the pattern.
What do you think is the correct solution?
A link to the documentation in the output is slightly hard to maintain but would make a very good first impression of eslint
.
It seems like --init
could be a subcommand as well, i.e. eslint --init
would become eslint init
so that it could provide a --help
. I don’t like eslint --init --help
because it’s no a nice cli.
Participation
- I am willing to submit a pull request for this change.
Additional comments
There’s another misunderstanding of the question at https://github.com/eslint/eslint/issues/7211 which has been handled as support request and been closed without improvement because it hasn’t been requested by the reporter.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
Yeah, the auto config is a bit broken. I actually thought we had removed it but apparently not. In any event, I’m not surprised it doesn’t work properly with TypeScript files as that requires a custom parser and the built in rules don’t always work correctly with TypeScript.
I think we will probably move forward with removing this feature rather than trying to fix it.
Per https://github.com/eslint/rfcs/pull/79, the auto-config feature will be removed in one of the future minor versions, and that’s likely to be very soon (https://github.com/eslint/eslint/pull/15150), so I’m closing this issue since it only relates to auto-config.