-
Notifications
You must be signed in to change notification settings - Fork 22
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: update typescript and typescript/eslint plugin to v4 #37
chore: update typescript and typescript/eslint plugin to v4 #37
Conversation
…-eslint, typescript temp fix - errors need to be fixed and check enabled
reduces errors due to upgrade from 80+ to 60+
… type errors clean install yarn lock file
@trevor-bliss Can you please give this a glance |
@@ -11,6 +11,8 @@ import { htmlFileWithA11yIssues, htmlFileWithNoA11yIssues } from '@sa11y/test-ut | |||
import { A11yError } from '@sa11y/format'; | |||
import { axeRuntimeExceptionMsgPrefix } from '@sa11y/common'; | |||
|
|||
// TODO (chore): Raise issue with WebdriverIO - 'sync' missing 'default' in ts def | |||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires | |||
const sync = require('@wdio/sync').default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this?
import sync from '@wdio/sync';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that. It results in the tests being skipped with wdio runner reporting that 1 suite passed without running any tests weirdly and also the following error.
TS1259: Module '"@wdio/sync"' can only be default-imported using the 'esModuleInterop' flag webdriverio.d.ts(46, 5): This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
I do have the "esModuleInterop": true,
in tsconfig.
Also tried import sync = require('@wdio/sync');
as suggested in the TypeScript: Handbook - Modules
When exporting a module using export =, TypeScript-specific import module = require("module") must be used to import the module.
Even though typescript is happy with that, the tests continue to be skipped.
Think this could be related to the fact that ts-node is used by wdio.conf.js and it might be interpreting the tsconfig differently? I tried reusing babel (which is used by jest) instead of ts-node but couldn't get it working (webdriverio/webdriverio#5588)
Please let me know if you have any suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO to reflect this for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm weird... Yeah that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for importing the sync API from wdio, rest looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @trevor-bliss !
@@ -11,6 +11,8 @@ import { htmlFileWithA11yIssues, htmlFileWithNoA11yIssues } from '@sa11y/test-ut | |||
import { A11yError } from '@sa11y/format'; | |||
import { axeRuntimeExceptionMsgPrefix } from '@sa11y/common'; | |||
|
|||
// TODO (chore): Raise issue with WebdriverIO - 'sync' missing 'default' in ts def | |||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires | |||
const sync = require('@wdio/sync').default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that. It results in the tests being skipped with wdio runner reporting that 1 suite passed without running any tests weirdly and also the following error.
TS1259: Module '"@wdio/sync"' can only be default-imported using the 'esModuleInterop' flag webdriverio.d.ts(46, 5): This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
I do have the "esModuleInterop": true,
in tsconfig.
Also tried import sync = require('@wdio/sync');
as suggested in the TypeScript: Handbook - Modules
When exporting a module using export =, TypeScript-specific import module = require("module") must be used to import the module.
Even though typescript is happy with that, the tests continue to be skipped.
Think this could be related to the fact that ts-node is used by wdio.conf.js and it might be interpreting the tsconfig differently? I tried reusing babel (which is used by jest) instead of ts-node but couldn't get it working (webdriverio/webdriverio#5588)
Please let me know if you have any suggestions.
@@ -11,6 +11,8 @@ import { htmlFileWithA11yIssues, htmlFileWithNoA11yIssues } from '@sa11y/test-ut | |||
import { A11yError } from '@sa11y/format'; | |||
import { axeRuntimeExceptionMsgPrefix } from '@sa11y/common'; | |||
|
|||
// TODO (chore): Raise issue with WebdriverIO - 'sync' missing 'default' in ts def | |||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires | |||
const sync = require('@wdio/sync').default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm weird... Yeah that's fine.
after merging upgrade to typescript 4 (salesforce#37) into master
Fixes #27
Chores 🧹
Refactor ♻
Post merge