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.

Support specifying extensions in the config

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:90
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

20reactions
sindresorhuscommented, Jan 9, 2019

@not-an-aardvark @ilyavolodin Can this be reopened please? It’s a sorely needed feature and the issue has many upvotes.

10reactions
mysticateacommented, May 12, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure ExtensionSettings policy - Chrome Enterprise and ...
Can be used only to configure the default configuration, *. Specifies what types of app or extension users are allowed to install on...
Read more >
Adding File Name Extensions <add> - IIS - Microsoft Learn
Overview The <add> element of the <fileExtensions> collection specifies a unique file name extension to add to the collection of file name ...
Read more >
Specifying Extensions for Files That the Redirect Server ...
List file extensions to augment the standard file extensions you configured. Precede each extension with a period. Make sure that you specify the...
Read more >
x509v3_config - OpenSSL
This is a raw extension that supports all of the defined fields of the certificate extension. Policies without qualifiers are specified by giving...
Read more >
Allowlisting file extensions - Help Docs - HighBond
Use the Server panel of the AX Server Configuration web application to configure the file extension allowlist: To enable or disable the ...
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