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

Plugin skips parser settings #57

Closed
ekulikov-flocktory opened this issue Apr 22, 2020 · 1 comment
Closed

Plugin skips parser settings #57

ekulikov-flocktory opened this issue Apr 22, 2020 · 1 comment
Labels
invalid This doesn't seem right

Comments

@ekulikov-flocktory
Copy link

ekulikov-flocktory commented Apr 22, 2020

I've created the test project with .eslintrc.js that uses babel-eslint parser:
https://github.com/ekulikov-flocktory/eslint-plugin-svelte3-test

There are two quite the same files: index.js and index.svelte.
If you run npx eslint index.js, you will see no errors.
But if you run npx eslint index.svelte you will see "Parser error", which comes from eslint-plugin-svelte3 when it tries to parse the file.

It seems like eslint-plugin-svelte3 should use the parser (including it's settings) described at the .eslintrc.js.

@Conduitry Conduitry added the invalid This doesn't seem right label Apr 22, 2020
@Conduitry
Copy link
Member

Before ESLint gets ahold of the component and parses it according to whatever you specify in that configuration, the Svelte compiler does need to be run on the component (to extract information about what variables are used in the template, etc.), and Svelte doesn't support the optional chaining syntax yet. You'd need a preprocessor for Svelte to be able to compile the component, but there's currently no way to tell this plugin about that preprocessor. See #10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants