Skip to content
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

Allow, or ignore, @ decorators #819

Closed
owenayres opened this issue Mar 10, 2017 · 4 comments

Comments

@owenayres
Copy link

commented Mar 10, 2017

I have JS Standard running nicely on my project, with one annoying issue. My project is running in React and Webpack, with Babel, so I'm using shiny features such as decorators with frameworks like MobX (the framework I use to manage state).

The problem here is that JS Standard doesn't like, or shall we say recognise, what these decorators are. It will throw an error like: -

src/components/Avatar/Avatar.js:6:1: Parsing error: Unexpected character '@'

My React component might look something like this, as a really simple example: -

@CSSModules(styles, { allowMultiple: true })
class Avatar extends Component {
  render() {
    const { whatever } = this.props
    return <MyHtmlStuff whatever={whatever} styleName='example' />
  }
}

export default Avatar

It doesn't get the @CSSModules declaration in the above example. Is there something we can do to easily support this in a future release?

Cheers,
Owen

@timoxley

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2017

@owenayres

This comment has been minimized.

Copy link
Author

commented Mar 10, 2017

@timoxley Yep, that fixed my issue. Thanks for linking me up, feel stupid for missing this...!

@owenayres owenayres closed this Mar 10, 2017

@progtarek

This comment has been minimized.

Copy link

commented Feb 28, 2018

HI @owenayres , @timoxley
I am working on angular 5 application, I have a similar problem with decorator

import { Injectable } from '@angular/core'
@Injectable()
export class WindowService {
}

'Injectable' is defined but never used.

@CJStroud

This comment has been minimized.

Copy link

commented Mar 5, 2018

Think it is related to babel/babel-eslint#545

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.