yapplabs / ember-strong-attrs

Declare and enforce your Ember Component's attributes and their types
MIT License
38 stars 3 forks source link

workaround for JSHint import errors? #6

Open elbeezi opened 9 years ago

elbeezi commented 9 years ago

e.g. 'requiredAttr' is defined but never used.

elbeezi commented 9 years ago

I'm currently wrapping the imports in another jshint ignore, which is starting to get ugly:

import Ember from 'ember';

/* jshint ignore: start */
import { requiredAttr, optionalAttr } from 'ember-strong-attrs';
import MyModel from '../models/my-model';
/* jshint ignore: end */

const {
  Component
} = Ember;

// TODO: make pretty things etc.

/* jshint ignore: start */
@requiredAttr('myString', String)
@optionalAttr('myModelInstance', MyModel)
/* jshint ignore: end */
export default class extends Component.extend({
}) { }
lukemelia commented 9 years ago

Yeah, that's rough. We really need jshint support for decorators I think.

elbeezi commented 9 years ago

Since JSHint is adamantly not supporting es7 until it stabilizes, is there any way we could programmatically suppress decorator-related JSHint errors until official support does land? Not too familiar with JSHint myself so I'm not sure what makes sense for now.

lukemelia commented 9 years ago

I'm sure there's a way, but it would likely involve wrapping jshint and or the broccoli plugin for it, and I'm not sure we want to go there yet.

elbeezi commented 9 years ago

:/ here's hoping for es7 decorator-land!

lukemelia commented 9 years ago

This looks like it could be an workaround for now: https://github.com/machty/broccoli-es7-decorator-jshint-guards