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

Configuring eslint to use @babel/eslint-parser also requires passing babelOptions #159

Open
DamienCassou opened this issue May 5, 2021 · 1 comment

Comments

@DamienCassou
Copy link
Contributor

Hi,

I recently switched to using @babel/eslint-parser as eslint's parser:

.eslintrc.js:

module.exports = {
	parser: "@babel/eslint-parser",
	parserOptions: {
		sourceType: "module",
	},
	...
}

This allows our project to use still-unreleased JS syntax.

Unfortunately, this also seems to break eslint_d.js. As recommended by @aaronjensen, I had to pass parserOptions.babelOptions in my .eslintrc.js to make eslint_d.js work:

.eslintrc.js:

module.exports = {
	parser: "@babel/eslint-parser",
	parserOptions: {
		sourceType: "module",
		babelOptions: { configFile: require.resolve("./babel.config.js") },
	},
	...
}

Do you know why? Is there anything you can do at the eslint_d.js level so we don't have to do that?

$ eslint_d --version
v7.25.0 (eslint_d v10.0.4)
@mantoni
Copy link
Owner

mantoni commented May 9, 2021

Thanks for opening an issue for this. I recall that there have been similar issues before and I'm not sure why eslint_d behaves differently from regular eslint when loading plugins or external parsers. If you have time to investigate, I'm happy to assist and review a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants