We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent 7240f61 commit 9f9213dCopy full SHA for 9f9213d
bin/lint-staged.js
@@ -1,6 +1,8 @@
1
#!/usr/bin/env node
2
3
import fs from 'fs'
4
+import path from 'path'
5
+import { fileURLToPath } from 'url'
6
7
import cmdline from 'commander'
8
import debug from 'debug'
@@ -17,7 +19,8 @@ if (supportsColor.stdout) {
17
19
// Do not terminate main Listr process on SIGINT
18
20
process.on('SIGINT', () => {})
21
-const packageJson = JSON.parse(fs.readFileSync('package.json'))
22
+const packageJsonPath = path.join(fileURLToPath(import.meta.url), '../../package.json')
23
+const packageJson = JSON.parse(fs.readFileSync(packageJsonPath))
24
const version = packageJson.version
25
26
cmdline
0 commit comments