JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 30134
  • Score
    100M100P100Q136171F
  • License ISC

Pluggable ESLint config for React Native that you can import, extend and override

Package Exports

  • eslint-config-react-native/style-guide

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-react-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Pluggable ESLint config for React Native that you can import, extend and override

Join the chat at https://gitter.im/kunalgolani/eslint-config npm version npm downloads GitHub issues Deps Dev Deps

React Native: Safety Checks and Best Practices with a bias toward code concision / brevity

Usage

In your js project directory:

npm install --save-dev eslint-config-react-native

And in your .eslintrc.yaml:

extends:
  - react-native

Alternatively, in your .eslintrc.js or .eslintrc.json:

{
  "extends": ["react-native"]
}

To add a git-hook to your commits, consider using husky

npm install --save-dev husky

And in your package.json:

  "scripts": {
    "precommit": "eslint ."
  }

Config

This config is biased and opinionated, and errs on the side of too many rules instead of too few. Think of this as a superset of your repo's lint config, and discard what you don't like in it. It's easy to override and disable the rules you find inconvenient.

env:
  browser: true

enables browser features and global variables

plugins:
  - react
  - react-native

provides React, JSX and React Native specific rules

extends:
  - esnext
  - plugin:react/recommended

enables jsx parsing, includes config and rules from eslint-config-esnext and the following react-specific recommended rules:

rules:

selected from here, configured to:


React Native Style Guide