alj1s / eslint-plugin-react-native-import

Simple plugin to check for native imports in non-native code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-plugin-react-native-import

Checks cross-platform code for react-native import in non-native executing code

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-react-native-import:

$ npm install eslint-plugin-react-native-import --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-react-native-import globally.

Usage

Add react-native-import to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "react-native-import"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "react-native-import/no-native-import": 2
    }
}

Supported Rules

  • react-native-import/no-native-import

About

Simple plugin to check for native imports in non-native code


Languages

Language:JavaScript 100.0%