Callstack ESLint config utilizing Flow/TypeScript, Prettier, Jest, React and React Native.
Plugins and configs used:
- Default config (w/ React and React Native):
- Node config:
Additionally, it sets these environments:
Default config:
{
"env": {
"browser": true,
"es6": true,
"node": true,
"react-native/react-native": true
}
}
Node config:
{
"env": {
"browser": true,
"es6": true,
"node": true
}
}
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
Add to your ESLint config (.eslintrc
, or eslintConfig
field in package.json
):
{
"extends": "@callstack"
}
or
{
"extends": "@callstack/eslint-config/node"
}
{
"extends": "@callstack",
"rules": {
"global-require": 0,
"prefer-destructuring": 0
}
}
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