Skip to content

Support specifying extensions in the config #10828

Closed
@sindresorhus

Description

@sindresorhus

The 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.

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbreakingThis change is backwards-incompatiblecoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions