VS Code and Solidity files have a lot of warnings

by João Quintanilha   Last Updated August 13, 2019 17:28 PM

Every time I use VS Code to develop Solidity, files I have a lot of this weird warnings saying:

no-trailing-whitespace: Line contains trailing whitespace

I googled a bit and I understand why they are here. Although I would like to make my VS Code ignore them. Any help?

enter image description here



Answers 1


The reason they exist is because you are using the VS Code Solidity extension. One feature of this extension is that it enables Solium (now Ethlint). This is a linter that checks your code for errors and warnings, such as no-trailing-whitespace: Line contains trailing whitespace.

The best solution is to fix these warnings in your code, since the warnings are suggestions to follow best practices when writing Solidity. Code that follows the Solidity style guide should have no warnings like this.

If you want to remove some of these warnings without changing the code, you will need to edit your settings.json in VS Code. Within this file you can add the following line:

"solidity.soliumRules": {
}

In here, you can add rules that you want to ignore. For example, if you want to ignore the trailing whitespace warning, your settings.json file should look as follows:

"solidity.soliumRules": {
    "no-trailing-whitespace": "off"
}
shane
shane
August 13, 2019 17:03 PM

Related Questions


VS code Expected identifier, got 'LParen'solc

Updated August 14, 2019 09:28 AM



Solidity Rename Symbol (F2) in VS Code

Updated June 20, 2019 17:28 PM