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

Warning position is wrong when the warning is in script and TypeScript parser is used #219

Closed
2 tasks done
sapphi-red opened this issue Jun 24, 2023 · 2 comments · Fixed by #220
Closed
2 tasks done

Comments

@sapphi-red
Copy link

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

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

0.27.1

What did you do?

Configuration
{
  "root": true,
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:astro/recommended"
  ],
  "parserOptions": {
    "ecmaVersion": 2022,
    "parser": "@typescript-eslint/parser"
  }
}
<script>


  const foo = document.querySelector('foo')!
  console.log(foo)
</script>

What did you expect to happen?

eslint . outputs

4:14  warning  Forbidden non-null assertion  @typescript-eslint/no-non-null-assertion

What actually happened?

eslint . outputs

2:14  warning  Forbidden non-null assertion  @typescript-eslint/no-non-null-assertion

Link to Minimal Reproducible Example

  1. Open https://github.com/sapphi-red-repros/eslint-plugin-astro-script-ts-pos
  2. npm i
  3. npm run lint

Additional comments

The warning position is correct for .ts files. So I thought this is a bug in eslint-plugin-astro instead of typescript-eslint.

@ota-meshi
Copy link
Owner

Thanks for this report. I will fix it.

@sapphi-red
Copy link
Author

Thank you!

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