We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
gajus
brettz9
Learn more about funding links in repositories.
Report abuse
getJsdocProcessorPlugin
1 parent 2fbd47c commit 87a1270Copy full SHA for 87a1270
src/getJsdocProcessorPlugin.js
@@ -1,6 +1,8 @@
1
// Todo: Support TS by fenced block type
2
3
-import {readFileSync} from 'fs';
+import {readFileSync} from 'node:fs';
4
+import { dirname, join } from 'node:path';
5
+import { fileURLToPath } from 'node:url';
6
import * as espree from 'espree';
7
import {
8
getRegexFromString,
@@ -13,9 +15,11 @@ import {
13
15
parseComment,
14
16
} from '@es-joy/jsdoccomment';
17
18
+const __dirname = dirname(fileURLToPath(import.meta.url));
19
+
20
const {version} = JSON.parse(
21
// @ts-expect-error `Buffer` is ok for `JSON.parse`
- readFileSync('./package.json')
22
+ readFileSync(join(__dirname, '../package.json'))
23
);
24
25
// const zeroBasedLineIndexAdjust = -1;
0 commit comments