Closed ekulikov-flocktory closed 4 years ago
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.
I've created the test project with
.eslintrc.js
that usesbabel-eslint
parser: https://github.com/ekulikov-flocktory/eslint-plugin-svelte3-testThere are two quite the same files:
index.js
andindex.svelte
. If you runnpx eslint index.js
, you will see no errors. But if you runnpx eslint index.svelte
you will see "Parser error", which comes fromeslint-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
.