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

fix: import sequelize as a type #349

Merged
merged 4 commits into from
Oct 15, 2020
Merged

fix: import sequelize as a type #349

merged 4 commits into from
Oct 15, 2020

Conversation

mmkal
Copy link
Contributor

@mmkal mmkal commented Oct 13, 2020

also ignore errors when importing, so users not using sequelize storage don't hit typescript errors

Fixes #348

also ignore errors when importing, so users not using sequelize storage don't hit typescript errors
@mmkal mmkal requested a review from papb October 13, 2020 14:17
Copy link
Member

@papb papb left a comment

Choose a reason for hiding this comment

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

.eslintrc.js Outdated
@@ -34,7 +34,7 @@ module.exports = {
'jest/expect-expect': ['error', { assertFunctionNames: ['expect', 'expectTypeOf', 'verify'] }],

'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-expect-error': false }],
'@typescript-eslint/ban-ts-comment': 'off', // covered by prefer-ts-expect-error
Copy link
Member

Choose a reason for hiding this comment

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

I think '@typescript-eslint/ban-ts-comment' checks more things than just @ts-ignore and @ts-expect-error, doesn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I've changed this to allow ts-ignore and ts-expect-error only with explanations. Even though ts-ignore is whitelisted, prefer-ts-expect-error will still complain if you try to use it, so to use ts-ignore you need an explanation and a eslint-disable-next-line. Which is a good thing IMO, ts-ignore is dangerous and should only be used rarely!

@mmkal mmkal merged commit 4b6b3d2 into master Oct 15, 2020
@mmkal mmkal deleted the sequelize-type-import branch October 15, 2020 14:45
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.

Umzug with mongodb fails to compile with tsc
2 participants