Merge pull request #14727 from overleaf/bg-eslint-rule-for-node-fetch

restrict use of node-fetch using eslint rules

GitOrigin-RevId: 79fd41a7f69e68d2f9f9c55c5d46ffd7bf3c00fd
This commit is contained in:
Brian Gough
2023-09-11 08:05:10 +00:00
committed by Copybot
parent 78a493d78d
commit b77f4f1379
+10 -1
View File
@@ -101,7 +101,16 @@
"import/no-extraneous-dependencies": ["error", {
// do not allow importing of devDependencies.
"devDependencies": false
}]
}],
// do not allow node-fetch in backend code
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.name='require'] > .arguments[value='node-fetch']",
"message": "Requiring node-fetch is not allowed in production services, please use fetch-utils."
}
]
}
},
{