Skip to content

Commit 65b0dc0

Browse files
authored
fix(check-values): workaround parse-imports-exports bug in handling trailing whitespace; fixes #1373 (#1374)
1 parent 6d5c9fb commit 65b0dc0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

docs/rules/check-values.md

+5
Original file line numberDiff line numberDiff line change
@@ -430,5 +430,10 @@ function quux (foo) {
430430
/**
431431
* @import * as Linters from "eslint"
432432
*/
433+
434+
/** @import { ReactNode } from 'react' */
435+
436+
/** @type {ReactNode} */
437+
export const TEST = null
433438
````
434439

src/rules/checkValues.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default iterateJsdoc(({
174174
? `${typePart}${name} ${description}`
175175
: `${typePart}${name}`);
176176

177-
const importsExports = parseImportsExports(imprt);
177+
const importsExports = parseImportsExports(imprt.trim());
178178

179179
if (importsExports.errors) {
180180
report(

test/rules/assertions/checkValues.js

+8
Original file line numberDiff line numberDiff line change
@@ -631,5 +631,13 @@ export default /** @type {import('../index.js').TestCases} */ ({
631631
*/
632632
`,
633633
},
634+
{
635+
code: `
636+
/** @import { ReactNode } from 'react' */
637+
638+
/** @type {ReactNode} */
639+
export const TEST = null
640+
`,
641+
},
634642
],
635643
});

0 commit comments

Comments
 (0)