Skip to content

Commit f658d32

Browse files
committed
fix lint
1 parent 39a9f15 commit f658d32

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed

.cursor/rules/sdk_dependency_upgrades.mdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ description: Use this rule if you are looking to upgrade a dependency in the Sen
33
globs:
44
alwaysApply: false
55
---
6+
67
# Yarn v1 Dependency Upgrades
78

89
## Upgrade Process
@@ -45,10 +46,12 @@ Avoid upgrading top-level dependencies (defined in `package.json`), especially i
4546
**STOP UPGRADE IMMEDIATELY** if upgrading any dependency with `opentelemetry` in the name and the new version or any of its dependencies uses forbidden OpenTelemetry versions.
4647

4748
**FORBIDDEN VERSION PATTERNS:**
49+
4850
- `2.x.x` versions (e.g., `2.0.0`, `2.1.0`)
4951
- `0.2xx.x` versions (e.g., `0.200.0`, `0.201.0`)
5052

5153
When upgrading OpenTelemetry dependencies:
54+
5255
1. Check the dependency's `package.json` after upgrade
5356
2. Verify the package itself doesn't use forbidden version patterns
5457
3. Verify none of its dependencies use `@opentelemetry/*` packages with forbidden version patterns
@@ -153,6 +156,7 @@ yarn info <package-name> versions
153156
```
154157

155158
The `yarn info` command provides detailed dependency information without requiring installation, making it particularly useful for:
159+
156160
- Verifying OpenTelemetry packages don't introduce forbidden version patterns (`2.x.x` or `0.2xx.x`)
157161
- Checking what dependencies a package will bring in before upgrading
158162
- Understanding package version history and compatibility

.cursor/rules/sdk_development.mdc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ You are working on the Sentry JavaScript SDK, a critical production SDK used by
1818
## Development Commands
1919

2020
### Build Commands
21+
2122
- `yarn build` - Full production build with package verification
2223
- `yarn build:dev` - Development build (transpile + types)
2324
- `yarn build:dev:watch` - Development build in watch mode (recommended)
@@ -26,9 +27,11 @@ You are working on the Sentry JavaScript SDK, a critical production SDK used by
2627
- `yarn build:bundle` - Build browser bundles only
2728

2829
### Testing
30+
2931
- `yarn test` - Run all unit tests
3032

3133
### Linting and Formatting
34+
3235
- `yarn lint` - Run ESLint and Prettier checks
3336
- `yarn fix` - Auto-fix linting and formatting issues
3437
- `yarn lint:es-compatibility` - Check ES compatibility
@@ -38,6 +41,7 @@ You are working on the Sentry JavaScript SDK, a critical production SDK used by
3841
This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for details.
3942

4043
### Key Rules
44+
4145
- **All PRs target `develop` branch** (NOT `master`)
4246
- `master` represents the last released state
4347
- Never merge directly into `master` (except emergency fixes)
@@ -47,6 +51,7 @@ This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for de
4751
- Unless explicitly asked for, make sure to cover all files, including files in `src/` and `test/` directories.
4852

4953
### Branch Naming
54+
5055
- Features: `feat/descriptive-name`
5156
- Releases: `release/X.Y.Z`
5257

@@ -55,28 +60,33 @@ This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for de
5560
This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.
5661

5762
### Core Packages
63+
5864
- `packages/core/` - Base SDK with interfaces, type definitions, core functionality
5965
- `packages/types/` - Shared TypeScript type definitions - this is deprecated, never modify this package
6066
- `packages/browser-utils/` - Browser-specific utilities and instrumentation
6167
- `packages/node-core/` - Node Core SDK which contains most of the node-specific logic, excluding OpenTelemetry instrumentation.
6268

6369
### Platform SDKs
70+
6471
- `packages/browser/` - Browser SDK with bundled variants
6572
- `packages/node/` - Node.js SDK. All general Node code should go into node-core, the node package itself only contains OpenTelemetry instrumentation on top of that.
6673
- `packages/bun/`, `packages/deno/`, `packages/cloudflare/` - Runtime-specific SDKs
6774

6875
### Framework Integrations
76+
6977
- Framework packages: `packages/{framework}/` (react, vue, angular, etc.)
7078
- Client/server entry points where applicable (nextjs, nuxt, sveltekit)
7179
- Integration tests use Playwright (Remix, browser-integration-tests)
7280

7381
### User Experience Packages
82+
7483
- `packages/replay-internal/` - Session replay functionality
7584
- `packages/replay-canvas/` - Canvas recording for replay
7685
- `packages/replay-worker/` - Web worker support for replay
7786
- `packages/feedback/` - User feedback integration
7887

7988
### Development Packages (`dev-packages/`)
89+
8090
- `browser-integration-tests/` - Playwright browser tests
8191
- `e2e-tests/` - End-to-end tests for 70+ framework combinations
8292
- `node-integration-tests/` - Node.js integration tests
@@ -88,46 +98,55 @@ This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.
8898
## Development Guidelines
8999

90100
### Build System
101+
91102
- Uses Rollup for bundling (`rollup.*.config.mjs`)
92103
- TypeScript with multiple tsconfig files per package
93104
- Lerna manages package dependencies and publishing
94105
- Vite for testing with `vitest`
95106

96107
### Package Structure Pattern
108+
97109
Each package typically contains:
110+
98111
- `src/index.ts` - Main entry point
99112
- `src/sdk.ts` - SDK initialization logic
100113
- `rollup.npm.config.mjs` - Build configuration
101114
- `tsconfig.json`, `tsconfig.test.json`, `tsconfig.types.json`
102115
- `test/` directory with corresponding test files
103116

104117
### Key Development Notes
118+
105119
- Uses Volta for Node.js/Yarn version management
106120
- Requires initial `yarn build` after `yarn install` for TypeScript linking
107121
- Integration tests use Playwright extensively
108122
- Never change the volta, yarn, or package manager setup in general unless explicitly asked for
109123

110124
### Notes for Background Tasks
125+
111126
- Make sure to use [volta](https://volta.sh/) for development. Volta is used to manage the node, yarn and pnpm version used.
112127
- Make sure that [PNPM support is enabled in volta](https://docs.volta.sh/advanced/pnpm). This means that the `VOLTA_FEATURE_PNPM` environment variable has to be set to `1`.
113128
- Yarn, Node and PNPM have to be used through volta, in the versions defined by the volta config. NEVER change any versions unless explicitly asked to.
114129

115130
## Testing Single Packages
131+
116132
- Test specific package: `cd packages/{package-name} && yarn test`
117133
- Build specific package: `yarn build:dev:filter @sentry/{package-name}`
118134

119135
## Code Style Rules
136+
120137
- Follow existing code conventions in each package
121138
- Check imports and dependencies - only use libraries already in the codebase
122139
- Look at neighboring files for patterns and style
123140
- Never introduce code that exposes secrets or keys
124141
- Follow security best practices
125142

126143
## Before Every Commit Checklist
144+
127145
1. ✅ `yarn lint` (fix all issues)
128146
2. ✅ `yarn test` (all tests pass)
129147
3. ✅ `yarn build:dev` (builds successfully)
130148
4. ✅ Target `develop` branch for PRs (not `master`)
131149

132150
## Documentation Sync
151+
133152
**IMPORTANT**: When editing CLAUDE.md, also update .cursor/rules/sdk_development.mdc and vice versa to keep both files in sync.

CLAUDE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ You are working on the Sentry JavaScript SDK, a critical production SDK used by
1717
## Development Commands
1818

1919
### Build Commands
20+
2021
- `yarn build` - Full production build with package verification
2122
- `yarn build:dev` - Development build (transpile + types)
2223
- `yarn build:dev:watch` - Development build in watch mode (recommended)
@@ -25,9 +26,11 @@ You are working on the Sentry JavaScript SDK, a critical production SDK used by
2526
- `yarn build:bundle` - Build browser bundles only
2627

2728
### Testing
29+
2830
- `yarn test` - Run all unit tests
2931

3032
### Linting and Formatting
33+
3134
- `yarn lint` - Run ESLint and Prettier checks
3235
- `yarn fix` - Auto-fix linting and formatting issues
3336
- `yarn lint:es-compatibility` - Check ES compatibility
@@ -37,6 +40,7 @@ You are working on the Sentry JavaScript SDK, a critical production SDK used by
3740
This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for details.
3841

3942
### Key Rules
43+
4044
- **All PRs target `develop` branch** (NOT `master`)
4145
- `master` represents the last released state
4246
- Never merge directly into `master` (except emergency fixes)
@@ -46,6 +50,7 @@ This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for de
4650
- Unless explicitly asked for, make sure to cover all files, including files in `src/` and `test/` directories.
4751

4852
### Branch Naming
53+
4954
- Features: `feat/descriptive-name`
5055
- Releases: `release/X.Y.Z`
5156

@@ -54,28 +59,33 @@ This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for de
5459
This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.
5560

5661
### Core Packages
62+
5763
- `packages/core/` - Base SDK with interfaces, type definitions, core functionality
5864
- `packages/types/` - Shared TypeScript type definitions - this is deprecated, never modify this package
5965
- `packages/browser-utils/` - Browser-specific utilities and instrumentation
6066
- `packages/node-core/` - Node Core SDK which contains most of the node-specific logic, excluding OpenTelemetry instrumentation.
6167

6268
### Platform SDKs
69+
6370
- `packages/browser/` - Browser SDK with bundled variants
6471
- `packages/node/` - Node.js SDK. All general Node code should go into node-core, the node package itself only contains OpenTelemetry instrumentation on top of that.
6572
- `packages/bun/`, `packages/deno/`, `packages/cloudflare/` - Runtime-specific SDKs
6673

6774
### Framework Integrations
75+
6876
- Framework packages: `packages/{framework}/` (react, vue, angular, etc.)
6977
- Client/server entry points where applicable (nextjs, nuxt, sveltekit)
7078
- Integration tests use Playwright (Remix, browser-integration-tests)
7179

7280
### User Experience Packages
81+
7382
- `packages/replay-internal/` - Session replay functionality
7483
- `packages/replay-canvas/` - Canvas recording for replay
7584
- `packages/replay-worker/` - Web worker support for replay
7685
- `packages/feedback/` - User feedback integration
7786

7887
### Development Packages (`dev-packages/`)
88+
7989
- `browser-integration-tests/` - Playwright browser tests
8090
- `e2e-tests/` - End-to-end tests for 70+ framework combinations
8191
- `node-integration-tests/` - Node.js integration tests
@@ -87,46 +97,55 @@ This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.
8797
## Development Guidelines
8898

8999
### Build System
100+
90101
- Uses Rollup for bundling (`rollup.*.config.mjs`)
91102
- TypeScript with multiple tsconfig files per package
92103
- Lerna manages package dependencies and publishing
93104
- Vite for testing with `vitest`
94105

95106
### Package Structure Pattern
107+
96108
Each package typically contains:
109+
97110
- `src/index.ts` - Main entry point
98111
- `src/sdk.ts` - SDK initialization logic
99112
- `rollup.npm.config.mjs` - Build configuration
100113
- `tsconfig.json`, `tsconfig.test.json`, `tsconfig.types.json`
101114
- `test/` directory with corresponding test files
102115

103116
### Key Development Notes
117+
104118
- Uses Volta for Node.js/Yarn version management
105119
- Requires initial `yarn build` after `yarn install` for TypeScript linking
106120
- Integration tests use Playwright extensively
107121
- Never change the volta, yarn, or package manager setup in general unless explicitly asked for
108122

109123
### Notes for Background Tasks
124+
110125
- Make sure to use [volta](https://volta.sh/) for development. Volta is used to manage the node, yarn and pnpm version used.
111126
- Make sure that [PNPM support is enabled in volta](https://docs.volta.sh/advanced/pnpm). This means that the `VOLTA_FEATURE_PNPM` environment variable has to be set to `1`.
112127
- Yarn, Node and PNPM have to be used through volta, in the versions defined by the volta config. NEVER change any versions unless explicitly asked to.
113128

114129
## Testing Single Packages
130+
115131
- Test specific package: `cd packages/{package-name} && yarn test`
116132
- Build specific package: `yarn build:dev:filter @sentry/{package-name}`
117133

118134
## Code Style Rules
135+
119136
- Follow existing code conventions in each package
120137
- Check imports and dependencies - only use libraries already in the codebase
121138
- Look at neighboring files for patterns and style
122139
- Never introduce code that exposes secrets or keys
123140
- Follow security best practices
124141

125142
## Before Every Commit Checklist
143+
126144
1.`yarn lint` (fix all issues)
127145
2.`yarn test` (all tests pass)
128146
3.`yarn build:dev` (builds successfully)
129147
4. ✅ Target `develop` branch for PRs (not `master`)
130148

131149
## Documentation Sync
150+
132151
**IMPORTANT**: When editing CLAUDE.md, also update .cursor/rules/sdk_development.mdc and vice versa to keep both files in sync.

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"clean:all": "run-s clean:build clean:tarballs clean:caches clean:deps clean:watchman",
2323
"fix": "run-s fix:prettier fix:lerna",
2424
"fix:lerna": "lerna run fix",
25-
"fix:prettier": "prettier \"**/*.{md,css,yml,yaml}\" \"packages/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" \"dev-packages/!(e2e-tests)/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" --write",
25+
"fix:prettier": "prettier \"**/*.{md,css,yml,yaml,mdc}\" \"packages/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" \"dev-packages/!(e2e-tests)/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" --write",
2626
"changelog": "ts-node ./scripts/get-commit-list.ts",
2727
"link:yarn": "lerna exec yarn link",
2828
"lint": "run-s lint:prettier lint:lerna",
2929
"lint:lerna": "lerna run lint",
30-
"lint:prettier": "prettier \"**/*.{md,css,yml,yaml}\" \"packages/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" --check",
30+
"lint:prettier": "prettier \"**/*.{md,css,yml,yaml,mdc}\" \"packages/**/**.{ts,js,mjs,cjs,mts,cts,jsx,tsx,astro,vue}\" --check",
3131
"lint:es-compatibility": "lerna run lint:es-compatibility",
3232
"dedupe-deps:check": "yarn-deduplicate yarn.lock --list --fail",
3333
"dedupe-deps:fix": "yarn-deduplicate yarn.lock",
@@ -165,6 +165,13 @@
165165
"options": {
166166
"proseWrap": "preserve"
167167
}
168+
},
169+
{
170+
"files": "*.mdc",
171+
"options": {
172+
"parser": "markdown",
173+
"proseWrap": "preserve"
174+
}
168175
}
169176
]
170177
}

0 commit comments

Comments
 (0)