Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@main

- name: Install Chrome for puppeteer
run: pnpm exec puppeteer browsers install chrome

- name: Build
run: pnpm ci:build

Expand Down
75 changes: 0 additions & 75 deletions eslint.config.mjs

This file was deleted.

49 changes: 49 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { defineConfig } from '@apify/oxlint-config';

export default defineConfig({
ignorePatterns: [
'**/node_modules',
'**/dist',
'coverage',
'website',
'docs',
'scripts',
'**/*.d.ts',
// Actor source code lives in `packages/actor-scraper/*` and is bundled per-actor
// with its own tsconfig that targets a different module system. Linting is handled
// at the scraper-tools level; the actor packages are application code, not libraries.
'packages/actor-scraper',
],
rules: {
'typescript/no-explicit-any': 'off',
'typescript/ban-ts-comment': 'off',
'no-param-reassign': 'off',
'no-void': 'off',
},
overrides: [
{
files: ['*.config.ts', '*.config.mts', '*.config.mjs'],
rules: {
'no-console': 'off',
'import/no-default-export': 'off',
},
},
{
files: ['test/**', '**/test/**'],
rules: {
'no-console': 'off',
'no-useless-constructor': 'off',
'typescript/no-empty-function': 'off',
'typescript/no-unused-vars': 'off',
'jest/no-conditional-expect': 'off',
'vitest/no-conditional-expect': 'off',
'jest/expect-expect': 'off',
'vitest/expect-expect': 'off',
'jest/no-standalone-expect': 'off',
'vitest/no-standalone-expect': 'off',
'jest/no-disabled-tests': 'off',
'vitest/no-disabled-tests': 'off',
},
},
],
});
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,27 @@
"release": "pnpm build && lerna publish from-package --contents dist",
"publish:next": "lerna publish --canary --preid beta --dist-tag next",
"release:next": "pnpm build && pnpm publish:next",
"lint": "eslint",
"lint:fix": "eslint --fix",
"lint": "oxlint --type-aware",
"lint:fix": "oxlint --type-aware --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"preinstall": "npx only-allow pnpm"
},
"lint-staged": {
"packages/*/src/**/*": [
"eslint --fix"
"oxlint --type-aware --fix --no-error-on-unmatched-pattern"
],
"test/**/*": [
"eslint --fix"
"oxlint --type-aware --fix --no-error-on-unmatched-pattern"
],
"*": "prettier --write --ignore-unknown"
},
"devDependencies": {
"@apify/consts": "^2.29.0",
"@apify/eslint-config": "^1.0.0",
"@apify/input_secrets": "^1.2.0",
"@apify/log": "^2.5.22",
"@apify/tsconfig": "^0.1.0",
"@apify/oxlint-config": "^0.2.5",
"@apify/tsconfig": "^0.1.2",
"@commitlint/config-conventional": "^20.0.0",
"@isaacs/brace-expansion": "^5.0.1",
"@playwright/browser-chromium": "^1.46.0",
Expand All @@ -76,22 +76,21 @@
"apify-client": "^2.17.0",
"commitlint": "^20.0.0",
"crawlee": "^3.16.0",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"fs-extra": "^11.2.0",
"gen-esm-wrapper": "^1.1.3",
"globby": "^14.1.0",
"husky": "^9.1.7",
"lerna": "^9.0.0",
"lint-staged": "^16.0.0",
"oxlint": "1.62.0",
"oxlint-tsgolint": "0.22.0",
"playwright": "^1.46.0",
"prettier": "3.8.1",
"puppeteer": "^24.0.0",
"rimraf": "^6.0.1",
"tsx": "^4.16.5",
"turbo": "2.9.1",
"typescript": "~5.9.0",
"typescript-eslint": "^8.28.0",
"vite-tsconfig-paths": "^6.0.0",
"vitest": "^4.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ export class CrawlerSetup implements CrawlerSetupOptions {
try {
const { type } = contentType.parse(cTypeHeader);
if (!/^(text|application)\/xml$|\+xml$/.test(type)) return;
} catch (err) {
} catch {
// Invalid type is not XML.
return;
}
Expand Down
5 changes: 3 additions & 2 deletions packages/scraper-tools/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import log from '@apify/log';

import { saveSnapshot } from './browser_tools.js';
import type { SnapshotOptions } from './browser_tools.ts';
import type { SnapshotOptions } from './browser_tools.js';
import { META_KEY } from './consts.js';
import type { RequestMetadata } from './tools.ts';
import type { RequestMetadata } from './tools.js';

export interface MapLike<K, V> extends Omit<
Map<K, V>,
Expand Down Expand Up @@ -64,6 +64,7 @@
*/
class Context<
Options extends ContextOptions = ContextOptions,
// oxlint-disable-next-line no-unused-vars -- declaration-merged interface below uses this generic
ExtraFields = Options['pageFunctionArguments'],
> {
private readonly [setup]: CrawlerSetupOptions;
Expand Down Expand Up @@ -153,7 +154,7 @@
[META_KEY]: {
parentRequestId: castedRequest.id || castedRequest.uniqueKey,
depth:
(castedRequest.userData?.[META_KEY] as RequestMetadata)

Check warning on line 157 in packages/scraper-tools/src/context.ts

View workflow job for this annotation

GitHub Actions / Lint

eslint(no-unsafe-optional-chaining)

Unsafe usage of optional chaining
.depth ?? 0 + 1,
},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/scraper-tools/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export * as tools from './tools.js';
export * from './context.js';
export * from './run_actor.js';

export type { RequestMetadata, ErrorLike } from './tools.ts';
export type { RequestMetadata, ErrorLike } from './tools.js';

export type { DumpConsoleOptions, SnapshotOptions } from './browser_tools.ts';
export type { DumpConsoleOptions, SnapshotOptions } from './browser_tools.js';
Loading
Loading