Skip to content

Commit 60146ca

Browse files
authored
fix(eslint-config): update jsdoc handling and bump deps (#311)
- Cast pluginReact to any and disable ts/no-explicit-any inline avoid TypeScript errors accessing shared plugins - Import eslint-plugin-jsdoc once, reuse it, and merge its recommended rules into our jsdoc config - Add-specific jsdoc rule overrides: no-restrictedyntax, reject-any-type, reject-function-type, require-jsdoc, require-next-type, and retain tag-lines enforcement - Bump multiple workspace package versions (next, types, ts-eslint, vitest plugin, jsdoc plugin, react-hooks, svelte, svelte-eslint-parser, tsdown, lint-staged, etc.) and update pnpm-workspace/lockfile ## Summary by CodeRabbit ## Release Notes * **Chores** * Updated ESLint plugins and development dependencies to latest versions, including TypeScript, Node types, and framework-specific tooling * Refined JSDoc configuration handling in ESLint setup
1 parent ad65fa2 commit 60146ca

File tree

5 files changed

+463
-342
lines changed

5 files changed

+463
-342
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@mheob/eslint-config": patch
3+
---
4+
5+
update jsdoc handling and bump deps

packages/eslint-config/src/configs/jsdoc.ts

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,24 @@ import type { TypedFlatConfigItem } from '../types';
22
import { interopDefault } from '../utils';
33

44
export async function jsdoc(): Promise<TypedFlatConfigItem[]> {
5+
const jsdocPlugin = await interopDefault(import('eslint-plugin-jsdoc'));
6+
const recommendedRules = jsdocPlugin.configs['flat/recommended'].rules;
7+
58
return [
69
{
710
name: 'mheob/jsdoc/rules',
811
plugins: {
9-
jsdoc: await interopDefault(import('eslint-plugin-jsdoc')),
12+
jsdoc: jsdocPlugin,
1013
},
1114
rules: {
12-
'jsdoc/check-access': 'warn',
13-
'jsdoc/check-alignment': 'warn',
14-
'jsdoc/check-param-names': 'warn',
15-
'jsdoc/check-property-names': 'warn',
16-
'jsdoc/check-tag-names': 'warn',
17-
'jsdoc/check-types': 'warn',
18-
'jsdoc/check-values': 'warn',
19-
'jsdoc/empty-tags': 'warn',
20-
'jsdoc/implements-on-classes': 'warn',
21-
'jsdoc/multiline-blocks': 'warn',
22-
'jsdoc/no-defaults': 'warn',
23-
'jsdoc/no-multi-asterisks': 'warn',
24-
'jsdoc/no-undefined-types': 'warn',
25-
'jsdoc/require-param': 'warn',
26-
'jsdoc/require-param-description': 'warn',
27-
'jsdoc/require-param-name': 'warn',
28-
'jsdoc/require-property': 'warn',
29-
'jsdoc/require-property-description': 'warn',
30-
'jsdoc/require-property-name': 'warn',
31-
'jsdoc/require-returns': 'warn',
32-
'jsdoc/require-returns-check': 'warn',
33-
'jsdoc/require-returns-description': 'warn',
34-
'jsdoc/require-yields': 'warn',
35-
'jsdoc/require-yields-check': 'warn',
15+
...recommendedRules,
16+
17+
'jsdoc/no-restricted-syntax': 'warn',
18+
'jsdoc/reject-any-type': 'warn',
19+
'jsdoc/reject-function-type': 'warn',
20+
'jsdoc/require-jsdoc': 'warn',
21+
'jsdoc/require-next-type': 'warn',
3622
'jsdoc/tag-lines': ['warn', 'always', { count: 0, startLines: 1 }],
37-
'jsdoc/valid-types': 'warn',
3823
},
3924
},
4025
];

packages/eslint-config/src/configs/react.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export async function react(
4848
const isUsingReactRouter = ReactRouterPackages.some(i => isPackageExists(i));
4949
const isUsingNext = NextJsPackages.some(i => isPackageExists(i));
5050

51-
const plugins = pluginReact.configs.all.plugins;
51+
// eslint-disable-next-line ts/no-explicit-any
52+
const plugins = (pluginReact.configs.all as any).plugins;
5253

5354
return [
5455
{

0 commit comments

Comments
 (0)