Eslint padded-blocks:[“error”,{“blocks”:“never”}]无效

时间:2018-03-24 16:00:21

标签: eslint eslint-config-airbnb

我的eslint定义是:

padded-blocks: ["error", { "blocks": "never" }]

我的代码是:

Vue.directive('confirm', {
  bind(el, binding) {
    el.addEventListener('click', () => {
...

但我还是得到了:

✘  http://eslint.org/docs/rules/padded-blocks  Block must not be padded by blank lines
   src/directives/confirm.js:6:40
     el.addEventListener('click', () => {

这是一些错误吗?

由于

1 个答案:

答案 0 :(得分:1)

如果我理解你的例子那么它应该是

padded-blocks: ["error", { "blocks": "always" }]