mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
Updated eslint rules for plugin v2.4.0
refs:10d02e8343
refs:83a30775bf
refs:3355f627c4
refs:0e9b950558
- In eslint-plugin-ghost 2.4.0 I moved some of the rules implmented in Ghost as they are global rules, including: - no new Error() - use @tryghost/errors - forcing index.js to be under 50 chars as a leading indicator for misuse of index files - I also added new rules to check for tpl('literal string') and the deprecated ghost-ignition package - Because the new Error and tpl rules are both implemented with no-restricted-syntax, the local rules overrode the global one - Removing the rule here allows the global ones to work - Have to think about how to do this long term
This commit is contained in:
parent
bd597db829
commit
df51da5f7e
13
.eslintrc.js
13
.eslintrc.js
@ -13,20 +13,9 @@ module.exports = {
|
||||
// @TODO: remove this rule once it's turned into "error" in the base plugin
|
||||
'no-shadow': 'error',
|
||||
'no-var': 'error',
|
||||
'one-var': [2, 'never'],
|
||||
'no-restricted-syntax': ['warn',
|
||||
{
|
||||
selector: 'NewExpression[callee.name=\'Error\']',
|
||||
message: 'Direct calls to new Error() are not allowed. Please use @tryghost/errors.'
|
||||
}]
|
||||
'one-var': ['error', 'never']
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: '**/index.js',
|
||||
rules: {
|
||||
'max-lines': ['warn', {skipBlankLines: true, skipComments: true, max: 50}]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: 'core/server/api/canary/*',
|
||||
rules: {
|
||||
|
Loading…
Reference in New Issue
Block a user