2021-05-07 22:25:50 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
2021-05-07 12:30:41 +03:00
|
|
|
module.exports = {
|
|
|
|
env: {
|
|
|
|
es6: true,
|
|
|
|
node: true
|
|
|
|
},
|
|
|
|
plugins: ['ghost'],
|
|
|
|
extends: [
|
|
|
|
'plugin:ghost/node'
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
// @TODO: remove this rule once it's turned into "error" in the base plugin
|
|
|
|
'no-shadow': 'error',
|
|
|
|
'no-var': 'error',
|
2021-06-30 17:37:23 +03:00
|
|
|
'one-var': ['error', 'never']
|
2021-05-07 15:21:22 +03:00
|
|
|
},
|
|
|
|
overrides: [
|
2021-05-07 22:41:14 +03:00
|
|
|
{
|
|
|
|
files: 'core/server/api/canary/*',
|
|
|
|
rules: {
|
|
|
|
'ghost/ghost-custom/max-api-complexity': 'warn'
|
|
|
|
}
|
|
|
|
},
|
2021-05-07 15:21:22 +03:00
|
|
|
{
|
|
|
|
files: 'core/shared/**',
|
|
|
|
rules: {
|
2021-05-26 14:34:39 +03:00
|
|
|
'ghost/node/no-restricted-require': ['error', [
|
2021-05-07 15:21:22 +03:00
|
|
|
{
|
2021-05-07 22:25:50 +03:00
|
|
|
name: path.resolve(__dirname, 'core/server/**'),
|
2021-05-07 15:21:22 +03:00
|
|
|
message: 'Invalid require of core/server from core/shared.'
|
|
|
|
},
|
|
|
|
{
|
2021-05-07 22:25:50 +03:00
|
|
|
name: path.resolve(__dirname, 'core/server/**'),
|
2021-05-07 15:21:22 +03:00
|
|
|
message: 'Invalid require of core/frontend from core/shared.'
|
|
|
|
}
|
|
|
|
]]
|
|
|
|
}
|
2021-05-07 22:25:50 +03:00
|
|
|
},
|
|
|
|
/**
|
|
|
|
* @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.'
|
|
|
|
}
|
|
|
|
]]
|
|
|
|
}
|
2021-05-07 15:21:22 +03:00
|
|
|
}
|
|
|
|
]
|
2021-05-07 12:30:41 +03:00
|
|
|
};
|