2.1.1 • Published 7 months ago
@hs-web-team/eslint-config-node v2.1.1
Hubspot Marketing WebTeam ESLint rules for Node.js
This is a list of ESLint rules that are recommended for use with Hubspot Marketing WebTeam projects.
Index
Setup
Install as dev dependency
npm i -D @hs-web-team/eslint-config-node@latestAdd to
.eslintrcin project root directory{ "extends": "@hs-web-team/eslint-config-node" }Extend the eslint on a project basis by adding rules to
.eslintrce.g.{ "extends": "@hs-web-team/eslint-config-node", "settings": { "import/resolver": "webpack" } }
Where to use it
This package is intended to be used as a starting point for ESLint rules for Backend Node.js projects, and not for use in browser environments.
Using the Prettier Scripts
This package includes a utility script to automatically add Prettier configuration to your project.
Run the script:
node ./node_modules/@hs-web-team/eslint-config-node/bin/add-prettier-scripts.jsThe script will:
- Add
prettier:checkandprettier:writescripts to your package.json - Install Prettier as a dev dependency if not already installed
- Create a
.prettierrc.jsfile with shared config - Create a
.prettierignorefile with sensible defaults
- Add
After installation, you can use the following commands:
npm run prettier:check- Check files for formatting issuesnpm run prettier:write- Automatically fix formatting issues
Migration from v1 to v2
See MIGRATION-V2.md