Skip to content

Fix eslint error in pre-commit ci#871

Merged
antocuni merged 1 commit into
pyscript:mainfrom
JeffersGlass:eslint-precommit-fix
Oct 20, 2022
Merged

Fix eslint error in pre-commit ci#871
antocuni merged 1 commit into
pyscript:mainfrom
JeffersGlass:eslint-precommit-fix

Conversation

@JeffersGlass

@JeffersGlass JeffersGlass commented Oct 19, 2022

Copy link
Copy Markdown
Contributor

Fixes an error that causes eslint to fail in specific environments. Let's see if this allows pre-commit CI to pass for a change...

Edit: it passes! Fixes #834

@JeffersGlass JeffersGlass changed the title Test: Fix 'no unnecessary type assertion' Test: Fix eslint error in pre-commit ci? Oct 19, 2022
@JeffersGlass JeffersGlass changed the title Test: Fix eslint error in pre-commit ci? Fix eslint error in pre-commit ci Oct 19, 2022
@JeffersGlass JeffersGlass requested a review from antocuni October 19, 2022 21:11
@JeffersGlass

JeffersGlass commented Oct 19, 2022

Copy link
Copy Markdown
Contributor Author

For what it's worth, the eslint that this change fixed was; "This assertion is unnecessary since it does not change the type of the expression. @typescript-eslint/no-unnucessary-type-assertion"

-  const _global = (window || global) as any;
+  const _global = (window || global);

ESlint wasn't throwing this issue in a generic Ubutnu 22.04 environment nor in Windows 10, but in a docker image of 22:04 (like what Github actions runners use with ubuntu-latest) it error'd. No idea why it's different.

@antocuni antocuni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

brilliant finding!
The ESLint behavior is very weird, but it's good that we finally found it :).

@antocuni antocuni merged commit 29ba943 into pyscript:main Oct 20, 2022
@JeffersGlass JeffersGlass deleted the eslint-precommit-fix branch October 20, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

pre-commit CI is failing

2 participants