Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for setting file extensions in configuration file #13158

Closed
fishcharlie opened this issue Apr 8, 2020 · 3 comments
Closed

Allow for setting file extensions in configuration file #13158

fishcharlie opened this issue Apr 8, 2020 · 3 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@fishcharlie
Copy link

The version of ESLint you are using.

6.8.0

The problem you want to solve.

From the ESLint website:

Currently the sole method for telling ESLint which file extensions to lint is by specifying a comma separated list of extensions using the --ext command line option.

Your take on the correct solution to problem.

Considering that ESLint is getting more TypeScript users, it seems there should be an option to modify the extensions being used in ESLint in the .eslintrc.js file.

At the very least it should now run lint by default on TypeScript files now. Or have a better method for that. eslint . became muscle memory for me. It's now gonna be a huge pain to have to change that to lint TypeScript files.

Are you willing to submit a pull request to implement this change?

Not at this time due to the lack of knowledge of the code base. I will take a look tho and see how far I can get.


Other Info

Just a bit more context about my situation, here is my .eslintrc.js file. The goal is to have the standard linter on .js files and use TypeScript linting on .ts files. That way we can lint our mixed project.

module.exports = {
	"env": {
		"commonjs": true,
		"es6": true,
		"node": true
	},
	"extends": "eslint:recommended",
	"overrides": [
		{
			"files": ["**/*.ts"],
			"parser": "@typescript-eslint/parser",
			"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
			"plugins": ["@typescript-eslint"]
		}
	],
	"globals": {
		"Atomics": "readonly",
		"SharedArrayBuffer": "readonly"
	},
	"parserOptions": {
		"ecmaVersion": 2018
	},
	"rules": {
		"indent": [
			"error",
			"tab"
		],
		"linebreak-style": [
			"error",
			"unix"
		],
		"quotes": [
			"error",
			"double"
		],
		"semi": [
			"error",
			"always"
		]
	}
};
@fishcharlie fishcharlie added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Apr 8, 2020
@g-plane
Copy link
Member

g-plane commented Apr 18, 2020

I'm not sure if it's duplicated with #10828 .

@g-plane g-plane added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Apr 18, 2020
@fishcharlie
Copy link
Author

@g-plane It looks like it?? I'm looking through #12677 and it doesn't look to have any documentation updates for specifying extensions in the configuration file. So did it not get implemented or did the documentation just not get updated (or not updated in that PR)?

@nzakas
Copy link
Member

nzakas commented Apr 23, 2020

The docs were updated:
https://github.com/eslint/eslint/pull/12677/files#diff-f92aa5edd27b97e8ba555fe7b8806310

Closing, as this functionality is already implemented.

@nzakas nzakas closed this as completed Apr 23, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Oct 21, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

3 participants