Skip to content

Added specific eslint rules for typescript tests #2634

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,18 @@ overrides:
'@typescript-eslint/type-annotation-spacing': off
- files: '**/__*__/**'
rules:
'@typescript-eslint/consistent-type-assertions':
[error, { assertionStyle: as, objectLiteralTypeAssertions: allow }]
'@typescript-eslint/no-non-null-assertion': off
'@typescript-eslint/restrict-plus-operands': off
'@typescript-eslint/no-floating-promises': off
'@typescript-eslint/no-invalid-this': off
'@typescript-eslint/no-throw-literal': off
'@typescript-eslint/require-await': off
'@typescript-eslint/await-thenable': off
'prefer-promise-reject-errors': 0
Copy link
Member

Choose a reason for hiding this comment

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

Also please use off

Copy link
Member Author

Choose a reason for hiding this comment

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

No all rules allow off as value, it gives an error. I think only TS rules allow off value.
image

'no-new-wrappers': 0
Copy link
Member

Choose a reason for hiding this comment

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

These are standard ESLint rules so they should work on both Flow and TS.
Can you please give an example of why you disabled them?

Copy link
Member Author

Choose a reason for hiding this comment

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

Some of the tests are creating wrapped instances of primitives (for example - isCollection-test.js).
At the moment it has // eslint-disable-next-line no-new-wrappers set on those lines, but isn't it better to disable it on a global level? there are multiple places that does that.

'no-throw-literal': 0
node/no-unpublished-import: off
node/no-unpublished-require: off
import/no-restricted-paths: off
Expand Down