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:
Hannah Wolfe 2021-06-30 15:37:23 +01:00
parent bd597db829
commit df51da5f7e
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55

View File

@ -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: {