-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filePath
is not provided to parser
in parserOptions
#839
Comments
makes sense to me 👍 |
* eslint-module-utils: filePath in parserOptions Refs #839 * eslint-module-utils: Add tests for parserOptions Refs #839 * eslint-module-utils: Reverted manual version bumps. Refs #839 * Add sinon, replace eslint-module-utils test spy with sinon.spy * Fix CHANGELOG merge error * eslint-module-utils: Add more tests for parse (coverage 100%) * eslint-module-utils: In tests move require stub parser to the top.
published under v2.4.0, thanks! |
uh oh, seems to break the cache! not sure why this isn't caught by tests but it introduces a substantial perf + memory regression. unpublishing v2.1.0 of eslint-module-utils! |
@benmosher What? 0_o Which cache? How did you spot the regression? |
Cache issue investigation here: #863 |
reiterating here: I determined the leak is in republished with v2.1.1 of utils 👍🏻 |
I'm trying to make a conditional eslint parser which decides based on filename which parser to execute: Babel or TypeScript (because my project will soon contain both types of files which need to live together under a single eslint config for some time).
The native eslint parse call provides
filePath
in theparserOptions
, which turned out the only and the very useful way to determine the file name:https://github.com/eslint/eslint/blob/3ec436eeed0b0271e2ed0d0cb22e4246eb15f137/lib/linter.js#L637
But when
eslint-plugin-import
parses its dependencies, it calls the custom parser on its own, and does not providefilePath
inparserOptions
:https://github.com/benmosher/eslint-plugin-import/blob/90ef48b3ade57c77526b285f75dc0cfc41537831/utils/parse.js#L28
This should not be a big change to add that, I'll propose a PR soon.
The text was updated successfully, but these errors were encountered: