ESLint shareable config for Textkernel style guide
@textkernel/eslint-config is a shareable configuration package for eslint built on top of eslint-airbnb-config and modified to meet Textkernel's own standards.
- Install all peer dependencies
npx install-peerdeps --dev @textkernel/eslint-config
- Install @textkernel/eslint-config as a development dependency of your project:
npm install @textkernel/eslint-config --save-dev
- Install yarn @textkernel/eslint-config:
yarn add --dev @textkernel/eslint-config
The base export contains common rules that are not specific to any framework or environment.
// eslintrc.js
module.exports = {
extends: ['@textkernel/eslint-config/base'],
};
The default export that extends @textkernel/eslint-config
adding Typescript rules.
// eslintrc.js
module.exports = {
extends: ['@textkernel/eslint-config'],
};
Extends @textkernel/eslint-config
adding specific rules to React.
// eslintrc.js
module.exports = {
extends: ['@textkernel/eslint-config/react'],
};
We recommend turning on VSCode settings to automatically run eslint --fix
on save.
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
}
This will automatically format your code once you save. You don't need VSCode prettier extension enabled or running on save as eslint will automatically run prettier
for you.
- Bump the
version
inpackage.json
in your branch. - Merge your branch into the
master
branch. - Switch to the master branch and pull all changes:
git checkout master
git pull
- Log in to the npm registry:
npm login
- Publish the library to npm:
npm publish --access public