|
1 | 1 | import { dirname } from 'node:path'; |
2 | 2 | import { fileURLToPath } from 'node:url'; |
3 | 3 | import antfu from '@antfu/eslint-config'; |
| 4 | +import jsdoc from 'eslint-plugin-jsdoc'; |
4 | 5 | import jsxA11y from 'eslint-plugin-jsx-a11y'; |
5 | 6 | import playwright from 'eslint-plugin-playwright'; |
6 | 7 | import storybook from 'eslint-plugin-storybook'; |
@@ -55,14 +56,22 @@ export default antfu( |
55 | 56 | // --- Custom Rule Overrides --- |
56 | 57 | { |
57 | 58 | rules: { |
| 59 | + // --- JSDoc Rules --- |
| 60 | + // To avoid redefine errors with Antfu, JSDoc rules are added here |
| 61 | + ...jsdoc.configs['flat/recommended-typescript'].rules, |
| 62 | + |
58 | 63 | 'antfu/no-top-level-await': 'off', // Allow top-level await |
59 | 64 | 'style/brace-style': ['error', '1tbs'], // Use the default brace style |
60 | 65 | 'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface` |
61 | 66 | 'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable |
62 | 67 | 'react-hooks/incompatible-library': 'off', // Disable warning for compilation skipped |
| 68 | + 'react-hooks/exhaustive-deps': 'off', // Disable exhaustive-deps in useEffect |
63 | 69 | 'node/prefer-global/process': 'off', // Allow using `process.env` |
64 | 70 | 'test/padding-around-all': 'error', // Add padding in test files |
65 | 71 | '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 |
66 | 75 | }, |
67 | 76 | }, |
68 | 77 | ); |
0 commit comments