I
I
Igor2020-02-05 12:47:08
JavaScript
Igor, 2020-02-05 12:47:08

Eslint, how to set start-of-line rule?

Colleagues, welcome!

5e3a8e6437cae368857716.png

Existing rules

module.exports = {
  root: true,
  env: {
    browser: true,
    node: true
  },

  parserOptions: {
    "parser": "babel-eslint",
    "sourceType": "module",
  },
  extends: [
    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
    "plugin:vue/essential",
    "plugin:vue/strongly-recommended",
    "@nuxtjs"
  ],
  // required to lint *.vue files
  plugins: [
    'vue'
  ],
  // add your custom rules here
  rules: {
    "quotes": [2, "double", "avoid-escape"],
    "camelcase": "off",
    "no-multiple-empty-lines": [2, {"max": 2, "maxEOF": 0}]
  }
}


linter message
Too many blank lines at the beginning of file. Max of 1 allowed  no-multiple-empty-lines


I remove the line, the following problem appears.
5e3a8f1a31a68192293181.png

The funny thing is that the rules of two different projects are the same, in one project there are no problems, but in this one. ))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2020-02-05
@IgorPI

As it turned out in the comments to the question, the IDE has gone crazy and you need to reset the caches .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question