Skip to content

Commit 5ca5db7

Browse files
committed
testing(check-examples): avoid absolute path for matchingFileName and avoid use of dummy file
1 parent b289ca5 commit 5ca5db7

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ function quux () {}
689689
function quux2 () {
690690

691691
}
692-
// Settings: {"jsdoc":{"matchingFileName":"test/rules/data/dummyfile.js"}}
692+
// Settings: {"jsdoc":{"matchingFileName":"test/rules/data/dummy.js"}}
693693
// Message: @example error (semi): Missing semicolon.
694694

695695
/**

src/rules/checkExamples.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export default iterateJsdoc(({
159159

160160
linter.defineRules(linterRules);
161161

162+
// Could also support `disableFixes` and `allowInlineConfig`
162163
messages = linter.verify(source, config, {
163164
filename,
164165
reportUnusedDisableDirectives

test/rules/assertions/checkExamples.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
/* eslint-disable no-restricted-syntax */
22

3-
// After `importMeta` no longer experimental, we can use this ESM
4-
// approach over `__dirname`?
5-
// import {fileURLToPath} from 'url';
6-
// import {join, dirname} from 'path';
7-
// join(dirname(fileURLToPath(import.meta.url)), 'babel-eslint')
8-
93
export default {
104
invalid: [
115
{
@@ -320,7 +314,7 @@ export default {
320314
],
321315
settings: {
322316
jsdoc: {
323-
matchingFileName: require.resolve('../data/test.js')
317+
matchingFileName: 'test/rules/data/dummy.js'
324318
}
325319
}
326320
},

test/rules/data/test.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)