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

It seems that !lintAllEsApis is not working #447

Open
kshshe opened this issue Jan 25, 2021 · 0 comments
Open

It seems that !lintAllEsApis is not working #447

kshshe opened this issue Jan 25, 2021 · 0 comments

Comments

@kshshe
Copy link

kshshe commented Jan 25, 2021

Hi! I want to add eslint-plugin-compat to my project, and the trouble is that plugin ignores babel built-in polyfills. I have tried to debug it, and it seems that the reason is here:

compat.ts:165

nodes.filter((node) => {
    return lintAllEsApis ? true : node.kind !== "es";
})

This code ignores node if node.kind is es, but there is no es property in caniuse nodes. Because of this, duplicated rules affects lint process anyway (Promise for example).

For now I fixed it in .eslintrc.js like this, but it seems to be a bad practice:

polyfills: [
    'es:all',
    ...Object.keys(require('@babel/preset-env/lib/polyfills/corejs3/built-in-definitions').BuiltIns),
],

You can see the demo here: https://github.com/kshshe/eslint-plugin-compat-demo

@kshshe kshshe changed the title It seems that lintAllEsApis === false is not working It seems that !lintAllEsApis === false is not working Jan 25, 2021
@kshshe kshshe changed the title It seems that !lintAllEsApis === false is not working It seems that !lintAllEsApis is not working Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant