Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Request: file glob for eslint --init is hard to figure out #15127

Closed
1 task
krichter722 opened this issue Oct 1, 2021 · 5 comments
Closed
1 task

Change Request: file glob for eslint --init is hard to figure out #15127

krichter722 opened this issue Oct 1, 2021 · 5 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion cli Relates to ESLint's command-line interface core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint Stale
Projects

Comments

@krichter722
Copy link

ESLint 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 #7211 which has been handled as support request and been closed without improvement because it hasn't been requested by the reporter.

@krichter722 krichter722 added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Oct 1, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Oct 1, 2021
@nzakas
Copy link
Member

nzakas commented Oct 2, 2021

Thanks for the feedback. Did you end up finding a glob that worked? If you did, could you share it as compared to one that didn’t work?

@nzakas nzakas moved this from Needs Triage to Triaging in Triage Oct 2, 2021
@nzakas nzakas added cli Relates to ESLint's command-line interface and removed triage An ESLint team member will look at this issue soon labels Oct 2, 2021
@krichter722
Copy link
Author

@nzakas I went with src/**/*.ts in order to get started and get past the question. It got me past the question and started the analyses, but it was of course incomplete because the analysis from src/**/*.tsx was missing.

Upon further investigation I tried src/**/*.ts src/**/*.tsx and it seems to work based on the output Enabled a out of b rules based on n files.

However I now figured that this analysis doesn't seem to do anything or is very broken. I doesn't even get the value for indent right in a project which has a very consistent indent of 2. It seems to enable all rules which is not what I'd expect after being offered an examination of my source files, but that's a separate (set of) issue(s).

@nzakas
Copy link
Member

nzakas commented Oct 5, 2021

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.

@github-actions
Copy link

github-actions bot commented Dec 4, 2021

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.

@github-actions github-actions bot added the Stale label Dec 4, 2021
@mdjermanovic
Copy link
Member

Per eslint/rfcs#79, the auto-config feature will be removed in one of the future minor versions, and that's likely to be very soon (#15150), so I'm closing this issue since it only relates to auto-config.

Triage automation moved this from Triaging to Complete Dec 7, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 6, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion cli Relates to ESLint's command-line interface core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint Stale
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

3 participants