The Official lvkdotsh javascript/typescript style-guide and linting rules.
Using npm
:
npm install --save-dev eslint eslint-plugin-lvksh
or if you prefer to use the yarn
package manager:
yarn add -D eslint eslint-plugin-lvksh
Recommended .eslintrc.json
:
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021
},
"extends": [
"plugin:lvksh/recommended"
],
"ignorePatterns": ["!**/*"],
"plugins": ["lvksh"],
"env": {
"node": true
},
"rules": {}
}
The linting command you probably want to use. (Add this to your scripts section)
"lint": "eslint -c .eslintrc.json --ext .ts ./src"
Or if your project also has tests
"lint": "eslint -c .eslintrc.json --ext .ts ./src ./tests"
You might also have to install @typescript-eslint/parser
, and probably typescript
.
In addition to the above a .prettierrc
file is also recommended with the following contents.
{
"tabWidth": 4,
"useTabs": false,
"singleQuote": true
}
This package is licensed under the MIT.