Skip to content

Commit 4ee4e10

Browse files
committed
fix: add jsdoc support in ESLint
1 parent 84fb148 commit 4ee4e10

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { dirname } from 'node:path';
22
import { fileURLToPath } from 'node:url';
33
import antfu from '@antfu/eslint-config';
4+
import jsdoc from 'eslint-plugin-jsdoc';
45
import jsxA11y from 'eslint-plugin-jsx-a11y';
56
import playwright from 'eslint-plugin-playwright';
67
import storybook from 'eslint-plugin-storybook';
@@ -55,14 +56,22 @@ export default antfu(
5556
// --- Custom Rule Overrides ---
5657
{
5758
rules: {
59+
// --- JSDoc Rules ---
60+
// To avoid redefine errors with Antfu, JSDoc rules are added here
61+
...jsdoc.configs['flat/recommended-typescript'].rules,
62+
5863
'antfu/no-top-level-await': 'off', // Allow top-level await
5964
'style/brace-style': ['error', '1tbs'], // Use the default brace style
6065
'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface`
6166
'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
6267
'react-hooks/incompatible-library': 'off', // Disable warning for compilation skipped
68+
'react-hooks/exhaustive-deps': 'off', // Disable exhaustive-deps in useEffect
6369
'node/prefer-global/process': 'off', // Allow using `process.env`
6470
'test/padding-around-all': 'error', // Add padding in test files
6571
'test/prefer-lowercase-title': 'off', // Allow using uppercase titles in test titles
72+
'jsdoc/require-jsdoc': 'off', // JSDoc comments are optional
73+
'jsdoc/require-returns': 'off', // Return types are optional
74+
'jsdoc/require-hyphen-before-param-description': 'error', // Enforce hyphen before param description
6675
},
6776
},
6877
);

playwright.config.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@ export default defineConfig<ChromaticConfig>({
1515
// Look for files with the .spec.js or .e2e.js extension
1616
testMatch: '*.@(spec|e2e).?(c|m)[jt]s?(x)',
1717
// Timeout per test, test running locally are slower due to database connections with PGLite
18-
timeout: 60 * 1000,
18+
timeout: 30 * 1000,
1919
// Fail the build on CI if you accidentally left test.only in the source code.
2020
forbidOnly: !!process.env.CI,
2121
// Reporter to use. See https://playwright.dev/docs/test-reporters
2222
reporter: process.env.CI ? 'github' : 'list',
2323

2424
expect: {
2525
// Set timeout for async expect matchers
26-
timeout: 20 * 1000,
26+
timeout: 15 * 1000,
2727
},
2828

2929
// Run your local dev server before starting the tests:
3030
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
3131
webServer: {
32-
command: process.env.CI ? 'npx run-p db-server:memory start' : 'npx run-p db-server:memory dev:next',
32+
command: process.env.CI ? 'npx run-p db-server:memory start --race' : 'npx run-p db-server:memory dev:next --race',
3333
url: baseURL,
34-
timeout: 2 * 60 * 1000,
34+
timeout: 60 * 1000,
3535
reuseExistingServer: !process.env.CI,
36+
gracefulShutdown: { signal: 'SIGTERM', timeout: 2 * 1000 },
3637
env: {
3738
NEXT_PUBLIC_SENTRY_DISABLED: 'true',
3839
},

0 commit comments

Comments
 (0)