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

Auto-detect original ESLint file in any form #722

Open
JoshuaKGoldberg opened this issue Sep 20, 2020 · 1 comment
Open

Auto-detect original ESLint file in any form #722

JoshuaKGoldberg opened this issue Sep 20, 2020 · 1 comment
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request

Comments

@JoshuaKGoldberg
Copy link
Member

🚀 Feature Request

Following #58, https://eslint.org/docs/user-guide/configuring states:

Configuration Files - use a JavaScript, JSON or YAML file to specify configuration information for an entire directory and all of its subdirectories. This can be in the form of an .eslintrc.* file or an eslintConfig field in a package.json file, both of which ESLint will look for and read automatically, or you can specify a configuration file on the command line.

Existing Behavior

tslint-to-eslint-config will only look at .eslintrc.js by default if not explicitly told a path.

config: "./.eslintrc.js",

Change Proposal

Add a function dependency to runCli that determines the initial script path for ESLint, such as .eslintrc.js, .eslintrc.yml.

The tricky part here will be supporting package.json eslintConfig...

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request labels Sep 20, 2020
@KingDarBoja
Copy link
Collaborator

KingDarBoja commented Sep 20, 2020

Not so tricky part, just read the package.json file and check if it has the key eslintConfig using the resolveJsonModule compiler option to read json files.

This read should be the fallback behaviour in case of missing .eslintrc.* file, otherwise, throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants