mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Added require rules for server<>frontend [off]
- These rules will help us to enforce that server code should not be required from the frontend, and vice versa - They are disabled/off for now because they are too noisy and not quick to fix - Having them in place makes it easy to set them to warn to preview how we're getting on with fixing them ahead of enabling them
This commit is contained in:
parent
895bffec1f
commit
2e5977a137
31
.eslintrc.js
31
.eslintrc.js
@ -1,3 +1,5 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
@ -19,15 +21,40 @@ module.exports = {
|
||||
rules: {
|
||||
'ghost/node/no-restricted-require': ['warn', [
|
||||
{
|
||||
name: '../server/**',
|
||||
name: path.resolve(__dirname, 'core/server/**'),
|
||||
message: 'Invalid require of core/server from core/shared.'
|
||||
},
|
||||
{
|
||||
name: '../frontend/**',
|
||||
name: path.resolve(__dirname, 'core/server/**'),
|
||||
message: 'Invalid require of core/frontend from core/shared.'
|
||||
}
|
||||
]]
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @TODO: enable these soon
|
||||
*/
|
||||
{
|
||||
files: 'core/frontend/**',
|
||||
rules: {
|
||||
'ghost/node/no-restricted-require': ['off', [
|
||||
{
|
||||
name: path.resolve(__dirname, 'core/server/**'),
|
||||
message: 'Invalid require of core/server from core/frontend.'
|
||||
}
|
||||
]]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: 'core/server/**',
|
||||
rules: {
|
||||
'ghost/node/no-restricted-require': ['off', [
|
||||
{
|
||||
name: path.resolve(__dirname, 'core/frontend/**'),
|
||||
message: 'Invalid require of core/frontend from core/server.'
|
||||
}
|
||||
]]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user