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-08 13:35:48 +01:00 committed by Copybot
parent 78a493d78d
commit b77f4f1379

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."
}
]
}
},
{