question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
nzakascommented, 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.

0reactions
mdjermanoviccommented, Dec 7, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
The first way to use configuration files is via .eslintrc. ... option on the command line, so you know if a new fixable...
Read more >
Migrating to v8.0.0 - ESLint - Pluggable JavaScript Linter
This guide is intended to walk you through the breaking changes. ... In ESLint v7.0.0, rules that provided suggestions did not need to...
Read more >
Configuring ESLint - ESLint - Pluggable JavaScript Linter
Configuration Files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories....
Read more >
How to use ESLint - javascript - Stack Overflow
This part i understood.. Basically ESLint wil look for and read automatically the JS file did not understand... It should look into my...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found