chore: apply "injected" eslint rules to "isomorphic" (#34953)
This commit is contained in:
parent
ad64f8d859
commit
70cc2b14e2
|
@ -253,7 +253,11 @@ export default [{
|
|||
'no-console': 'off'
|
||||
}
|
||||
}, {
|
||||
files: ['packages/playwright-core/src/server/injected/**/*.ts'],
|
||||
files: [
|
||||
'packages/playwright-core/src/server/injected/**/*.ts',
|
||||
'packages/playwright-core/src/server/isomorphic/**/*.ts',
|
||||
'packages/playwright-core/src/utils/isomorphic/**/*.ts',
|
||||
],
|
||||
languageOptions: languageOptionsWithTsConfig,
|
||||
rules: {
|
||||
...noWebGlobalsRules,
|
||||
|
|
|
@ -129,10 +129,13 @@ export function source() {
|
|||
|
||||
function serialize(value: any, handleSerializer: (value: any) => HandleOrValue, visitorInfo: VisitorInfo): SerializedValue {
|
||||
if (value && typeof value === 'object') {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (typeof globalThis.Window === 'function' && value instanceof globalThis.Window)
|
||||
return 'ref: <Window>';
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (typeof globalThis.Document === 'function' && value instanceof globalThis.Document)
|
||||
return 'ref: <Document>';
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (typeof globalThis.Node === 'function' && value instanceof globalThis.Node)
|
||||
return 'ref: <Node>';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue