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

chore: fix ESLint and TypeScript issues #113

Merged
merged 2 commits into from Jan 10, 2023

Conversation

Dschungelabenteuer
Copy link
Member

@Dschungelabenteuer Dschungelabenteuer commented Dec 28, 2022

What Changed

  • Removed plugin:node/recommended from .eslintrc.js because it caused ESLint to raise a lot of node/no-unsupported-features/es-syntax errors in TypeScript files. I'm not sure why it was actually used, please let me know!
  • Explicitly set ESLint parser to @typescript-eslint/parser so that it actually processes TypeScript files.
  • Added @typescript-eslint devDependencies for better compatibility between ESLint and TypeScript (it disables conflicted rules e.g. no-unused-args when actually defining a type, etc.)
  • Refined a bit some typing for the no-uninstalled-addons rule so that is is slightly more precise
  • Ran the autofix in the whole project and manually fixed remaining warnings/errors
  • Made sure to provide adequate fallbacks when using optional chaining after the above changes
  • Unused types inside lib/types/index.ts (RecommendedConfig, the generic TOptions is on StorybookRuleMetaDocs which itself doesn't seem to be used anywhere) got removed.

What did not change

  • There is a whole block with an attached TODO note which raises ESLint problems: I started to look into it. However, required changes look a bit less trivial, I guess it deserves a PR on its own so that it can be further discussed.
  • Same thing about TypeScript and ESLint errors on the generated example rule.

Checklist

Check the ones applicable to your change:

  • Ran yarn update-all
  • Tests are updated
  • Documentation is updated

Change Type

Indicate the type of change your pull request is:

  • maintenance
  • documentation
  • patch
  • minor
  • major

@Dschungelabenteuer Dschungelabenteuer marked this pull request as ready for review December 28, 2022 20:09
@Dschungelabenteuer Dschungelabenteuer marked this pull request as draft December 28, 2022 23:09
@yannbf yannbf marked this pull request as ready for review January 10, 2023 16:02
@yannbf yannbf added the patch Increment the patch version when merged label Jan 10, 2023
@yannbf
Copy link
Member

yannbf commented Jan 10, 2023

Hey @Dschungelabenteuer thanks for this PR! Seems like it provides good improvements, thanks for that <3

@yannbf yannbf merged commit 5e4b7df into storybookjs:main Jan 10, 2023
@github-actions
Copy link

🚀 PR was released in v0.6.10 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants