yarn add eslint eslint-config-molindo --dev
.eslintrc.js
:module.exports = {
// Add configs based on your needs
extends: [
'molindo/typescript', // Or `molindo/javascript`
'molindo/react', // Optional
'molindo/css-modules', // Optional
'molindo/tailwind', // Optional
'molindo/jest', // Optional
'molindo/cypress' // Optional
]
}
"extends": "eslint-config-molindo/tsconfig.json"
to your tsconfig.json
.Set the env
in .eslintrc
as necessary so ESLint doesn't report missing globals.
E.g.:
{
"browser": true,
"node": true,
"es6": true,
"jest": true
}
It's strongly recommended to use an eslint integration for your editor of choice (e. g. dbaeumer.vscode-eslint
for VSCode so you see warnings and errors while writing code. Also the setting to auto fix errors on save should be turned on, so purely stylistic errors such as the ones reported by prettier
are fixed automatically.
If your linter plugin checks your code as you type (before you save) it can be helpful to silence stylistic errors to reduce noise and let the formatting happen on save.