1.1.0 • Published 2 years ago
@textkernel/eslint-config v1.1.0
@textkernel/eslint-config
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.
Installation
- 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-configAvailable ESLint configs
@textkernel/eslint-config/base
The base export contains common rules that are not specific to any framework or environment.
// eslintrc.js
module.exports = {
extends: ['@textkernel/eslint-config/base'],
};@textkernel/eslint-config
The default export that extends @textkernel/eslint-config adding Typescript rules.
// eslintrc.js
module.exports = {
extends: ['@textkernel/eslint-config'],
};@textkernel/eslint-config/react
Extends @textkernel/eslint-config adding specific rules to React.
// eslintrc.js
module.exports = {
extends: ['@textkernel/eslint-config/react'],
};VSCode integration
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.
Repease and Publishing
- Bump the
versioninpackage.jsonin your branch. - Merge your branch into the
masterbranch. - Switch to the master branch and pull all changes:
git checkout master git pull
4. Log in to the npm registry:
```bash
npm login- Publish the library to npm:
npm publish --access public