Skip to content

Commit

Permalink
eslint-module-utils: filePath in parserOptions
Browse files Browse the repository at this point in the history
Refs #839
  • Loading branch information
sompylasar committed May 19, 2017
1 parent 1377f55 commit b4d75c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ exports.default = function parse(path, content, context) {

// always attach comments
parserOptions.attachComment = true

// provide the `filePath` like eslint itself does, in `parserOptions`
// https://github.com/eslint/eslint/blob/3ec436eeed0b0271e2ed0d0cb22e4246eb15f137/lib/linter.js#L637
parserOptions.filePath = path

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

0 comments on commit b4d75c8

Please sign in to comment.