0.0.11 • Published 4 years ago
@digital-natives/eslint-config-digitalnatives-typescript-base v0.0.11
Digital Natives Base ESLint and Prettier Config
Usage
- Install the dependencies with
npx install-peerdeps --dev @digital-natives/eslint-config-digitalnatives-typescript-base
If you use yarn, run
npm info @digital-natives/eslint-config-digitalnatives-typescript-base@latest peerDependencies
then run yarn add --dev <dependency>@<version>
for each listed peer dependency.
- Create a
.eslintrc
file in the root directory and add
{
"extends": "@digital-natives/digitalnatives-typescript-base",
"parserOptions": {
"project": "./tsconfig.json"
}
}
Add these scripts in the package.json
file
"scripts": {
"lint": "eslint . --ext .js,.ts",
"lint:fix": "eslint --fix . --ext .js,.ts"
},
VSCode configuration
- Install ESLint package
- Add these to your VSCode settings file
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
"[typescript]": {
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"prettier.disableLanguages": [
"javascript",
"typescript",
],