diff --git a/docs/development/CUSTOM_RULES.md b/docs/development/CUSTOM_RULES.md index a101dadbd297..345e42c289ec 100644 --- a/docs/development/CUSTOM_RULES.md +++ b/docs/development/CUSTOM_RULES.md @@ -46,20 +46,23 @@ export const rule = createRule({ create(context) { return { FunctionDeclaration(node) { - if (/^[a-z]/.test(node.id.name)) { - context.report({ - messageId: 'uppercase', - node: node.id, - }); + if (node.id != null) { + if (/^[a-z]/.test(node.id.name)) { + context.report({ + messageId: 'uppercase', + node: node.id, + }); + } } }, }; }, + name: 'uppercase-first-declarations', meta: { docs: { - category: 'Best Practices', description: 'Function declaration names should start with an upper-case letter.', + recommended: 'warn', }, messages: { uppercase: 'Start this name with an upper-case letter.', @@ -67,6 +70,7 @@ export const rule = createRule({ type: 'suggestion', schema: [], }, + defaultOptions: [], }); ```