Skip to content

Commit b4d75c8

Browse files
authored
eslint-module-utils: filePath in parserOptions
Refs #839
1 parent 1377f55 commit b4d75c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

utils/parse.js

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ exports.default = function parse(path, content, context) {
2121

2222
// always attach comments
2323
parserOptions.attachComment = true
24+
25+
// provide the `filePath` like eslint itself does, in `parserOptions`
26+
// https://github.com/eslint/eslint/blob/3ec436eeed0b0271e2ed0d0cb22e4246eb15f137/lib/linter.js#L637
27+
parserOptions.filePath = path
2428

2529
// require the parser relative to the main module (i.e., ESLint)
2630
const parser = moduleRequire(parserPath)

0 commit comments

Comments
 (0)