Skip to content

MenuDocs/eslint-config-tesseract

Repository files navigation

MenuDocs-lint

Central shareable eslint config for all MenuDocs projects

Installation

Pre-requisites

npm

npm i -D eslint-config-tesseract eslint

yarn

yarn add -D eslint-config-tesseract eslint

GitHub

  • npm:
npm i --save-dev MenuDocs/eslint-config-tesseract eslint
  • yarn:
yarn add -D MenuDocs/eslint-config-tesseract eslint

Standard ESLint rules

{
    "extends": "tesseract"
}

Standar ESlint rules for Typescript

  • npm:
npm i --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
  • yarn:
yarn add -D @typescript-eslint/parser @typescript-eslint/eslint-plugin
{
    "extends": "tesseract/typescript"
}

Prettier

  • npm:
npm i --save-dev prettier eslint-plugin-prettier eslint-config-prettier
  • yarn:
yarn add -D prettier eslint-plugin-prettier eslint-config-prettier

Standard ESLint rules and Prettier

{
    "extends": "tesseract/prettier"
}

Standard ESLint rules and Prettier for Typescript

Note: Prettier config extends TypeScript eslint config.

{
    "extends": "tesseract/prettier/typescript"
}

Setting up ESLint rules

ESLint may display a lot of warnings and errors about your code when you start using it, but don't let this startle you. In order to get started, follow these steps:

  1. Create a file in your root directory named .eslintrc.json (where your main project file is located).
  2. Copy the code below into the file.
{
    "extends": "tesseract"
}