-
-
Notifications
You must be signed in to change notification settings - Fork 48
ESLint Flat Configuration #422
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
Comments
Yes, of course. Firstly, I edited the repo slightly to hide the old Now when I am talking about enabling/disabling the TypeScript section, I am referring to this part: It is disabled at the moment, hence why you see the error with the Svelte file and no warnings about the TypeScript file. If you enable/uncomment these lines, you should see the error with the TypeScript file, and the error with the Svelte file. |
Hmmm... If you add |
Interestingly, that does fix the issue. It would appear that the TypeScript parser configuration is shared between each entry of the ESLint config. I'm not sure this is the intended effect, and perhaps this is a bug with the TypeScript parser itself (I will raise this in their repo). Not sure how you want to resolve this as far as this plugin is concerned. I think adding a segment to the README would be sufficient. Would you like to me to send through a PR later today? |
I agree. I think it's a bug with the After asking in the typescript-eslint repo, if it is a |
I have raised an issue with |
Thanks! |
This has been closed upstream as "working as intended". Here's the response from @bradzacher:
In light of this, I will create a PR later today to mention this in the README. |
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
8.36.0
What version of
eslint-plugin-svelte
are you using?4.2.1
What did you do?
Trying to get linting to work for both TypeScript files and Svelte using the new ESLint flat config. So far, I can get the ESLint config to work for either TypeScript file or Svelte files, but not both due to an issue relating to
tsconfig.ts
. I don't know whether this is a bug in my configuration, or whether it is an issue with this plugin and/or the TypeScript plugin.While I understand the flat config is still very new and not fully released, ESLint does plan for the new configuration file to replace the existing
.eslintrc.cjs
files.eslint.config.js
src/routes/+pages.svelte
src/test.ts
What did you expect to happen?
Errors to be reported in both the TypeScript and the Svelte files.
What actually happened?
If I enable both the Svelte and TypeScript configurations in the ESLint flat configuration, the Svelte file produces the following error (noting that the TypeScript file works fine):
If I disable the TypeScript section, the Svelte file produces the expected errors, but then the TypeScript file produces no lints (as it is no longer included).
Link to GitHub Repo with Minimal Reproducible Example
JP-Ellis/eslint-plugin-svelte-mwe
The text was updated successfully, but these errors were encountered: