Invalid option '--ext' - perhaps you meant '-c'?
See original GitHub issueEnvironment
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?
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:
- Created 10 months ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 aneslint.config.js
file in the same directory or in a parent directory.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)