Skip to content

Commit ef70063

Browse files
authored
fix(valid-title): handle missing argument in valid-title rule (#942)
Signed-off-by: ysknsid25 <kengo071225@gmail.com>
1 parent 089732f commit ef70063

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/rules/valid-title.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ export default createEslintRule<Options, MESSAGE_IDS>({
248248
}
249249

250250
const [argument] = node.arguments
251+
if (!argument) {
252+
return
253+
}
251254

252255
const getArgumentType = () => {
253256
if (!settings.typecheck) return null
@@ -259,10 +262,7 @@ export default createEslintRule<Options, MESSAGE_IDS>({
259262
const type = getArgumentType()
260263
if (type && isClassOrFunctionType(type)) return
261264

262-
if (
263-
!argument ||
264-
(allowArguments && argument.type === AST_NODE_TYPES.Identifier)
265-
)
265+
if (allowArguments && argument.type === AST_NODE_TYPES.Identifier)
266266
return
267267

268268
if (!isStringNode(argument)) {

0 commit comments

Comments
 (0)