Skip to content

Commit

Permalink
config: silence react and jest warnings about versions
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-sokolov committed Nov 25, 2024
1 parent 986f368 commit 18ee971
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,24 @@ export const main = {
typescript: true,
},
react: {
version: "detect",
version: (function () {
try {
return require("react/package.json").version;
} catch (e) {
// If no React, silence the warning about missing version
return "16";
}
})(),
},
jest: {
version: (function () {
try {
return require("jest/package.json").version;
} catch (e) {
// If no Jest, silence the warning about missing version
return 27;
}
})(),
},
},
} satisfies Linter.Config;

0 comments on commit 18ee971

Please sign in to comment.