CoffeeLint: Disable Warning message: Line exceeds

2019-08-27 17:58发布

问题:

I'm trying to disable the warning message from CoffeLint in visual studio code. I've changed the coffeelint.json in my user folder to have the following:

    "max_line_length": {
    "name": "max_line_length",
    "level": "ignore"
},

But this has had no effect, the error message is still shown. Anyone can suggest whats wrong?

回答1:

Solution:

To configure coffeescript once installed there will be a default coffeelint.json in the C:\Users\ [username] \.vscode\extensions folder. This was entirly useless and changing configuration here has no effect (atleast in my case).

To solve this problem create a new coffeelint.json in the root of your project or add a coffeelintConfig section to your package.json. Either way, the configuration is exactly the same. If CoffeeLint doesn't find any configuration for the current project, it will check for a $HOME/coffeelint.json to use.

Following this an example configuration is below:

package.json

{
  "name": "your-project",
  "version": "0.0.0",
  "coffeelintConfig": {
    "indentation" : {
        "level" : "error",
        "value" : 4
    },
    "line_endings" : {
        "value" : "unix",
        "level" : "error"
    }
  }
}

coffeelint.json

{
  "indentation" : {
    "level" : "error",
    "value" : 4
  },
  "line_endings" : {
    "value" : "unix",
    "level" : "error"
  }
}

Now you can just edit this config to Lint your CoffeeScript :)