Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Add no-undef rule to eslint
Ondra Urban2d7a37a79802
diff --git a/.eslintrc.json b/.eslintrc.jsonindex 565c42df5..5f2234a02 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -19,7 +19,6 @@"no-plusplus": 0,"strict": ["error", "global"],"max-len": ["error", 150],- "no-undef": 0,"func-names": 0,"import/prefer-default-export": 0,"import/no-absolute-path": 0,diff --git a/src/puppeteer_live_view_client.js b/src/puppeteer_live_view_client.jsindex 77ef1e3a0..9c7f622b9 100644--- a/src/puppeteer_live_view_client.js+++ b/src/puppeteer_live_view_client.js@@ -3,6 +3,8 @@ import { checkParamOrThrow } from 'apify-client/build/utils';// Everything gets destroyed slowly to make the UX betterconst DESTROY_FADEOUT_MILLIS = 2000;+/* global document, window */+/*** Creates a page line in the Index.*diff --git a/src/puppeteer_utils.js b/src/puppeteer_utils.jsindex 7670cf4db..9b8c9e70c 100644--- a/src/puppeteer_utils.js+++ b/src/puppeteer_utils.js@@ -29,6 +29,7 @@ const hideWebDriver = async (page) => {checkParamOrThrow(page, 'page', 'Object');await page.evaluateOnNewDocument(() => {+ /* global Navigator, window */var modifiedNavigator; // eslint-disable-line no-vartry {if (Navigator.prototype.hasOwnProperty('webdriver')) { // eslint-disable-line no-prototype-builtinsdiff --git a/test/.eslintrc.json b/test/.eslintrc.jsonnew file mode 100644index 000000000..2f64929c8--- /dev/null+++ b/test/.eslintrc.json@@ -0,0 +1,11 @@+{+ "globals": {+ "it": false,+ "describe": false,+ "xit": false,+ "before": false,+ "after": false,+ "beforeEach": false,+ "afterEach": false+ }+}diff --git a/test/puppeteer_utils.js b/test/puppeteer_utils.jsindex 3d954d2a0..73c72b666 100644--- a/test/puppeteer_utils.js+++ b/test/puppeteer_utils.js@@ -4,7 +4,7 @@ import Apify from '../build/index';const { utils: { log } } = Apify;-/* global describe, it */+/* global window */describe('Apify.utils.puppeteer', () => {let ll;@@ -76,6 +76,7 @@ describe('Apify.utils.puppeteer', () => {await Apify.utils.puppeteer.injectJQuery(page);const result2 = await page.evaluate(() => {+ /* global $ */return {isDefined: window.jQuery === window.$,text: $('h1').text(),@@ -104,6 +105,7 @@ describe('Apify.utils.puppeteer', () => {await Apify.utils.puppeteer.injectUnderscore(page);const result2 = await page.evaluate(() => {+ /* global _ */return { isDefined: _.isEmpty({}) };});expect(result2).to.eql({ isDefined: true });