@exsoinn/eslint-config-exsoinn
v1.0.1
Published
Common linting rules for Node.js apps
Downloads
2
Readme
eslint-config-exsoinn
Enforcing Node.js code style since 2021.
Install
npm install --save-dev --save-exact @exsoinn/eslint-config-exsoinn@latest [email protected] eslint-config-standard@"<18" eslint-plugin-import@"<3" eslint-plugin-n@"<16" eslint-plugin-promise@"<7" eslint-config-serverless-stack@"<1" typescript-eslint@"<9" @stylistic/eslint-plugin-ts
Prepare Your Project
- Create a file called
.eslintrc.yml
and add the following contents to it:
extends:
- '@exsoinn/eslint-config-exsoinn'
In WebStorm enable ESLint. Go to
Preferences | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint
and select theAutomatic ESLint configuration
radio button.Make WebStorm reformat code (
⌥⌘L
) according to ESLint rules by doing the following. Note that you need to repeat these steps if you update ESLint rules,- Right-click on
.eslintrc.yml
, selectApply ESLint Code Style Rules
. - Go to
Editor | Code Style | TypeScript
, clickSet From...
and selectJavaScript
. - Automatically fix lint errors on saving, go to
Languages & Frameworks | JavaScript | Code Quality Tools | ESLint
, check theRun eslint --fix on save
box.
- Right-click on
Usage
In addition to problems getting reported in the IDE in real-time fashion, you can run ESLint to report errors and optionally fix them automatically via the command line:
npx lint # report errors, but do not fix them
# or
npx lint-fix # automatically fix errors
Overriding ESLint Configs
Most times this won't be necessary, and you can use as-is the ESLint rules that this configuration provides. But if you need to override any of the inherited ESLint configs, you can just add them to the .eslintrc.yml
file. The details of how to configure ESLint are beyond the scope of this document, but you can go here to learn more.
Developer
If you need to update this package, run below commands to release a new version, making sure you strictly adhere to NPM semver rules:
npm run release:dry-run # a dry run gives you a chance to review the resulting new version
npm run release # performs a release, publishing the updated package to the NPM registry