Added complexity rule for api query methods [warn]

- We want to keep behaviour in services and libraries, not in API endpoints
- This rule runs complexity _only_ on the query methods, and has it set super low - just 3
- Methods that have higher complexity are a great indicator of places where we've left behaviour in the API, however!
- It's indicative, not definitive. At least with an eslint rule we can if needs be disable it where we decide the code is OK
This commit is contained in:
Hannah Wolfe 2021-05-07 20:41:14 +01:00
parent 2e5977a137
commit ba6f51850e
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55

View File

@ -16,6 +16,12 @@ module.exports = {
'one-var': [2, 'never']
},
overrides: [
{
files: 'core/server/api/canary/*',
rules: {
'ghost/ghost-custom/max-api-complexity': 'warn'
}
},
{
files: 'core/shared/**',
rules: {