A
A
alaskafx2022-03-12 19:38:12
Linter
alaskafx, 2022-03-12 19:38:12

How to tell the linter not to swear at semicolons and commas in the last key, etc.?

I have a project on naxte, for a while I tolerated what the linter forces to remove ; and , at the end of each line (in logical places, of course), as well as

empty objects that are revealed
const options = {

}
 // объект просто становится красным полностью, мол: убери-ка эту строчку
and
extra line break
какой-то код
   //  <-- это пропущенная строка, которая выделяется красным и проект просто стопится из-за этого, и выдаёт ошибку
очередной код
but I'm tired of it.
How to tell linter to ignore them?
Now I have this setup:
module.exports = {
  root: true,
  env: {
    browser: true,
    node: true
  },
  parserOptions: {
    parser: '@babel/eslint-parser',
    requireConfigFile: false
  },
  extends: [
    '@nuxtjs',
    'plugin:nuxt/recommended'
  ],
  plugins: [
  ],
  // add your custom rules here
  rules: {}
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Morev, 2022-03-12
@alaskafx

The editor should tell you which rule caused the report.
Maybe not an editor, but a stupid pop-up overlay that I always turn off - not the point.
It looks something like this:
622cdaa5863dc703037887.jpeg
In the configuration object, disable unnecessary rules accordingly:

rules: {
  'sonarjs/prefer-single-boolean-return': 'off',
  'no-unused-vars': 'off',
}

But it's better not to `off`, but reassign to your preferences.
List of ESLint Rules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question