You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.5 KiB

Javascript

Code Style

  • Info
  • Google Style
  • StandardJS
  • General guide
    • Indentation : +2 spaces
    • A line space between code block
    • Column limit : 80
    • Use single quote ' for strings
    • Use === for equality check
    • A space between : and value in key-value pair

ESLint

  • Install package
$ npm install -g eslint

  • Create .eslintrc config file
{
  "extends": "eslint:recommended",
  "env": {
    "browser": true,
    "node": true,
    "es6": true
  },
  "rules": {
    "no-console": 0,
    "indent": 2
  }
}
  • NVM use issue
    • Delete/remove/uninstall the version of node in your "C:\Program Files\nodejs" directory. To the point where there is no more "nodejs" directory at all.
    • Delete the existence of nvm (C:\Users\xxx\AppData\Roaming\nvm), basically, manually delete the nvm dir.
    • Download your desired version of nvm (https://github.com/coreybutler/nvm-windows/releases)
    • Open a CMD prompt (run as administrator), and install the downloaded version of nvm, nvm-setup.exe, from within this CMD command prompt.
    • From within the admin level command prompt, run "nvm install 7.2.1", or whatever node version you want to install. Probably you will be installing multiple versions, so repeat as needed.
    • Now do the usual "nvm use ...", "nvm list", etc...