0

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?

Gama11
  • 31,714
  • 9
  • 78
  • 100
Mr.B
  • 397
  • 5
  • 16
  • what do you mean in your "user folder"? I believe the vs code coffeelint extension reads coffeelint.json from the root of the workspace that you have opened. Is that the file that you have added those lines to? – Llewey Aug 31 '17 at 22:20

1 Answers1

2

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

Mr.B
  • 397
  • 5
  • 16
  • 2
    As of today, this doesn't work. There isn't a coffeelint.json file in either my ~/ dir, or within my workspace in the VScode editor. There is no section in my .code-workspace file either. And when I edit the package.json for my project to add line_endings, level: ignore, that has zero effect. – JohnO Nov 08 '18 at 20:47