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.

Configure file extensions in .eslintrc

See original GitHub issue

AFAICT, this is not supported at the moment. Example:

  1. You have a Node app
  2. Your React components use the .jsx extension.
  3. You have one .eslintrc at the root for Node, and nested .eslintrc with jsx: true.

It seems you have to run eslint . --ext .js,.jsx which is ok, but my intent is really to scope parsing of .jsx files to the subtree that contains them. That’s why I thought rc-level config might make sense.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:8
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
not-an-aardvarkcommented, Nov 16, 2017

@ljharb

It would still be ideal to replicate the --ext option in config files; every CLI option and config option should generally be symmetric.

Making CLI options and config options symmetric is not really a goal at the moment; there are some CLI options like --fix which intentionally require user opt-in.

For more discussion on specifying extensions without command-line flags, see https://github.com/eslint/eslint/issues/8920.

For more discussion on statically declaring command-line flags in general, see https://github.com/eslint/eslint/issues/9484.

1reaction
not-an-aardvarkcommented, Nov 16, 2017

This is now possible (see the documentation here).

{
  "overrides": {
    "files": "your/globs/**/*.js",
    "rules": {
      "some-rule": "off"
    }
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration Files - ESLint - Pluggable JavaScript Linter
You can put your ESLint project configuration in a configuration file. You can include built-in rules, how you want them enforced, plugins with...
Read more >
Setting file extensions in ESLint configuration using overrides
I'm trying to specify the file extensions that ESLint should check by setting overrides in the configuration rather than needing to use the ......
Read more >
.eslintrc without file extension is deprecated - DEV Community ...
As you may know, the ESLint officially encourages us to give an adequate file extension to .eslintrc . ESLint supports configuration files in ......
Read more >
Apply different eslint sheets for different file extensions
This works perfectly from the command line but not in the IDE's editor. The IDE can only select an eslint configuration based on...
Read more >
Configuration File - Prettier
Overrides let you have different configuration for certain file extensions, folders and specific files. Prettier borrows ESLint's override format. ... files is ...
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