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

fix(rule-finder): pass a file to getConfigForFile #306

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@kentcdodds
Copy link
Collaborator

commented Jul 10, 2019

This fixes a compatibility issue with eslint@6 which now passes the given file to path.resolve (https://github.com/eslint/eslint/blob/1fb362093a65b99456a11029967d9ee0c31fd697/lib/cli-engine/cli-engine.js#L905) which will throw if no file is given.

I tried this locally and it works without issue.

fix(rule-finder): pass a file to getConfigForFile
This fixes a compatibility issue with eslint@6 which now passes the given file to `path.resolve` (https://github.com/eslint/eslint/blob/1fb362093a65b99456a11029967d9ee0c31fd697/lib/cli-engine/cli-engine.js#L905) which will throw if no file is given.
@@ -23,7 +23,7 @@ function _getConfig(configFile) {
// Point to the particular config
configFile
});
return cliEngine.getConfigForFile();

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 10, 2019

Collaborator

doesn't this only return the proper config for the config file, which might be yaml or .eslintrc json?

Config files are often not JS.

This comment has been minimized.

Copy link
@kentcdodds

kentcdodds Jul 10, 2019

Author Collaborator

Perhaps. Consider this more of a bug report than a PR then. I'm not sure what the proper solution for this is. Because for this project there's not really a specific file that we're looking for a config for 🤔

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 10, 2019

Collaborator

#304 is the bug report, which includes my latest attempt: master...ljharb:eslint_6

This comment has been minimized.

Copy link
@kentcdodds

kentcdodds Jul 10, 2019

Author Collaborator

🤦‍♂ I apologize. Totally didn't even think to check whether it had been reported. This is embarrassing.

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 10, 2019

Collaborator

No worries, to be fair I was super excited when I saw the PR notification because this package's v6 support is blocking me in two shared configs :-/

@kentcdodds kentcdodds closed this Jul 10, 2019

@kentcdodds kentcdodds deleted the pr/eslint6compat branch Jul 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.