Closed mpellegrini closed 1 year ago
Thank you for posting the issue. I've been busy and haven't tried it yet, but I suspect missing processor settings in your configuration.
{
// ...
processor: "svelte/svelte",`
// ...
}
@ota-meshi Thank you very much! That was it!! I wish the eslint --print-config...
would show the configured processors as well, would have made tracking this down easier. But that is for the eslint team.
For completeness this was the final eslint.config.js with your suggested change (Note: this is not a complete working config, just the bare min config for this issue.)
import { defineFlatConfig } from 'eslint-define-config'
import typescript from '@typescript-eslint/eslint-plugin'
import svelte from 'eslint-plugin-svelte'
import tsParser from '@typescript-eslint/parser'
import svelteParser from 'svelte-eslint-parser'
export default defineFlatConfig([
{
files: ['**/*.svelte'],
plugins: {
svelte,
'@typescript-eslint': typescript,
},
processor: 'svelte/svelte',
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsParser,
},
},
rules: {
'svelte/comment-directive': [
'error',
{
reportUnusedDisableDirectives: true,
},
],
'svelte/no-at-html-tags': 'error',
},
},
{
ignores: ['.svelte-kit'],
},
])
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
8.45.0
What version of
eslint-plugin-svelte
are you using?2.32.4
What did you do?
Configuration
```javascript import { defineFlatConfig } from 'eslint-define-config' import typescript from '@typescript-eslint/eslint-plugin' import svelte from 'eslint-plugin-svelte' import tsParser from '@typescript-eslint/parser' import svelteParser from 'svelte-eslint-parser' export default defineFlatConfig([ { files: ['**/*.svelte'], plugins: { svelte, '@typescript-eslint': typescript, }, languageOptions: { parser: svelteParser, parserOptions: { parser: tsParser, }, }, rules: { 'svelte/comment-directive': [ 'error', { reportUnusedDisableDirectives: true, }, ], 'svelte/no-at-html-tags': 'error', }, }, { ignores: ['.svelte-kit'], }, ]) ```What did you expect to happen?
Expected the rule
svelte/no-at-html-tags
to be disabled on the next lineWhat actually happened?
rule
svelte/no-at-html-tags
was not disabled on the next linereceived the following error
Link to GitHub Repo with Minimal Reproducible Example
https://github.com/mpellegrini/eslint-config-svelte-issue-repro
If it helps here is a pre-configured stackblitz project - https://stackblitz.com/edit/vitejs-vite-ladvbz
Additional comments
I have also included a
.eslintrc.cjs
file that I believe I configured exactly the same way as theeslint.confg.js
file. If you renameeslint.confg.js
toeslint.confg.js.disable
and run eslint, the rule is disabled.I have tried to pair down eslint configuration to the bare minimum for both files. I also compared the results of
agianst both configs and they appear to be the same (but obviously the format is different). I just can't figure out what is causing this not to work in the new eslint flat config model.
Thanks you in advance.