Skip to content

JonnyBurger/eslint-plugin-react-native-normalized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

ESLint rule for forbidding use of React Native components when a version of react-native-normalized is available

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published