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

Parse error on any token inside a function #2

Closed
maxmilton opened this issue Feb 16, 2019 · 4 comments
Closed

Parse error on any token inside a function #2

maxmilton opened this issue Feb 16, 2019 · 4 comments
Labels
invalid This doesn't seem right

Comments

@maxmilton
Copy link

When parsing a function inside a svelte component <script> block, a ParseError is thrown on the first token inside the function:

repro1-func

Interestingly, it also throws then the function is commented out:

repro2-commented

Same thing for arrow functions:

repro3-arrow-func

@maxmilton
Copy link
Author

maxmilton commented Feb 16, 2019

After a little debugging I discovered these errors are actually being thrown by eslint-plugin-html with:

  settings: {
    'html/html-extensions': ['.html', '.svelte'],
  }

Removing the settings line fixes those parse errors. Might be worth adding a note about this to the readme.

@Conduitry
Copy link
Member

There is a line in the readme "Also make sure you do not have eslint-plugin-html enabled on the files you want linted as Svelte components, as the two plugins won't get along." but maybe this should be put in some more prominent location?

@maxmilton
Copy link
Author

Sorry @Conduitry , you're totally right! User error 😬

I did read through the readme when I ran into the issue but somehow I missed that sentence. Probably because it's under the "CLI" heading.

Somewhere more prominent would be ideal or even adding **Important**: .

@Conduitry
Copy link
Member

👍 Moved the eslint-plugin-html note to a more prominent spot, and added an 'important' label.

@Conduitry Conduitry added the invalid This doesn't seem right label Jul 1, 2019
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