@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
22
33import { defineConfig , globalIgnores } from 'eslint/config' ;
44import { includeIgnoreFile } from '@eslint/compat' ;
5- // import { getJsdocProcessorPlugin } from 'eslint-plugin-jsdoc/getJsdocProcessorPlugin.js';
5+ import { getJsdocProcessorPlugin } from 'eslint-plugin-jsdoc/getJsdocProcessorPlugin.js' ;
66
77import globals from 'globals' ;
88import js from '@eslint/js' ;
@@ -206,33 +206,27 @@ export default defineConfig([
206206 ...jsdocRules
207207 }
208208 } ,
209- // @todo no errors are reported in IDE/CLI
210- // {
211- // name: 'jsdoc example processor',
212- // files: ['src/**/*.js'],
213- // plugins: {
214- // examples: getJsdocProcessorPlugin({
215- // // allowedLanguagesToProcess: ['js', 'javascript'],
216- // // @todo
217- // // https://github.com/gajus/eslint-plugin-jsdoc/blob/99cb131ee40fa10f943aadfd73a6d18da082882f/docs/rules/check-examples.md#examplecoderegex-and-rejectexamplecoderegex
218- // // without the regex jsdoc fails to parse the examples
219- // // the processor expects js but gets html
220- // // "343:6 error @example error: Fatal: Parsing error: Unexpected token <"
221- // exampleCodeRegex: '^<code>.*</code>$'
222- // })
223- // },
224- // processor: 'examples/examples'
225- // },
226- // {
227- // // https://github.com/gajus/eslint-plugin-jsdoc/blob/99cb131ee40fa10f943aadfd73a6d18da082882f/docs/processors.md#processors
228- // // https://github.com/gajus/eslint-plugin-jsdoc/blob/99cb131ee40fa10f943aadfd73a6d18da082882f/src/index.js#L414
229- // name: 'jsdoc example rules',
230- // files: ['src/**/*.md/*.js'],
231- // rules: {
232- // ...commonRules,
233- // 'no-undef': off
234- // }
235- // },
209+ {
210+ name : 'jsdoc example processor' ,
211+ files : [ 'src/**/*.js' ] ,
212+ plugins : {
213+ examples : getJsdocProcessorPlugin ( {
214+ allowedLanguagesToProcess : [ 'js' , 'javascript' ] ,
215+ exampleCodeRegex : / < c o d e > \s ( [ \s \S ] * ?) < \/ c o d e > /
216+ } )
217+ } ,
218+ processor : 'examples/examples'
219+ } ,
220+ {
221+ // https://github.com/gajus/eslint-plugin-jsdoc/blob/99cb131ee40fa10f943aadfd73a6d18da082882f/docs/processors.md#processors
222+ // https://github.com/gajus/eslint-plugin-jsdoc/blob/99cb131ee40fa10f943aadfd73a6d18da082882f/src/index.js#L414
223+ name : 'jsdoc example rules' ,
224+ files : [ 'src/**/*.md/*.js' ] ,
225+ rules : {
226+ 'no-undef' : off ,
227+ 'no-unused-vars' : off
228+ }
229+ } ,
236230 {
237231 name : 'p5 node env' ,
238232 files : [
0 commit comments