Skip to content

valian-ca/eslint-config

Repository files navigation

npm version MIT license

eslint-config

Sharable eslint config created and used by Valian

eslint plugins and config used

Base configuration

Node Typescript App

React Typescript App

Usage

yarn add -D eslint @valian/eslint-config

or

npm install --save-dev eslint @valian/eslint-config

Node Typescript App Configuration

Add .eslintrc.js:

module.exports = {
  env: {
    node: true,
  },
  extends: ['@valian/eslint-config/node'],
  parserOptions: {
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.json'],
  },
}

React Typescript App Configuration

Add .eslintrc.js:

module.exports = {
  env: {
    browser: true,
  },
  extends: ['@valian/eslint-config/react'],
  parserOptions: {
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.json'],
  },
  settings: {
    react: {
      version: 'detect',
    },
  },
}