Javascript Aurelia中的变量绑定不会导致undef ESLint错误

Javascript Aurelia中的变量绑定不会导致undef ESLint错误,javascript,aurelia,eslint,Javascript,Aurelia,Eslint,在自定义元素中的变量上使用Aurelia的@bindable装饰器时,ESLint抱怨没有定义该变量 import { bindable } from "aurelia-framework"; export class Logo { @bindable click; // eslint will error on this line with no-undef ... } 我假设bindabledecorator将在类中定义变量,但是在该行上定义注释之前,是否应该在不包含ES

在自定义元素中的变量上使用Aurelia的
@bindable
装饰器时,ESLint抱怨没有定义该变量

import { bindable } from "aurelia-framework";

export class Logo {
  @bindable click;    // eslint will error on this line with no-undef

  ...
}
我假设
bindable
decorator将在类中定义变量,但是在该行上定义
注释之前,是否应该在不包含
ESLint disable line no use的情况下采取一些措施来避免此ESLint错误

运行我的linter给了我:

/src/resources/elements/logo.js
7:15  error  'click' is not defined                             no-undef

试试
@bindable()点击
@avrahamcool谢谢你的建议,但我只是尝试了一下,结果还是出现了同样的eslint错误