eslint-plugin-react-native-normalized

1.1.2 • Public • Published

eslint-plugin-react-native-normalized

Prevents the import of native components of React Native when there is a version of react-native-normalized available.

Installation

# Shell
npm install -D eslint-plugin-arithmetic
// eslintrc.js
{
    "plugins": ["react-native-normalized"],
    "rules": {
        "react-native-normalized/forbid-native-components": "error"
    }
}

Options

This rule supports the follwing options:

  • disallowed: Which imports are not allowed from react-native. Defaults to ['Text', 'Alert', 'Image']. Possible values: Array of Text, Alert, Image, ActivityIndicator, TextInput

Rule details

Fail

import {Text} from 'react-native'
const {Text, Image} = require('react-native')

Pass

import {Text} from 'react-native-normalized' // Import from normalized
import {View} from 'react-native' // No react-native-normalized version available.

Ideas for further development

  • Autofixing :D

Author

Package Sidebar

Install

npm i eslint-plugin-react-native-normalized

Weekly Downloads

104

Version

1.1.2

License

ISC

Unpacked Size

7.58 kB

Total Files

5

Last publish

Collaborators

  • jonny