mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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');
|
||||
|
||||
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 = {
|
||||
root: true,
|
||||
env: {
|
||||
@ -104,19 +123,6 @@ module.exports = {
|
||||
// ensure we don't have any it.only or describe.only in prod
|
||||
'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': [
|
||||
'error',
|
||||
{
|
||||
@ -234,6 +240,18 @@ module.exports = {
|
||||
'@typescript-eslint/no-import-type-side-effects': 'error',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: 'packages/puppeteer-core/src/**/*.ts',
|
||||
rules: {
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
patterns: ['*Events', '*.test.js'],
|
||||
paths: [...getThirdPartyPackages()],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'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 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 {WaitForOptions} from '../api/Frame.js';
|
||||
import {
|
||||
|
Loading…
Reference in New Issue
Block a user