code style by entrecode
npm install eslint-config-entrecodeentrecode code style
> use this for shared projects, or if you want to do everything like it's meant to be
1. run this in your repo:
``sh`
npm i --save-dev eslint-config-entrecode
2. add the following properties into your package.json file:
`json`
{
…
"eslintConfig": {
"extends": "entrecode"
},
"prettier":{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "all"
},
…
}
3. add vscode settings:
`json`
{
…
"eslint.lintTask.enable": true,
"eslint.format.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"prettier.printWidth": 120,
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"html.format.enable": false,
"json.format.enable": false,
"javascript.format.enable": false,
"typescript.format.enable": false,
…
}
> use this if you want this code style applied to all projects without custom .eslintrc locally in your project
1. run this in your root projects directory:
`sh`
npm i eslint-config-entrecode
2. add .eslintrc file:
`json`
{
"extends": ["entrecode"]
}
3. add vscode settings:
`json`
{
"eslint.lintTask.enable": true,
"eslint.format.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"]
}
> like global usage, but without the module installed at top level
1. clone this repo
2. run npm i in itnpm i eslint@7 -g
3. Add this to VSCode settings:
"eslint.options": {
"configFile": "/Users/
},
4. (MUST be ESLint 7.x)
5. add vscode settings:
`json``
{
"eslint.lintTask.enable": true,
"eslint.format.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"]
}