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.

Invalid option '--ext' - perhaps you meant '-c'?

See original GitHub issue

Environment

Node version: v16.18.1 npm version: 8.19.2 Local ESLint version: 8.27.0 Global ESLint version: N/A Operating System: Mac OS X

What parser are you using?

@typescript-eslint/parser

What did you do?

Configuration
N/A
N/A

What did you expect to happen?

Running eslint --ext .ts should find and lint TypeScript files.

What actually happened?

Running eslint --ext .ts produces this error:

Invalid option '--ext' - perhaps you meant '-c'?

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Reverting to v8.17.0 fixes the issue. Not sure which version broke this.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mdjermanoviccommented, Nov 17, 2022

That’s correct, the command should have at least one file/directory/pattern argument. Otherwise, it won’t lint anything.

However, it shouldn’t throw Invalid option '--ext' as in the original issue. This is most likely a problem with switching to the flat config mode, perhaps there’s an eslint.config.js file in the same directory or in a parent directory.

1reaction
ljharbcommented, Nov 17, 2022

I think what you want is eslint --ext=.ts . so that it looks everywhere in the current directory (iow, the location to search, as @einojokipii said)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint: Invalid Options when create-next-app
When i run yarn create-next-app and i start to write javascript code inside Visual Studio Code, the ESlint extension throw back an error...
Read more >
eslint/eslint - Gitter
Hi, there is a tough issue about eslint. I have configured some npm command lines in package.json. The detail setting are as follows:...
Read more >
Documentation: 15: pgbench
Exit status 1 indicates static problems such as invalid command-line options or internal errors which are supposed to never occur. Early errors that...
Read more >
Troubleshooting AWS CLI errors
General troubleshooting to try first. If you receive an error or encounter an issue with the AWS CLI, we suggest the following general...
Read more >
Getopt Function (The GNU Awk User's Guide)
Modern Unix systems provide a C function named getopt() for processing ... Usually getopt() prints an error message when it finds an invalid...
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