Replies: 1 comment
-
Lint Best PracticesLately I've taken to changing the lint config in package.json to look like this: "scripts": {
"lint": "npx eslint@^8 *.js test",
"lint:fix": "npx eslint@^8 *.js test --fix",
}
"devDependencies": {
"@haraka/eslint-config": "^1.1.2",
"haraka-test-fixtures": "^1.3.4"
} I've also been removing eslint from the
We used to list |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For years now, the Haraka project has had automated code formatting and linting via
eslint
. We configure eslint with local .eslintrc files within each package, and the bulk of the configs coming from a shared eslint-plugin-haraka package, which in turn also shares fromeslint:recommended
.Code linting and formatting happen locally on the developers machine when they run
npm run lint
, 'npm run lintfix', and also automatically every time a PR is opened or pushed to the GitHub repo via the lint GHA workflow I've set up.The world is changing on us.
eslint
is exiting the formatting game and will focus solely on linting. To get us ready for that future, I have modified our haraka-eslint package and removed all the deprecated formatting rules. To minimize any potential disruption, and to conform with current eslint standards, the updated package is now published as @haraka/eslint-config. This newer config adds the Haraka globals and similar configs that can be removed from each package when they are updated.For plenty of reasons (particularly, the hair on the heads of our developers and maintainers), we will need to choose a new code formatter. There's a variety to choose from but Prettier is the 900# gorilla in this space.
Prettier Pros
Prettier Cons
1 vote ·
Beta Was this translation helpful? Give feedback.
All reactions