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
4 changes: 2 additions & 2 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ jobs:
- name: Install Dependencies
run: yarn

- name: ESLint
- name: Oxlint
run: yarn lint

- name: Biome format
- name: Oxfmt format check
run: yarn format:check

release_next:
Expand Down
27 changes: 27 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxfmt/configuration_schema.json",
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
Comment thread
B4nan marked this conversation as resolved.
"singleQuote": true,
"semi": true,
"trailingComma": "all",
"quoteProps": "preserve",
"endOfLine": "lf",
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/coverage",
"**/.turbo",
"**/website/build",
"**/website/.docusaurus",
"**/*.d.ts",
"**/package.json",
"**/lerna.json",
"**/CHANGELOG.md",
"**/README.md",
"**/*.md",
"**/*.mdx",
"scripts/actions/docker-images/state.json"
]
}
201 changes: 201 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/coverage",
"**/.turbo",
"**/website/build",
"**/website/.docusaurus",
"**/*.d.ts",
"packages/templates/templates/**",
"packages/templates/scripts/**",
"test/e2e/**"
],
"plugins": [
"typescript",
"import",
"unicorn"
],
"env": {
"browser": true,
"node": true
},
"globals": {
"vi": "readonly",
"vitest": "readonly",
"describe": "readonly",
"it": "readonly",
"test": "readonly",
"expect": "readonly",
"expectTypeOf": "readonly",
"beforeAll": "readonly",
"afterAll": "readonly",
"beforeEach": "readonly",
"afterEach": "readonly"
},
"rules": {
"no-var": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"constructor-super": "error",
"for-direction": "error",
"getter-return": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-inner-declarations": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-new-native-nonconstructor": "error",
"no-obj-calls": "error",
"no-prototype-builtins": "error",
"no-self-assign": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-undef": "off",
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unused-labels": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"eqeqeq": ["error", "smart"],
"no-console": "off",
"no-throw-literal": "error",
"yoda": "error",

"typescript/consistent-type-imports": ["error", { "disallowTypeAnnotations": false }],
"typescript/consistent-type-definitions": ["error", "interface"],
"typescript/array-type": "error",
"typescript/no-floating-promises": "error",
"typescript/no-explicit-any": "off",
"typescript/no-non-null-assertion": "off",
"typescript/ban-ts-comment": "off",
"typescript/no-unused-vars": "off",
"typescript/no-empty-function": "off",
"typescript/no-empty-object-type": "off",
"typescript/no-empty-interface": "off",
"typescript/no-useless-constructor": "off",
"no-useless-constructor": "off",
"typescript/no-namespace": ["error", { "allowDeclarations": true }],
"typescript/no-this-alias": "error",
"typescript/no-var-requires": "error",
"typescript/no-require-imports": "off",
"typescript/adjacent-overload-signatures": "error",
"typescript/consistent-type-assertions": "error",
"typescript/no-array-constructor": "error",
"typescript/no-misused-new": "error",
"typescript/triple-slash-reference": "error",
"typescript/no-redeclare": "error",
"typescript/no-unnecessary-qualifier": "error",
"typescript/no-inferrable-types": "off",
"typescript/no-useless-default-assignment": "off",
"typescript/no-unsafe-declaration-merging": "off",
"typescript/no-unnecessary-parameter-property-assignment": "off",

"typescript/await-thenable": "error",
"typescript/no-for-in-array": "error",
"typescript/no-implied-eval": "error",
"typescript/no-mixed-enums": "error",
"typescript/no-unsafe-unary-minus": "error",
"typescript/related-getter-setter-pairs": "error",
"typescript/only-throw-error": "error",
"typescript/no-deprecated": "warn",
"typescript/prefer-find": "error",
"typescript/prefer-includes": "error",
"typescript/prefer-string-starts-ends-with": "error",
"typescript/no-duplicate-type-constituents": "error",
"typescript/consistent-type-exports": "error",

"typescript/prefer-optional-chain": "error",
"typescript/prefer-regexp-exec": "error",
"typescript/no-misused-promises": ["error", { "checksVoidReturn": { "arguments": false } }],
"typescript/no-unnecessary-template-expression": "error",
"typescript/no-unnecessary-boolean-literal-compare": "error",
"typescript/no-array-delete": "error",
"typescript/return-await": "off",
"typescript/use-unknown-in-catch-callback-variable": "off",
"typescript/no-unnecessary-condition": "off",
"typescript/no-confusing-void-expression": "off",
"typescript/switch-exhaustiveness-check": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/no-redundant-type-constituents": "off",
"typescript/no-misused-spread": "off",
"typescript/no-unsafe-enum-comparison": "off",
"typescript/unbound-method": "off",
"typescript/no-unsafe-argument": "off",
"typescript/no-unsafe-assignment": "off",
"typescript/no-unsafe-call": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-unsafe-return": "off",
"typescript/no-unsafe-type-assertion": "off",
"typescript/strict-boolean-expressions": "off",
"typescript/prefer-readonly-parameter-types": "off",
"typescript/promise-function-async": "off",
"typescript/require-await": "off",
"typescript/strict-void-return": "off",
"typescript/require-array-sort-compare": "off",
"typescript/restrict-template-expressions": "off",
"typescript/restrict-plus-operands": "off",
"typescript/no-base-to-string": "off",
"typescript/no-use-before-define": "off",

"import/no-duplicates": "error",

"unicorn/prefer-node-protocol": "error",
"unicorn/no-new-array": "off",
"unicorn/no-empty-file": "off",
"unicorn/no-useless-spread": "off"
},
"overrides": [
{
"files": ["test/**/*", "packages/*/test/**/*"],
"rules": {
"typescript/consistent-type-imports": "off",
"typescript/no-floating-promises": "off",
"typescript/only-throw-error": "off",
"typescript/await-thenable": "off",
"typescript/no-deprecated": "off",
"typescript/no-array-delete": "off",
"typescript/no-mixed-enums": "off",
"typescript/no-implied-eval": "off",
"no-console": "off",
"no-control-regex": "off",
"no-empty": "off",
"import/no-duplicates": "off"
}
},
{
"files": ["packages/templates/**/*"],
"rules": {
"typescript/no-unused-vars": "off",
"no-unused-vars": "off"
}
}
]
}
28 changes: 0 additions & 28 deletions biome.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/examples/file_download_stream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pipeline, Transform } from 'stream';
import { pipeline, Transform } from 'node:stream';

import { FileDownload, type CrawleeLogger } from 'crawlee';

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/running-in-web-server/web-server.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { randomUUID } from 'node:crypto';
import { CheerioCrawler, log } from 'crawlee';
import { createServer } from 'http';
import { createServer } from 'node:http';

// We will bind an HTTP response that we want to send to the Request.uniqueKey
const requestsToResponses = new Map();
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/session_management_basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ const crawler = new BasicCrawler({
?.split(';')
.map((x) => Cookie.parse(x));

newCookies?.forEach((cookie) => {
for (const cookie of newCookies ?? []) {
if (cookie) {
session?.cookieJar?.setCookie(cookie, url);
await session?.cookieJar?.setCookie(cookie, url);
}
});
}
}
},
});
2 changes: 1 addition & 1 deletion docs/guides/session_management_http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const crawler = new HttpCrawler({
// and set the cookie header to request automatically (default is true).
persistCookiesPerSession: true,
async requestHandler({ session, body }) {
const title = (body as string).match(/<title(?:.*?)>(.*?)<\/title>/)?.[1];
const title = /<title(?:.*?)>(.*?)<\/title>/.exec(body as string)?.[1];

if (title === 'Blocked') {
session?.retire();
Expand Down
12 changes: 6 additions & 6 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../tsconfig.build.json",
"include": ["./**/*.ts"],
"compilerOptions": {
"lib": ["ES2022", "DOM.AsyncIterable"],
"noUnusedLocals": false
}
"extends": "../tsconfig.build.json",
Comment thread
B4nan marked this conversation as resolved.
"include": ["./**/*.ts"],
"compilerOptions": {
"lib": ["ES2022", "DOM.AsyncIterable"],
"noUnusedLocals": false
}
}
Loading
Loading