Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up@Property decorators throw "Parsing error: Unexpected token" #380
Comments
This comment has been minimized.
This comment has been minimized.
|
Can you please provide a code example thats causing the issue? |
This comment has been minimized.
This comment has been minimized.
|
You mentioned angular 2, are you trying to run typescript through standard? |
This comment has been minimized.
This comment has been minimized.
|
Of course, here you go. I'm running Traceur (ie ES6 not Typescript) with the following config: traceurOptions: {
"annotations": true,
"types": true,
"memberVariables": true
},Here's a sample: @Component({
selector: 'designs',
providers: [ DesignService ],
injectables: [ DesignService ]
})
@View({
templateUrl: 'app/components/designs/designs.html',
directives: [ DesignComponent ]
})
export class DesignsComponent {
constructor (@Inject(DesignService) designService) {
// console.log('designs');
// fetch the design data
this.designs = designService.getDesigns();
}
}In this case the |
This comment has been minimized.
This comment has been minimized.
JeremyBYU
commented
Jan 13, 2016
|
Same issue using es6 Decorators with the atom standardjs library. To be more specific I am using react-mixin package Maybe this issue from eslint issues |
This comment has been minimized.
This comment has been minimized.
|
Use https://github.com/feross/standard#can-i-use-a-custom-js-parser-for-bleeding-edge-es6-or-es7-support |
rstacruz
closed this
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
rstacruz
reopened this
Jan 15, 2016
feross
closed this
Feb 4, 2016
This comment has been minimized.
This comment has been minimized.
dhax
commented
Feb 12, 2016
|
I'm having the same problem right now using aurelia framework and after searching issues here and for babel-eslint I can't figure out where the actual problem lies in. Linting breaks with Parsing error: Unexpected token Illegal for the '@'
I have babel-eslint set as standard parser in package.json. Do I need to add additional settings maybe? |
This comment has been minimized.
This comment has been minimized.
AndreiBelokopytov
commented
Nov 28, 2016
|
Same problem for me: "Parsing error: Unexpected character '@'". I am using React and React DnD with ES7 decorators style.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AndreiBelokopytov
commented
Nov 28, 2016
|
@bcomnes thanks, your solution works for me. |
This comment has been minimized.
This comment has been minimized.
schtauffen
commented
May 26, 2017
|
@bcomnes @AndreiBelokopytov that section seems to have been removed. |
This comment has been minimized.
This comment has been minimized.
schtauffen
commented
May 26, 2017
•
|
I was able to find it using the way back machine.
|
This comment has been minimized.
This comment has been minimized.
Rachomir
commented
Jan 24, 2018
•
|
does anyone found a solution? I am also receiving error 'somethingWithDecoratort' is defined but never used no-unused-vars |
evanplaice commentedJan 11, 2016
I'm using Angular2+ES6 which requires both @Class and @Property decorators.
With the parser set to 'babel-eslint' the class decorators aren't throwing any style errors. Property decorators (ex @input, @Inject) are.
FYI. I'm using Traceur with annotations enabled, so this could just be a shortcoming of the Babel parser.