Visual Studio Code: Check semicolon on javascript?

13,994

Solution 1

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.

Solution 2

you need to install a extension i recommend you install esLint. esLint let you write rules to follow in your code.

Share:
13,994

Related videos on Youtube

taa
Author by

taa

Updated on June 13, 2022

Comments

  • taa
    taa almost 2 years

    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?