rdy / eslint-config-callstack

ESLint preset extending Flow, Prettier and Jest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-config-callstack

Greenkeeper badge

Callstack ESLint config utilizing Flow/TypeScript, Prettier, Jest, React and React Native.

Plugins and configs used:

Additionally, it sets these environments:

Default config:

{
  "env": {
    "es6": true,
    "node": true,
    "react-native/react-native": true
  }
}

Node config:

{
  "env": {
    "es6": true,
    "node": true
  }
}

Installation

yarn add --dev eslint @callstack/eslint-config

Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like

Usage

Add to your ESLint config (.eslintrc, or eslintConfig field in package.json):

{
  "extends": "@callstack"
}

or for Node.js projects:

{
  "extends": "@callstack/eslint-config/node"
}

Example of extending the configuration

{
  "extends": "@callstack",
  "rules": {
    "global-require": 0,
    "prefer-destructuring": 0
  }
}

TypeScript

In order to use this config in TypeScript project make sure you have installed following dependencies:

Then when running ESLint add --ext '.js,.ts' (you might need also .jsx, .tsx) option, for example:

yarn eslint --ext '.js,.ts' ./src

About

ESLint preset extending Flow, Prettier and Jest

License:MIT License


Languages

Language:JavaScript 87.5%Language:TypeScript 12.5%