Gathering detailed insights and metrics for @hannohealth/eslint-config
Gathering detailed insights and metrics for @hannohealth/eslint-config
Gathering detailed insights and metrics for @hannohealth/eslint-config
Gathering detailed insights and metrics for @hannohealth/eslint-config
npm install @hannohealth/eslint-config
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
21
3
6
A global ESLint and Prettier configuration with opinionated defaults for Hanno's JavaScript projects.
In addition to our base ESLint configuration, we also include variants for our Node, React and React Native projects.
This repository is private, but the package itself is published on npm and includes this README.
yarn add -D @hannohealth/eslint-config
yarn add -D @babel/core eslint prettier
In your prettier.config.js
file, add the following:
module.exports = require('@hannohealth/eslint-config/prettier.config');
The base
configuration provides a baseline set of rules that are mainly drawn from eslint:recommended
, with a few modifications.
Add the following to your .eslintrc.js
file:
module.exports = {
extends: ['@hannohealth'],
};
It introduces the following plugins:
@babel/eslint-plugin
eslint-plugin-jest
eslint-plugin-jest-formatting
eslint-plugin-import
eslint-plugin-flowtype
eslint-plugin-promise
eslint-plugin-eslint-comments
eslint-plugin-sonarjs
We also include eslint-config-prettier
for Prettier compatibility and eslint-plugin-prettier
to notify any Prettier errors as ESLint errors in ESLint.
These rules are designed to enforce defensive programming, but there's still room for improvement. The following scenarios haven't been covered yet, but might be re-considered in the future:
TODO-complexity
TODO-typing
.The node
configuration extends base
, but is otherwise a relatively minimal configuration which sets the environment to Node and allows us to use console logs.
To integrate, add the following to your .eslintrc.js
file:
module.exports = {
extends: ['@hannohealth/eslint-config/node'],
};
The react
configuration extends base
with some rules specific to React.
To integrate, add the following to your .eslintrc.js
file:
module.exports = {
extends: ['@hannohealth/eslint-config/react'],
};
It introduces the following plugins:
The react-native
configuration extends base
with some rules specific to React Native. Among other things, this enables the React Native globals and allows us to properly use the module resolver in a React Native codebase.
To integrate, add the following to your .eslintrc.js
file:
module.exports = {
extends: ['@hannohealth/eslint-config/react-native'],
};
It introduces the following plugins:
Even though this configuration inherits the eslint-plugin-cypress
from our React configuration, which is not suited for React Native, this shouldn't interfere with the React Native setup.
If you're VS Code user, you may find adding this config to your .vscode/settings.json
helpful when you integrate the configuration into your project. This will ensure that linting happens on save and applies the appropriate settings:
1{ 2 "eslint.format.enable": true, 3 "editor.formatOnSave": true 4}
To set up the project for development:
asdf install nodejs
(assuming you are using asdf to manage your node version)npm install --global yarn
yarn
to install dependencies.When modifying this package, we suggest the following workflow, to test the package locally, and also in a more complex project which makes more extensive use of the rules:
yarn
to update dependencies.yarn lint:all
to perform initial checks.npx yalc publish
.npx yalc add @hannohealth/eslint-config
, then yarn
to install updated dependencies.npx yalc publish --push
, then yarn
in the new project to install updated dependencies.No vulnerabilities found.
No security vulnerabilities found.