Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines
if: steps.dependency-cache.outputs.cache-hit != 'true'
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: dist-artifacts-${{ github.run_id }}
path: packages
- run: yarn lint

artifacts:
Expand Down
164 changes: 164 additions & 0 deletions .oxlintrc.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"$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": ["**/integrations/node-fetch/vendored/**/*.ts"],
"rules": {
"typescript/consistent-type-imports": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-explicit-any": "off",
"typescript/prefer-for-of": "off",
"max-lines": "off",
"complexity": "off",
"no-param-reassign": "off"
}
},
{
"files": ["**/integrations/tracing/redis/vendored/**/*.ts"],
"rules": {
"typescript/no-explicit-any": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-this-alias": "off",
"max-lines": "off",
"no-bitwise": "off"
}
},
{
"files": [
"**/scenarios/**",
"**/fixtures/**",
"**/playground/**",
"**/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"]
}
}
]
}
43 changes: 43 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": ["./.oxlintrc.base.json"],
"options": {
"typeAware": true
},
"jsPlugins": [
{
"name": "sdk",
"specifier": "@sentry-internal/eslint-plugin-sdk"
}
],
"categories": {},
"rules": {
"sdk/no-eq-empty": "error"
},
"overrides": [
{
"files": ["**/src/**"],
"rules": {
"sdk/no-class-field-initializers": "error",
"sdk/no-regexp-constructor": "error"
}
}
],
"env": {
"es2017": true,
"node": true
},
"globals": {},
"ignorePatterns": [
"coverage/**",
"build/**",
"dist/**",
"cjs/**",
"esm/**",
"examples/**",
"test/manual/**",
"types/**",
"scripts/*.js",
"node_modules/**"
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"editor.defaultFormatter": "oxc.oxc-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode",
"js/ts.tsdk.path": "node_modules/typescript/lib"
}
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
"packages/bundler-plugin-core",
"packages/dev-utils",
"packages/esbuild-plugin",
"packages/eslint-configs",
"packages/playground",
"packages/rollup-plugin",
"packages/tsconfigs",
"packages/vite-plugin",
"packages/webpack-plugin",
"packages/integration-tests-next"
Expand All @@ -29,15 +27,22 @@
"test": "nx run-many --target=test --all",
"test:unit": "nx run-many --target=test --all --exclude=@sentry-internal/integration-tests-next",
"test:integration": "nx run @sentry-internal/integration-tests-next:test",
"lint": "nx run-many --target=lint --all",
"lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint .",
"lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix",
"check:formatting": "oxfmt --check .",
"fix:formatting": "oxfmt ."
},
"devDependencies": {
"@types/node": "^18.6.3",
"@sentry-internal/eslint-plugin-sdk": "^10.53.1",
"@sentry-internal/typescript": "^10.53.1",
"minimatch": "^10.2.2",
"npm-run-all": "^4.1.5",
"nx": "22.5.2",
"oxfmt": "^0.33.0"
"oxfmt": "^0.33.0",
"oxlint": "1.53.0",
"oxlint-tsgolint": "0.16.0",
"typescript": "~5.8.0"
},
"volta": {
"node": "22.22.0",
Expand Down
16 changes: 0 additions & 16 deletions packages/babel-plugin-component-annotate/.eslintrc.js

This file was deleted.

11 changes: 3 additions & 8 deletions packages/babel-plugin-component-annotate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,22 @@
"build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput",
"build:npm": "npm pack",
"check:types": "run-p check:types:src check:types:test",
"check:types:src": "tsc --project ./src/tsconfig.json --noEmit",
"check:types:src": "tsc --project ./tsconfig.json --noEmit",
"check:types:test": "tsc --project ./test/tsconfig.json --noEmit",
"clean": "run-s clean:build",
"clean:all": "run-p clean clean:deps",
"clean:build": "premove ./dist *.tgz",
"clean:deps": "premove node_modules",
"test": "vitest run",
"lint": "eslint ./src ./test"
"test": "vitest run"
},
"devDependencies": {
"@babel/core": "7.18.5",
"@types/babel__core": "^7.20.5",
"@babel/preset-react": "^7.23.3",
"@sentry-internal/eslint-config": "5.3.0",
"@sentry-internal/sentry-bundler-plugin-tsconfig": "5.3.0",
"@types/node": "^18.6.3",
"eslint": "^8.18.0",
"vitest": "^4.0.0",
"premove": "^4.0.0",
"rolldown": "^1.0.0",
"typescript": "^4.7.4"
"rolldown": "^1.0.0"
},
"volta": {
"extends": "../../package.json"
Expand Down
11 changes: 5 additions & 6 deletions packages/babel-plugin-component-annotate/src/experimental.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* oxlint-disable max-lines */
/**
* MIT License
*
Expand Down Expand Up @@ -103,7 +104,7 @@ export function experimentalComponentNameAnnotatePlugin({
},
},
FunctionDeclaration(path, state) {
if (!path.node.id || !path.node.id.name) {
if (!path.node.id?.name) {
return;
}

Expand Down Expand Up @@ -134,7 +135,7 @@ export function experimentalComponentNameAnnotatePlugin({
return prop.isClassMethod() && prop.get("key").isIdentifier({ name: "render" });
});

if (!render || !render.traverse) {
if (!render?.traverse) {
return;
}

Expand Down Expand Up @@ -441,10 +442,8 @@ function collectFragmentContext(programPath: Babel.NodePath): FragmentContext {
for (const prop of properties) {
if (
prop.type === "ObjectProperty" &&
prop.key &&
prop.key.type === "Identifier" &&
prop.value &&
prop.value.type === "Identifier" &&
prop.key?.type === "Identifier" &&
prop.value?.type === "Identifier" &&
prop.key.name === "Fragment"
) {
fragmentAliases.add(prop.value.name);
Expand Down
Loading
Loading