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

build: align tsconfigs #2132

Merged
merged 11 commits into from
May 21, 2024
Merged

build: align tsconfigs #2132

merged 11 commits into from
May 21, 2024

Conversation

YossiSaadi
Copy link
Contributor

https://monday.monday.com/boards/3532714909/pulses/6677817632

  • We’re not using experimental decorators, so experimentalDecorators option is not needed
  • We’re not using experimentalDecorators option, so emitDecoratorMetadata option is not needed
  • The reason we were told by IDEs and TS that we do not need to import React from react, is that we used jsx with react-jsx instead of react. react-jsx is intended for React 17+, and it make sure you do not import React if you do not use it. We’re using 16+, so we need react, not react-jsx.
  • To catch places where we accidentally removed the import of React, I’ve changed the eslint rule of react/react-in-jsx-scope to error, at the first place it is a mistake to have it disabled, as we use a React version which requires it.
  • Although this last one, we have 2000 lint errors for places where we do not import React, so I've overriden it for tests and stories for now - we should fix this some day
  • Now tsconfig.json refers to the modern way we do stuff - esm, and cjs is handled in a different file, instead of the opposite (so tsconfig.esm.json is now tsconfig.json, and the module config on old tsconfig.json that pointed to CommonJS is now at tsconfig.cjs.json)
  • Everything that is not related to both storybook and our exported lib is now at tsconfig.base.json that both inherit from. tsconfig.json in the root now includes only lib related config, and tsconfig.json in .storybook now includes only storybook related config

…e esm, not cjs. also exclude is now in tsconfig
…". also, throw errors when not importing react

we were warned by ides and ts to not import react. it was caused by this. it also caused components which did not import react, and this is a breaking behavior for react 16 consumers
@YossiSaadi YossiSaadi requested a review from a team as a code owner May 21, 2024 09:57
@YossiSaadi YossiSaadi merged commit 6c999ad into master May 21, 2024
9 of 10 checks passed
@YossiSaadi YossiSaadi deleted the build/yossi/align-tsconfigs branch May 21, 2024 17:12
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.

2 participants