chore: fix RxJS import (#11176)
This commit is contained in:
parent
e00b42879b
commit
443ee99a8d
44
.eslintrc.js
44
.eslintrc.js
@ -1,6 +1,25 @@
|
|||||||
|
const {readdirSync} = require('fs');
|
||||||
|
const {join} = require('path');
|
||||||
|
|
||||||
const rulesDirPlugin = require('eslint-plugin-rulesdir');
|
const rulesDirPlugin = require('eslint-plugin-rulesdir');
|
||||||
|
|
||||||
rulesDirPlugin.RULES_DIR = 'tools/eslint/lib';
|
rulesDirPlugin.RULES_DIR = 'tools/eslint/lib';
|
||||||
|
|
||||||
|
function getThirdPartyPackages() {
|
||||||
|
return readdirSync(join(__dirname, 'packages/puppeteer-core/third_party'), {
|
||||||
|
withFileTypes: true,
|
||||||
|
})
|
||||||
|
.filter(dirent => {
|
||||||
|
return dirent.isDirectory();
|
||||||
|
})
|
||||||
|
.map(({name}) => {
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
message: `Import \`${name}\` from the vendored location: third_party/${name}/index.js`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
env: {
|
env: {
|
||||||
@ -104,19 +123,6 @@ module.exports = {
|
|||||||
// ensure we don't have any it.only or describe.only in prod
|
// ensure we don't have any it.only or describe.only in prod
|
||||||
'mocha/no-exclusive-tests': 'error',
|
'mocha/no-exclusive-tests': 'error',
|
||||||
|
|
||||||
'no-restricted-imports': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
patterns: ['*Events', '*.test.js'],
|
|
||||||
paths: [
|
|
||||||
{
|
|
||||||
name: 'mitt',
|
|
||||||
message:
|
|
||||||
'Import `mitt` from the vendored location: third_party/mitt/index.js',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
'import/order': [
|
'import/order': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
@ -234,6 +240,18 @@ module.exports = {
|
|||||||
'@typescript-eslint/no-import-type-side-effects': 'error',
|
'@typescript-eslint/no-import-type-side-effects': 'error',
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: 'packages/puppeteer-core/src/**/*.ts',
|
||||||
|
rules: {
|
||||||
|
'no-restricted-imports': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
patterns: ['*Events', '*.test.js'],
|
||||||
|
paths: [...getThirdPartyPackages()],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
'packages/puppeteer-core/src/**/*.test.ts',
|
'packages/puppeteer-core/src/**/*.test.ts',
|
||||||
|
@ -18,8 +18,8 @@ import type {Readable} from 'stream';
|
|||||||
|
|
||||||
import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||||
import type Protocol from 'devtools-protocol';
|
import type Protocol from 'devtools-protocol';
|
||||||
import {firstValueFrom, from, raceWith} from 'rxjs';
|
|
||||||
|
|
||||||
|
import {firstValueFrom, from, raceWith} from '../../third_party/rxjs/rxjs.js';
|
||||||
import type {CDPSession} from '../api/CDPSession.js';
|
import type {CDPSession} from '../api/CDPSession.js';
|
||||||
import type {WaitForOptions} from '../api/Frame.js';
|
import type {WaitForOptions} from '../api/Frame.js';
|
||||||
import {
|
import {
|
||||||
|
Loading…
Reference in New Issue
Block a user