Monorepo eslint config with some custom rules and prettier integration
npx install-peerdeps --dev @globalfishingwatch/linting
# or
yarn|pnpm add @globalfishingwatch/linting -D --peerFlat config >= v9
to your eslint.config.mjs:
import gfwConfig from '@globalfishingwatch/linting'
export default gfwConfigLegacy usage < v9
- Add to your
.eslintrc:
{
"extends": "@globalfishingwatch/linting/legacy"
}- Add the config to either your
package.json:
{
"eslintConfig": {
"extends": "@globalfishingwatch/linting"
}
}to your .prettierrc.js:
export default '@globalfishingwatch/linting/prettier'Install the ESLint and Prettier VSCode extensions:
ext install esbenp.prettier-vscode dbaeumer.vscode-eslintCopy this to settings.json
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false, // avoids running the format twice,
"eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},