Skip to content

Commit 7e60005

Browse files
committed
Move camelcase lint error suppressions to eslint config
1 parent b3c7e84 commit 7e60005

9 files changed

Lines changed: 7 additions & 26 deletions

File tree

.clinerules/project-standards.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Follow the coding standards defined in `.github/instructions/`:
1010
Key rules:
1111

1212
- Use TypeScript exclusively
13-
- Testing with Container API and happy-dom
1413
- Never use manual HTML fixtures
1514
- No apologizing, be direct/concise
1615
- Wait for permission before implementing suggestions

.github/instructions/astro.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ applyTo: "docs/**/*.astro"
1212
- When testing Astro components, use the Astro Container API instead of manual HTML fixtures.
1313
- This ensures tests stay in sync with component changes automatically.
1414
- Reference: Astro Container API Documentation at docs.astro.build/en/reference/container-reference/
15-
- Note: The Container API does not work reliably in jsdom/vitest environments. Use happy-dom instead.
15+
- There is a model component and test demonstrating this pattern in the src/components/Test directory named webComponent.

.github/instructions/general.instructions.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,9 @@ Always use the `navigateToPage()` method for client-side navigation - never ad-h
6767
- Reference the working example in src/components/Test/container.astro and its test file.
6868
- Use experimental_AstroContainer.create() to instantiate the container.
6969
- Use container.renderToString(Component) to get rendered HTML from actual Astro components.
70-
- For DOM unit testing with Container API: use `// @vitest-environment happy-dom` for better DOM compatibility than jsdom or node.
7170
- Configure Vitest with getViteConfig() from 'astro/config' to support Astro Container API.
7271
- Test files should follow a client.spec.ts naming pattern or similar.
7372
- Fixture files should follow a componentName.fixture.astro naming pattern (e.g., newsletter.fixture.astro).
74-
- Use `// @vitest-environment happy-dom` as the first line of test files that need DOM support with Container API. Never include Vitest directives inside JSDoc comments.
75-
- happy-dom provides proper document, window, and localStorage globals without manual mocking.
76-
- JavaScript loading warnings from happy-dom are silenced in vitest.setup.ts for clean test output.
7773
- A working example test using the Container API is available at /home/kevin/Repos/Webstack Builders/Corporate Website/astro.webstackbuilders.com/src/components/Test/container.spec.ts
7874

7975
## E2E Testing Standards

.github/instructions/testing.instructions.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ applyTo: "**/*.spec.ts"
88

99
- **NEVER use manual HTML strings** - use Astro's Container API with actual .astro templates
1010
- **Test fixtures MUST import actual components**, not duplicate HTML
11-
- Reference: https://docs.astro.build/en/reference/container-reference/
12-
- Use `experimental_AstroContainer.create()` to instantiate container
13-
- Use `container.renderToString(Component)` to render
14-
- Use `// @vitest-environment happy-dom` for DOM support
15-
- Configure Vitest with `getViteConfig()` from 'astro/config'
16-
- Naming: `client.spec.ts` for tests, `componentName.fixture.astro` for fixtures
17-
- Working example: `src/components/Test/container.spec.ts`
11+
- Naming: `filename.spec.ts` for tests, `componentName.fixture.astro` for fixtures
12+
- Working example: `src/components/Test/__tests__/webComponent.spec.ts`
1813

1914
## E2E Testing
2015

eslint.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,10 @@ export default [
429429

430430
{
431431
files: [
432-
'src/pages/api/gdpr/consent.ts',
433-
'src/pages/api/gdpr/request-data.ts',
434-
'src/pages/api/gdpr/verify.ts',
435-
'src/pages/api/newsletter/_token.ts',
432+
'src/lib/config/serviceWorker.ts',
433+
'src/components/scripts/store/__tests__/socialEmbeds.spec.ts',
434+
'src/pages/api/**/*',
435+
'src/pages/manifest.json.ts',
436436
],
437437
rules: {
438438
camelcase: 'off',

src/components/scripts/store/__tests__/socialEmbeds.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ describe('Embed Cache Management', () => {
107107

108108
it('should expose cache state getters and setters', () => {
109109
const state = {
110-
/* eslint-disable camelcase */
111110
entry_a: { data: { html: 'A' }, timestamp: 0, ttl: 1000 },
112111
entry_b: { data: { html: 'B' }, timestamp: 0, ttl: 1000 },
113-
/* eslint-enable camelcase */
114112
}
115113

116114
setEmbedCacheState(state)

src/lib/config/serviceWorker.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export const serviceWorkerConfig: PwaOptions = {
88
registerType: 'autoUpdate',
99
manifest: {
1010
name: 'Webstack Builders',
11-
// eslint-disable-next-line camelcase
1211
short_name: 'WSB',
13-
// eslint-disable-next-line camelcase
1412
theme_color: '#ffffff',
1513
icons: [
1614
{

src/pages/api/newsletter/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,14 @@ export async function subscribeToConvertKit(
100100
subscriber: {
101101
id: 999999,
102102
state: 'active',
103-
/* eslint-disable camelcase */
104103
email_address: data.email,
105104
first_name: data.firstName || null,
106105
created_at: new Date().toISOString(),
107-
/* eslint-enable camelcase */
108106
fields: {},
109107
},
110108
}
111109
}
112110

113-
/* eslint-disable camelcase */
114111
const subscriberData: ConvertKitSubscriber = {
115112
email_address: data.email,
116113
state: 'active',
@@ -119,7 +116,6 @@ export async function subscribeToConvertKit(
119116
if (data.firstName) {
120117
subscriberData.first_name = data.firstName.trim()
121118
}
122-
/* eslint-enable camelcase */
123119

124120
try {
125121
const response = await fetch('https://api.kit.com/v4/subscribers', {

src/pages/manifest.json.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const buildManifestPayload = () => {
2525
})
2626
}
2727

28-
/* eslint-disable camelcase */
2928
const manifest = {
3029
lang: 'en_US',
3130
dir: 'ltr',

0 commit comments

Comments
 (0)