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

Final forbidden semicolon in frontmatter ignored #165

Closed
2 tasks done
igorakkerman opened this issue Feb 3, 2023 · 1 comment
Closed
2 tasks done

Final forbidden semicolon in frontmatter ignored #165

igorakkerman opened this issue Feb 3, 2023 · 1 comment

Comments

@igorakkerman
Copy link

igorakkerman commented Feb 3, 2023

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.33.0

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

0.23.0

What did you do?

A final semicolon in the frontmatter of an `*.astro` file is not flagged as a warning despite forbidden by a rule. This is the eslint configuration file. ```jsonc { "root": true, "parser": "@typescript-eslint/parser", "plugins": [ "@typescript-eslint" ], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "plugin:astro/recommended", ], "overrides": [ { "files": [ "*.astro" ], "parser": "astro-eslint-parser", "parserOptions": { "parser": "@typescript-eslint/parser", "extraFileExtensions": [ ".astro" ], }, "rules": { // override/add rules settings here, such as: // "astro/no-set-html-directive": "error" }, }, ], "rules": { "quotes": [ "warn", "single" ], "semi": [ "warn", "never" ], "@typescript-eslint/ban-ts-comment": [ "error", { "ts-ignore": "allow-with-description" }, ], "@typescript-eslint/no-non-null-assertion": "off", }, } ``` Please find the Astro file below.

What did you expect to happen?

Running eslint should show 2 warnings about both semicolons and eslint --fix should remove them.

What actually happened?

With eslint only one warning is shown and eslint --fix only removes the first semicolon.

pnpm lint
> @example/[email protected] lint C:\Lokal\DYNAMITE\dynamite-cv\astro-web
> eslint .


...\astro-web\src\pages\semi.astro
  2:61  warning  Extra semicolon  semi

✖ 1 problem (0 errors, 1 warning)
  0 errors and 1 warning potentially fixable with the `--fix` option.

Link to Minimal Reproducible Example

---
console.log('This semicolon is flagged as a warning ->')
console.log('This one isn\'t 🤷‍♂️ ->');
---
<html><body>Don't look up!</body></html>

Additional comments

No response

@ota-meshi
Copy link
Owner

duplicate of #102

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

2 participants