2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Updated eslint to make restricted requires clearer

- url service is responsible for many problem requires, and will be removed soon
- the same with lib/common/events
- excluding these leaves us with a handful of much harder to solve requires clearly indicated
This commit is contained in:
Hannah Wolfe 2021-10-16 17:27:08 +01:00
parent 81fdde05b9
commit bd4000e7f7
No known key found for this signature in database
GPG key ID: 9F8C7532D0A6BA55

View file

@ -51,7 +51,7 @@ module.exports = {
// },
// These are critical refactoring issues that we need to tackle ASAP
{
name: path.resolve(__dirname, 'core/server/**'),
name: [path.resolve(__dirname, 'core/server/**'), `!${path.resolve(__dirname, 'core/server/lib/common/**')}`],
message: 'Invalid require of core/server from core/frontend.'
}
]]
@ -62,7 +62,8 @@ module.exports = {
rules: {
'ghost/node/no-restricted-require': ['off', [
{
name: path.resolve(__dirname, 'core/frontend/**'),
// Throw an error for all requires of the frontend, _except_ the url service which will be moved soon
name: [path.resolve(__dirname, 'core/frontend/**'), `!${path.resolve(__dirname, 'core/frontend/services/url/**')}`],
message: 'Invalid require of core/frontend from core/server.'
}
]]