fix(lint): import errors (#1649)
This commit is contained in:
parent
a9be3c5191
commit
ea16e55ba3
|
|
@ -29,7 +29,7 @@ import { readProtocolStream } from './crProtocolHelper';
|
|||
import { Events } from './events';
|
||||
import { Protocol } from './protocol';
|
||||
import { CRExecutionContext } from './crExecutionContext';
|
||||
import type { BrowserServer } from '../server/browserServer';
|
||||
import { BrowserServer } from '../server/browserServer';
|
||||
|
||||
export class CRBrowser extends BrowserBase {
|
||||
readonly _connection: CRConnection;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import { ConnectionEvents, FFConnection } from './ffConnection';
|
|||
import { headersArray } from './ffNetworkManager';
|
||||
import { FFPage } from './ffPage';
|
||||
import { Protocol } from './protocol';
|
||||
import type { BrowserServer } from '../server/browserServer';
|
||||
import { BrowserServer } from '../server/browserServer';
|
||||
|
||||
export class FFBrowser extends BrowserBase {
|
||||
_connection: FFConnection;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import * as types from '../types';
|
|||
import { Protocol } from './protocol';
|
||||
import { kPageProxyMessageReceived, PageProxyMessageReceivedPayload, WKConnection, WKSession } from './wkConnection';
|
||||
import { WKPage } from './wkPage';
|
||||
import type { BrowserServer } from '../server/browserServer';
|
||||
import { BrowserServer } from '../server/browserServer';
|
||||
|
||||
const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15';
|
||||
|
||||
|
|
|
|||
|
|
@ -107,17 +107,6 @@ function checkSources(sources) {
|
|||
}
|
||||
if (fileName.endsWith('/api.ts') && ts.isExportSpecifier(node))
|
||||
apiClassNames.add(expandPrefix((node.propertyName || node.name).text));
|
||||
if (!fileName.includes('src/server/')) {
|
||||
// Only relative imports.
|
||||
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
||||
const module = node.moduleSpecifier.text;
|
||||
const isServerDependency = path.resolve(path.dirname(fileName), module).includes('src/server');
|
||||
if (isServerDependency && !node.importClause.isTypeOnly) {
|
||||
const lac = ts.getLineAndCharacterOfPosition(node.getSourceFile(), node.moduleSpecifier.pos);
|
||||
errors.push(`Disallowed import "${module}" at ${node.getSourceFile().fileName}:${lac.line + 1}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.forEachChild(node, visit);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue