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
139 changes: 139 additions & 0 deletions .oxlintrc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "import", "jsdoc", "vitest"],
"rules": {
"no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }
],

// === Base rules from eslint-config-sdk/base.js ===
"no-console": "error",
"no-alert": "error",
"no-param-reassign": "error",
"prefer-template": "error",
"no-bitwise": "error",
"complexity": ["error", { "max": 33 }],
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"guard-for-in": "error",
"array-callback-return": ["error", { "allowImplicit": true }],
"quotes": ["error", "single", { "avoidEscape": true }],
"no-return-await": "error",
"max-lines": ["error", { "max": 300, "skipComments": true, "skipBlankLines": true }],

// === Import rules ===
"import/namespace": "off",
"import/no-unresolved": "off",

// === Rules turned off (not enforced in ESLint or causing false positives) ===
"no-control-regex": "off",
"jsdoc/check-tag-names": "off",
"jsdoc/require-yields": "off",
"no-useless-rename": "off",
"no-constant-binary-expression": "off",
"vitest/hoisted-apis-on-top": "off",
"vitest/no-conditional-tests": "off",
"no-unsafe-optional-chaining": "off",
"no-eval": "off",
"no-import-assign": "off",
"typescript/no-duplicate-type-constituents": "off"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx", "**/*.d.ts"],
"rules": {
"typescript/ban-ts-comment": "error",
"typescript/consistent-type-imports": "error",
"typescript/no-unnecessary-type-assertion": "error",
"typescript/prefer-for-of": "error",
"typescript/no-floating-promises": ["error", { "ignoreVoid": true }],
"typescript/no-dynamic-delete": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/unbound-method": "error",
"typescript/no-explicit-any": "error",
"typescript/no-empty-function": "off",
"typescript/prefer-optional-chain": ["error"],
"typescript/no-redundant-type-constituents": "off",
"typescript/restrict-template-expressions": "off",
"typescript/await-thenable": "warn",
"typescript/no-base-to-string": "off"
}
},
{
"files": ["**/*.js", "**/*.mjs", "**/*.cjs"],
"rules": {
"typescript/ban-ts-comment": "off",
"typescript/consistent-type-imports": "off",
"typescript/prefer-optional-chain": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/prefer-for-of": "off",
"typescript/no-floating-promises": "off",
"typescript/no-dynamic-delete": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/unbound-method": "off",
"typescript/no-explicit-any": "off"
}
},
{
"files": [
"**/*.test.ts",
"**/*.test.tsx",
"**/*.test.js",
"**/*.test.jsx",
"**/test/**",
"**/tests/**",
"**/suites/**",
"**/loader-suites/**"
],
"rules": {
"typescript/explicit-function-return-type": "off",
"no-unused-expressions": "off",
"typescript/no-unused-expressions": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-explicit-any": "off",
"typescript/no-non-null-assertion": "off",
"typescript/no-floating-promises": "off",
"typescript/unbound-method": "off",
"max-lines": "off",
"complexity": "off",
"typescript/prefer-optional-chain": "off",
"typescript/no-misused-spread": "off",
"typescript/require-array-sort-compare": "off",
"typescript/no-base-to-string": "off",
"typescript/await-thenable": "off"
}
},
{
"files": ["*.tsx"],
"rules": {
"jsdoc/require-jsdoc": "off"
}
},
{
"files": ["*.config.js", "*.config.mjs", "*.config.ts", "vite.config.ts", ".size-limit.js"],
"rules": {
"no-console": "off",
"max-lines": "off"
}
},
{
"files": [
"**/scenarios/**",
"**/rollup-utils/**",
"**/bundle-analyzer-scenarios/**",
"**/bundle-analyzer-scenarios/*.cjs",
"**/bundle-analyzer-scenarios/*.js"
],
"rules": {
"no-console": "off"
}
},
{
"files": ["**/src/**"],
"rules": {
"no-restricted-globals": ["error", "window", "document", "location", "navigator"]
}
}
]
}
133 changes: 4 additions & 129 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "import", "jsdoc", "vitest"],
"extends": ["./.oxlintrc.base.json"],
"options": {
"typeAware": true
},
"jsPlugins": [
{
"name": "sdk",
Expand All @@ -9,140 +12,12 @@
],
"categories": {},
"rules": {
"no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }
],

// === Base rules from eslint-config-sdk/base.js ===
"no-console": "error",
"no-alert": "error",
"no-param-reassign": "error",
"prefer-template": "error",
"no-bitwise": "error",
"complexity": ["error", { "max": 33 }],
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"guard-for-in": "error",
"array-callback-return": ["error", { "allowImplicit": true }],
"quotes": ["error", "single", { "avoidEscape": true }],
"no-return-await": "error",
"max-lines": ["error", { "max": 300, "skipComments": true, "skipBlankLines": true }],

// === Import rules ===
"import/namespace": "off",
"import/no-unresolved": "off",

// === Rules turned off (not enforced in ESLint or causing false positives) ===
"no-control-regex": "off",
"jsdoc/check-tag-names": "off",
"jsdoc/require-yields": "off",
"no-useless-rename": "off",
"no-constant-binary-expression": "off",
"vitest/hoisted-apis-on-top": "off",
"vitest/no-conditional-tests": "off",
"no-unsafe-optional-chaining": "off",
"no-eval": "off",
"no-import-assign": "off",
"typescript/no-duplicate-type-constituents": "off",

// === Custom SDK rules (via JS plugin) ===
"sdk/no-eq-empty": "error"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx", "**/*.d.ts"],
"rules": {
"typescript/ban-ts-comment": "error",
"typescript/consistent-type-imports": "error",
"typescript/no-unnecessary-type-assertion": "error",
"typescript/prefer-for-of": "error",
"typescript/no-floating-promises": ["error", { "ignoreVoid": true }],
"typescript/no-dynamic-delete": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/unbound-method": "error",
"typescript/no-explicit-any": "error",
"typescript/no-empty-function": "off",
"typescript/prefer-optional-chain": ["error"],
"typescript/no-redundant-type-constituents": "off",
"typescript/restrict-template-expressions": "off",
"typescript/await-thenable": "warn",
"typescript/no-base-to-string": "off"
}
},
{
"files": ["**/*.js", "**/*.mjs", "**/*.cjs"],
"rules": {
"typescript/ban-ts-comment": "off",
"typescript/consistent-type-imports": "off",
"typescript/prefer-optional-chain": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/prefer-for-of": "off",
"typescript/no-floating-promises": "off",
"typescript/no-dynamic-delete": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/unbound-method": "off",
"typescript/no-explicit-any": "off"
}
},
{
"files": [
"**/*.test.ts",
"**/*.test.tsx",
"**/*.test.js",
"**/*.test.jsx",
"**/test/**",
"**/tests/**",
"**/suites/**",
"**/loader-suites/**"
],
"rules": {
"typescript/explicit-function-return-type": "off",
"no-unused-expressions": "off",
"typescript/no-unused-expressions": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-explicit-any": "off",
"typescript/no-non-null-assertion": "off",
"typescript/no-floating-promises": "off",
"typescript/unbound-method": "off",
"max-lines": "off",
"complexity": "off",
"typescript/prefer-optional-chain": "off",
"typescript/no-misused-spread": "off",
"typescript/require-array-sort-compare": "off",
"typescript/no-base-to-string": "off",
"typescript/await-thenable": "off"
}
},
{
"files": ["*.tsx"],
"rules": {
"jsdoc/require-jsdoc": "off"
}
},
{
"files": ["*.config.js", "*.config.mjs", "*.config.ts", "vite.config.ts", ".size-limit.js"],
"rules": {
"no-console": "off",
"max-lines": "off"
}
},
{
"files": [
"**/scenarios/**",
"**/rollup-utils/**",
"**/bundle-analyzer-scenarios/**",
"**/bundle-analyzer-scenarios/*.cjs",
"**/bundle-analyzer-scenarios/*.js"
],
"rules": {
"no-console": "off"
}
},
{
"files": ["**/src/**"],
"rules": {
"no-restricted-globals": ["error", "window", "document", "location", "navigator"],
"sdk/no-class-field-initializers": "error",
"sdk/no-regexp-constructor": "error"
}
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../node_modules/oxlint/configuration_schema.json",
"extends": ["../.oxlintrc.json"],
"extends": ["../.oxlintrc.base.json"],
"rules": {
"typescript/no-explicit-any": "off",
"max-lines": "off",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"format:check": "oxfmt . --check",
"verify": "run-s format:check lint",
"fix": "run-s format lint:fix",
"lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware",
"lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware",
"lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint .",
"lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix",
"lint:es-compatibility": "nx run-many -t lint:es-compatibility",
"dedupe-deps:check": "yarn-deduplicate yarn.lock --list --fail",
"dedupe-deps:fix": "yarn-deduplicate yarn.lock",
Expand Down
8 changes: 7 additions & 1 deletion packages/angular/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"jsPlugins": [
{
"name": "sdk",
"specifier": "@sentry-internal/eslint-plugin-sdk"
}
],
"env": {
"browser": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"env": {
"browser": true,
"node": true
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-serverless/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"env": {
"node": true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-utils/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"env": {
"browser": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"env": {
"browser": true
},
Expand Down
8 changes: 7 additions & 1 deletion packages/bun/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"jsPlugins": [
{
"name": "sdk",
"specifier": "@sentry-internal/eslint-plugin-sdk"
}
],
"env": {
"node": true
},
Expand Down
8 changes: 7 additions & 1 deletion packages/cloudflare/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"jsPlugins": [
{
"name": "sdk",
"specifier": "@sentry-internal/eslint-plugin-sdk"
}
],
"env": {
"node": true
},
Expand Down
8 changes: 7 additions & 1 deletion packages/core/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "../../node_modules/oxlint/configuration_schema.json",
"extends": ["../../.oxlintrc.json"],
"extends": ["../../.oxlintrc.base.json"],
"jsPlugins": [
{
"name": "sdk",
"specifier": "@sentry-internal/eslint-plugin-sdk"
}
],
"rules": {
"sdk/no-unsafe-random-apis": "error"
},
Expand Down
Loading
Loading