BenoitZugmeyer / eslint-plugin-html

An ESLint plugin to extract and lint scripts from HTML files.
ISC License
436 stars 51 forks source link

Inline scripts trigger no-multiple-empty-lines incorrectly #62

Closed julientechdev closed 7 years ago

julientechdev commented 7 years ago

I updated recently eslint-plugin-html to 3.0.0, and now I have false flags on my .vue components.

"warning Too many blank lines at the beginning of file. Max of 0 allowed no-multiple-empty-lines"

<template>
<div>
</div>
</template>
<script> <- Too many blank lines here
import stuff
export default {
};
</script>
BenoitZugmeyer commented 7 years ago

This is expected: as of 3.0.0, the plugin will lint script tags independently, and you have a new-line at the beginning of the script. See the migration guide to understand the impacts of this move.

As of ESLint 4.1.0, you could use an "overrides" option to customize the configuration for vue files:

"overrides": [
  {
    "files": [ "*.vue" ],
    "rules": {
        "no-multiple-empty-lines": ["error", { "maxBOF": 1 }]
    }
}