README
Sentry ESLint
Installation
yarn add -D eslint prettier husky lint-staged @sentryhealth/eslint-config
Use
Copy the following files to the root of the new project, this way it will ensure formatting by your editor.
.editorconfig
.huskyrc
.lintstagedrc
.prettierrc
Add a
lint
script in yourpackage.json
, this needs to be only run when adding formatting the first time, the following timeshusky
will create a pre-commit hook linting only changed files and enforcing the formatting.{ "lint": "prettier --write '**/*.{yaml,yml,json,md,html,css}' && eslint '**/*.{js,vue,gql}' --fix" }
Create a file
.eslintrc.js
and add the followingmodule.exports = { root: true, extends: ['@sentryhealth/eslint-config'], };
By default this configuration has disabled both
node
andbrowser
environments besides the assumptions made below, turn them on/off accordangly with overrides.
Assumptions
This configuration tries to fit the sentryhealth
project standard, so there are some assumptions made, you can always override them in case they don't fit right.
client/*
Files inside have access to the browser variables and the variableprocess
, to read variable environments.api/*
Files inside have access to node variables.tests/*
Files inside have access to node, browser and mocha variables.dist/*
Files inside are ignored*.config.js
Files that end with.config.js
, have access to node variables; even inside the client folder
VSCode
To ensure the best experience while developing, use the following extensions:
dbaeumer.vscode-eslint
editorconfig.editorconfig
esbenp.prettier-vscode
jcbuisson.vue
prisma.vscode-graphql
They will use the files you copied as configuration.
Publish
This project uses a .npmrc
file as authorization, so there's no need to login. In case there are changes you want across all packages, do the changes here in .eslintrc.js
, bump the version inside package.json
, then:
npm publish --access=public
You will need to update the package across all the consumer projects, using:
yarn add -D @sentryhealth/eslint-config@latest