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

Thesmi in the last line of the script block is not recognized #102

Closed
2 tasks done
kecrily opened this issue Sep 8, 2022 · 1 comment · Fixed by #105
Closed
2 tasks done

Thesmi in the last line of the script block is not recognized #102

kecrily opened this issue Sep 8, 2022 · 1 comment · Fixed by #105

Comments

@kecrily
Copy link

kecrily commented Sep 8, 2022

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.23.0

What version of eslint-plugin-astro are you using?

0.18.0

What did you do?

Configuration
module.exports = {
  /** @type { import('eslint').Linter.Config } */
  rules: {
    semi: ['error', 'never'],
  },
  overrides: [
    {
      files: ['*.astro'],
      parser: 'astro-eslint-parser',
    },
  ],
}
---
console.log('Hello 1')
console.log('Hello 2');
---

What did you expect to happen?

Recognize the semi of the last statement line like a normal js file.

What actually happened?

Cannot recognize the last line of the statement

Link to Minimal Reproducible Example

https://stackblitz.com/edit/node-qjzrj8?file=index.astro

Run pnpm lint to see the result

Additional comments

I think it's a parser error, but I'm not sure.

@ota-meshi
Copy link
Owner

Thank you for posting the issue. Apparently the semi rule doesn't recognize .astro's --- token. Therefore it is incompatible with semi: ['error', 'never']. I think we need to create an extended semi rule.v

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

Successfully merging a pull request may close this issue.

2 participants