nvm update
parent
ea1f117f05
commit
d89be46080
@ -1,44 +1,50 @@
|
|||||||
# Javascript
|
# Javascript
|
||||||
|
|
||||||
## Code Style
|
## Code Style
|
||||||
|
|
||||||
* [Info](https://javascript.info/coding-style)
|
* [Info](https://javascript.info/coding-style)
|
||||||
* [Google Style](https://google.github.io/styleguide/jsguide.html)
|
* [Google Style](https://google.github.io/styleguide/jsguide.html)
|
||||||
* [StandardJS](https://standardjs.com/)
|
* [StandardJS](https://standardjs.com/)
|
||||||
* General guide
|
* General guide
|
||||||
* Indentation : +2 spaces
|
* Indentation : +2 spaces
|
||||||
* A line space between code block
|
* A line space between code block
|
||||||
* Column limit : 80
|
* Column limit : 80
|
||||||
* Use single quote `'` for strings
|
* Use single quote `'` for strings
|
||||||
* Use `===` for equality check
|
* Use `===` for equality check
|
||||||
* A space between `:` and value in key-value pair
|
* A space between `:` and value in key-value pair
|
||||||
|
|
||||||
### [ESLint](https://eslint.org/)
|
### [ESLint](https://eslint.org/)
|
||||||
|
|
||||||
* Install package
|
* Install package
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ npm install -g eslint
|
$ npm install -g eslint
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Create `.eslintrc` config file
|
* Create `.eslintrc` config file
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"extends": "eslint:recommended",
|
"extends": "eslint:recommended",
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"node": true,
|
"node": true,
|
||||||
"es6": true
|
"es6": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-console": 0,
|
"no-console": 0,
|
||||||
"indent": 2
|
"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...
|
||||||
Loading…
Reference in New Issue