diff --git a/src/rules/checkExamples.js b/src/rules/checkExamples.js index fdbb7d540..5d0f79875 100644 --- a/src/rules/checkExamples.js +++ b/src/rules/checkExamples.js @@ -350,7 +350,7 @@ export default iterateJsdoc(({ if (!filename) { const jsFileName = context.getFilename(); if (typeof jsFileName === 'string' && jsFileName.includes('.')) { - defaultFileName = jsFileName.replace(/\..*?$/u, `.${ext}`); + defaultFileName = jsFileName.replace(/\.[^.]*$/u, `.${ext}`); } else { defaultFileName = `dummy.${ext}`; }