Avoid using type aware rules in astro plugin
TheElegantCoding opened this issue · comments
Describe the bug
in the eslin-plugin-astro
there is an issue not resolved about type aware rules, this issue
yes this can be avoided just by warning people, but also this affects how the linting rules are in a script tag, in my reproduction i put no-console
rule and only work on the begginnig of the file and not in the script tag, but this can work if we put as they say in this another issue, this config like this, all works
{
files: ["*.astro"],
processor: "astro/client-side-ts"
}
{
files: [ '**/*.astro/*.ts', '*.astro/*.ts' ],
languageOptions:
{
globals: {
...globals.browser
},
parser: parserTs,
parserOptions:
{
project: null
},
sourceType: 'module'
},
keep in mind that we need to override the parserOptions in order to work
i add an example of a working config with no errors in the file example.eslint.config.js
Reproduction
https://github.com/TheElegantCoding/astro-eslint-issue
System Info
System:
OS: Windows 10 10.0.19045
CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Memory: 4.68 GB / 15.87 GB
Binaries:
Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
pnpm: 8.15.5 - ~\AppData\Local\pnpm\pnpm.CMD
bun: 1.1.3 - ~\AppData\Roaming\npm\bun.CMD
Browsers:
Edge: Chromium (123.0.2420.97)
Internet Explorer: 11.0.19041.4355
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Contributions
- I am willing to submit a PR to fix this issue
- I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
i found a possible solution and also an issue that can be related to @stylistic/eslint-plugin
, in the repo of typescript and in the docs ther is this file for disabled type aware rules they mention that in this link in the doc, this could be a way to disable all rules by default and also when i finally run all my config i found the @stylistic/eslint-plugin/eol-last
don't work well
the rule said i have an extra soace in the end of the file, but is false
and when it auto fix do this, putting the tag at the end