Support specifying extensions in the config
See original GitHub issueThe version of ESLint you are using.
v5.5.0
The problem you want to solve.
It’s currently only possible to specify the extensions of the files to lint with the --ext
CLI flag. This creates an annoying user-experience for sharable configs that adds support for non-JS environments. For example, if someone wants to use my eslint-config-xo-typescript
shareable config, they need to run ESLint with eslint . --ext=ts
.
Your take on the correct solution to problem.
It should be possible to specify an extension in the ESLint config. This makes it possible to create a shareable config that can be used directly without having to use any CLI flags.
For example:
module.exports = {
extensions: [
'md'
]
rules: {
// …
}
};
I don’t see any downside with supporting this. And it would also make it easier to use ESLint with non-JS files in non-CLI situations like editors and with wrappers like XO and Standard.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:90
- Comments:14 (10 by maintainers)
Top GitHub Comments
@not-an-aardvark @ilyavolodin Can this be reopened please? It’s a sorely needed feature and the issue has many upvotes.
Hi. #11546 changed the processing order to “config-then-files” from “files-then-config”. Now ESLint loads config files before globs resolved, so there are no technical barriers to implement this.
There are some related RFCs: https://github.com/eslint/rfcs/pull/20, https://github.com/eslint/rfcs/pull/22
Personally, I hope to go with https://github.com/eslint/rfcs/pull/20, though it’s on 7.0.0 line since 6.0.0 has been feature-frozen.