CoffeeLint: Disable Warning message: Line exceeds maximum allowed length

别等时光非礼了梦想. 提交于 2019-12-13 03:47:39

问题


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 :)



来源:https://stackoverflow.com/questions/45982820/coffeelint-disable-warning-message-line-exceeds-maximum-allowed-length

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!