-
-
Notifications
You must be signed in to change notification settings - Fork 75
[Error] Decorated getter error #102
Comments
Note: We do not yet officially support TypeScript 2 (although that does not mean that it does not work in all cases). It is not clear from your debug output that this parser, or even ESLint, is the cause of your issue. Please provide more information as to what is going wrong. What is your ESLint config? |
{
"parser": "typescript-eslint-parser",
"extends": ["airbnb"],
"env": {
"node": true,
"jasmine": true
},
"globals": {
"jest": true
},
"rules": {
// conflicts with 'arrow body style'
"no-confusing-arrow": "off",
// due to TypeScript
"no-undef": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"react/prop-types": "off"
}
} |
In future, please provide more detailed source code, and in a form which can be copied. Naturally if you give me a screenshot, I have to manually type it out. There is an error being thrown inside the core An immediate workaround for the error is to disable the rule in your eslint config:
@nzakas I have investigated this a bit:
|
I took a look into this issue. It is caused by the keyword-spacing rule as @JamesHenry pointed out. When the If we remove the decorator then the first token found is I looked into how babel-eslint parser handles this situation, since they do not throw an error. They change the node.kind to 'method' instead of 'get' or 'set' which skips over checking the first token. For @JamesHenry @nzakas |
I have opened an issue on eslint to hopefully gain some more attention. |
Should be fixed in eslint 3.17 |
What version of TypeScript are you using?
^2.0.3
What version of
typescript-eslint-parser
are you using?^0.4.0
What code were you trying to parse?
I'm getting an error if I'm using a decorated getter (using Mobx). Information is in the attached npm debug. This is the code sample:
If I remove the
@computed
thingie, or theget
thingie, it works. It breaks when both are used simultaneously.Thanks 👍
What did you expect to happen?
expected it to lint my code correctly
What happened?
npm-debug.txt
The text was updated successfully, but these errors were encountered: