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

feat: add support for flat config #708

Merged
merged 4 commits into from
Mar 18, 2024
Merged

feat: add support for flat config #708

merged 4 commits into from
Mar 18, 2024

Conversation

Copy link

changeset-bot bot commented Mar 17, 2024

🦋 Changeset detected

Latest commit: e3c0beb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@baseballyama baseballyama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much as always!

@baseballyama baseballyama merged commit d597a69 into main Mar 18, 2024
12 checks passed
@baseballyama baseballyama deleted the flat-config branch March 18, 2024 03:33
@pxeger
Copy link

pxeger commented Mar 21, 2024

This is awesome, thanks! I couldn't get it to work with TypeScript and typed linting though. I guess this is because the svelte parser is overriding languageOptions so parserOptions.project doesn't get forwarded? Or maybe I've just not configured it properly, because Parser surely shouldn't be undefined? (Tested with a new svelte-kit project, with this eslint.config.js)

$ eslint . --max-warnings 0

Oops! Something went wrong! :(

ESLint: 8.57.0

Error: Error while loading rule '@typescript-eslint/await-thenable': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Parser: undefined
Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.
Occurred while linting src/routes/+layout.svelte
    at throwError (node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:40:11)
    at getParserServices (node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:20:9)
    at create (node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js:46:55)
    at Object.create (node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:38:20)
    at createRuleListeners (node_modules/eslint/lib/linter/linter.js:895:21)
    at node_modules/eslint/lib/linter/linter.js:1066:110
    at Array.forEach (<anonymous>)
    at runRules (node_modules/eslint/lib/linter/linter.js:1003:34)
    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (node_modules/eslint/lib/linter/linter.js:1730:31)
    at Linter._verifyWithFlatConfigArray (node_modules/eslint/lib/linter/linter.js:1861:21)

@polyzen
Copy link
Contributor

polyzen commented Mar 21, 2024

IMO tseslint shouldn't be pushing everyone to use their ts.config helper. Here's what I managed to come up with:
https://gitlab.archlinux.org/archlinux/neoasknot/-/blob/5a71f8b3a402dfc6944fb5da6c44e03180afb8b6/eslint.config.js

Not yet using eslint-plugin-svelte's new flat config stuff as it's still only in next releases.

@oosawy
Copy link

oosawy commented Mar 31, 2024

I had trouble figuring out why the flat config at the top of README wasn't working and finally got to the fact that it was behind the next tag. that would be better remove the description once

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 this pull request may close these issues.

None yet

5 participants