0.1.1 • Published 3 years ago

@sajari/eslint-config v0.1.1

Weekly downloads
114
License
MIT
Repository
github
Last release
3 years ago

@sajari/eslint-config

A Sajari-specific ESLint configuration for JavaScript, TypeScript & React projects.

This config extends

Setup

1. Install

yarn add babel-eslint@^10.1.0 \
        eslint@^7.16.0 \
        eslint-plugin-import@^2.22.1 \
        eslint-plugin-jsx-a11y@^6.4.1 \
        eslint-plugin-prettier@^3.3.0 \
        eslint-plugin-react@^7.22.0 \
        eslint-plugin-react-hooks@^4.2.0 \
        eslint-plugin-simple-import-sort@^7.0.0 \
        prettier@^2.2.1 \
        prettier-eslint@12.0.0 \
        @typescript-eslint/eslint-plugin@^4.4.1 \
        --dev

Or if you don't need React support...

yarn add babel-eslint@^10.1.0 \
        eslint@^7.16.0 \
        eslint-plugin-import@^2.22.1 \
        eslint-plugin-prettier@^3.3.0 \
        eslint-plugin-simple-import-sort@^7.0.0 \
        prettier@^2.2.1 \
        prettier-eslint@12.0.0 \
        --dev
{
    "extends": "@sajari/eslint-config/base"
}

2. Configure ESLint

Add "extends": "@sajari/eslint-config" to your ESLint config file.

If you don't need React support, add "extends": "@sajari/eslint-config/base" instead.

An example .eslintrc.js:

module.exports = {
  extends: ["@sajari/eslint-config"],
};

3. Configure the ESLint TypeScript parser

This config requires knowledge of your TypeScript config.

In your ESLint config, set parserOptions.project to the path of your tsconfig.json.

For example:

 module.exports = {
   extends: ['@sajari/eslint-config'],
+  parserOptions: {
+    project: './tsconfig.json',
+ }
 };