Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Settings for ESLINT to ignore warnings like "extra semicolon"

I'm using the Atom Code Editor for a VueJS Project with ESLINT (feross). By trying to quickly prototype a layout I get these errors.

Missing space before opening brace
Strings must use singlequote
Extra semicolon

During the prototype phase I would like ESLINT/ATOM to disable/ignore these errors and render the site anyways. How to do that?

like image 573
Tom Avatar asked Jul 31 '18 07:07

Tom


2 Answers

You could temporarily turn off eslint. In my setup, inspecting build/webpack.base.conf.js shows the following snippet:

  module: {
    rules: [
      ...(config.dev.useEslint ? [createLintingRule()] : []),
      {
        test: /\.vue$/,

The linting rule will enable eslint. Lets avoid that and set config.dev.useEslint to false. Go to config/index.js and alter the following snippet:

// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: false,
like image 183
Sumurai8 Avatar answered Sep 26 '22 06:09

Sumurai8


In your .eslintrc file, do the following:

  "rules": {
    "space-before-blocks": "off",
    "quotes": "off",
    "no-extra-semi": "off"
  }

This will turn off the above rules. I would suggest instead of turning it off let it throw warning, so in future you remember to fix these issues.

ESLint has an awesome documentation: https://eslint.org/docs/rules/

like image 32
Apurva jain Avatar answered Sep 25 '22 06:09

Apurva jain