-
-
Notifications
You must be signed in to change notification settings - Fork 75
[Error] Global Node Objects '__dirname' and '__filename' #145
Comments
Can you please paste in the complete error you're seeing? |
This looks to be a bug in typescript. Any variable, function, or class declaration that starts with two underscores will have three when parsed. Related: Will look into a possible fix. |
I have opened a new typescript issue for this bug: |
Thanks for hunting that down, @soda0289! I'll ping the TypeScript team if they don't pick up on that issue soon |
Got a response from typescript. We can use the unescapeIdentifier function to return the real identifier name. Will submit PR soon. |
…slint#145) Typescript will prepend an underscore to an identifier when it starts with two leading underscores. This causes rules to break in eslint becuase identifiers do not match those in the source code.
…lint#145) Typescript will prepend an underscore to an identifier when it starts with two leading underscores. This causes rules to break in eslint becuase identifiers do not match those in the source code.
@ajtorres9 This should now be fixed on master. NPM update will likely follow once the other open PR is merged |
Thanks all for your efforts, I appreciate it. 👍 |
What version of TypeScript are you using?
2.0.3
What version of
typescript-eslint-parser
are you using?1.0.2
What code were you trying to parse?
What did you expect to happen?
This project was originally pure JavaScript, my team and I are currently in the process of migrating it to TypeScript. Prior to the migration, the line:
path: path.resolve(__dirname, './seeders'),
, would pass our linting rules.What happened?
After implementing 'typescript-eslint-parser', the line:
path: path.resolve(__dirname, './seeders'),
, results in a 'no-undef' error.The text was updated successfully, but these errors were encountered: