Skip to content

textkernel/eslint-config-textkernel

Repository files navigation

@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

  1. Install all peer dependencies
npx install-peerdeps --dev @textkernel/eslint-config
  1. Install @textkernel/eslint-config as a development dependency of your project:
npm install @textkernel/eslint-config --save-dev
  1. Install yarn @textkernel/eslint-config:
yarn add --dev @textkernel/eslint-config

Available 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

  1. Bump the version in package.json in your branch.
  2. Merge your branch into the master branch.
  3. Switch to the master branch and pull all changes:
git checkout master
git pull
  1. Log in to the npm registry:
npm login
  1. Publish the library to npm:
npm publish --access public

About

ESLint shareable config for Textkernel style guide

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •