Reputation: 113
I need an extension for checking, if my javascript has a semicolon on the lineend. By searching the extension i only could find auto set semicolon extension, but i want to check large existing code.
Maybe i can build a custom rule?
Upvotes: 9
Views: 17169
Reputation: 11692
As Alexis Mateo mentioned you can use the ESLint Extension for vscode.
If you want to check for semicolons after a statement you do not need to write your own rule.
Instead by setting an option like this in vscode's settings.json
:
{
"eslint.options": { "configFile": "C:/mydirectory/.eslintrc.json" }
}
you tell the extension where to look for the rule set it should apply.
Now you add the semi rule to your .eslintrc.json
like this:
{
"rules": {
"semi": ["error", "always"]
}
}
Here you can explore further rules.
Upvotes: 20
Reputation: 57
you need to install a extension i recommend you install esLint. esLint let you write rules to follow in your code.
Upvotes: 3