Skip to content

Commit fcd8934

Browse files
authoredFeb 1, 2023
expiring-todo-comments: Do not normalize package.json (#1871) (#2020)
1 parent ba1a00e commit fcd8934

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎rules/expiring-todo-comments.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ const messages = {
4747
'Unexpected \'{{matchedTerm}}\' comment without any conditions: \'{{comment}}\'.',
4848
};
4949

50-
const packageResult = readPkgUp.sync();
50+
// We don't need to normalize the package.json data, because we are only using 2 properties and those 2 properties
51+
// aren't validated by the normalization. But when this plugin is used in a monorepo, the name field in the
52+
// package.json is invalid and would make this plugin throw an error. See also #1871
53+
const packageResult = readPkgUp.sync({normalize: false});
5154
const hasPackage = Boolean(packageResult);
5255
const packageJson = hasPackage ? packageResult.packageJson : {};
5356

0 commit comments

Comments
 (0)
Please sign in to comment.