mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +03:00
781cc6f304
refs: https://github.com/TryGhost/Ghost/commit/7bce05ab8 - I wrote a custom plugin for the no-cross-requires logic between our modules after not finding anything that could do it - Then, when searching for the next rule I wanted, I found eslint-plugin-ghost has no-restricted-requires - This rule is more flexible, so switching to it - NOTE: This update to eslint-plugin-ghost also fixes performance of linting our test files by pinning eslint-plugin-mocha to v7 as v8 has performance problems
34 lines
895 B
JavaScript
34 lines
895 B
JavaScript
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',
|
|
'one-var': [2, 'never']
|
|
},
|
|
overrides: [
|
|
{
|
|
files: 'core/shared/**',
|
|
rules: {
|
|
'ghost/node/no-restricted-require': ['warn', [
|
|
{
|
|
name: '../server/**',
|
|
message: 'Invalid require of core/server from core/shared.'
|
|
},
|
|
{
|
|
name: '../frontend/**',
|
|
message: 'Invalid require of core/frontend from core/shared.'
|
|
}
|
|
]]
|
|
}
|
|
}
|
|
]
|
|
};
|