All Projects → Intellicode → Eslint Plugin React Native

Intellicode / Eslint Plugin React Native

Licence: mit
React Native plugin for ESLint

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Eslint Plugin React Native

Eslint Plugin Vue
Official ESLint plugin for Vue.js
Stars: ✭ 3,592 (+519.31%)
Mutual labels:  eslint-plugin, npm
Eslint Plugin Node
Additional ESLint's rules for Node.js
Stars: ✭ 740 (+27.59%)
Mutual labels:  eslint-plugin, npm
Cli
the package manager for JavaScript
Stars: ✭ 5,277 (+809.83%)
Mutual labels:  npm
Renovate
Universal dependency update tool that fits into your workflows.
Stars: ✭ 6,700 (+1055.17%)
Mutual labels:  npm
Eslint Plugin Simple Import Sort
Easy autofixable import sorting.
Stars: ✭ 493 (-15%)
Mutual labels:  eslint-plugin
Npm Gui
Graphic tool for managing javascript project dependencies - in a friendly way.
Stars: ✭ 454 (-21.72%)
Mutual labels:  npm
Request Ip
A Node.js module for retrieving a request's IP address on the server.
Stars: ✭ 501 (-13.62%)
Mutual labels:  npm
Dependency Check
checks which modules you have used in your code and then makes sure they are listed as dependencies in your package.json
Stars: ✭ 435 (-25%)
Mutual labels:  npm
Kotlin Frontend Plugin
Gradle Kotlin (http://kotlinlang.org) plugin for frontend development
Stars: ✭ 578 (-0.34%)
Mutual labels:  npm
Migrate Mongo
A database migration tool for MongoDB in Node
Stars: ✭ 481 (-17.07%)
Mutual labels:  npm
Npq
🎖safely* install packages with npm or yarn by auditing them as part of your install process
Stars: ✭ 513 (-11.55%)
Mutual labels:  npm
Npm Trends
NPM package comparison
Stars: ✭ 479 (-17.41%)
Mutual labels:  npm
Eslint Plugin Sonarjs
SonarJS rules for ESLint
Stars: ✭ 458 (-21.03%)
Mutual labels:  eslint-plugin
Bower Material
This repository is used for publishing the AngularJS Material v1.x library
Stars: ✭ 510 (-12.07%)
Mutual labels:  npm
Phin
Node HTTP client
Stars: ✭ 449 (-22.59%)
Mutual labels:  npm
Npmhub
🔎 A browser extension to explore npm dependencies on GitHub repos
Stars: ✭ 542 (-6.55%)
Mutual labels:  npm
Salus
Security scanner coordinator
Stars: ✭ 441 (-23.97%)
Mutual labels:  npm
Fetch Suspense
A React hook compatible with React 16.6's Suspense component.
Stars: ✭ 479 (-17.41%)
Mutual labels:  npm
Ultra Runner
🏃⛰ Ultra fast monorepo script runner and build tool
Stars: ✭ 496 (-14.48%)
Mutual labels:  npm
Angular Auth Oidc Client
npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
Stars: ✭ 577 (-0.52%)
Mutual labels:  npm

ESLint plugin for React Native

Greenkeeper badge

Maintenance Status NPM version Dependency Status Coverage Status Code Climate BCH compliance

React Native specific linting rules for ESLint. This repository is structured like (and contains code from) the excellent eslint-plugin-react.

Installation

Install ESLint either locally or globally.

$ npm install --save-dev eslint

To make most use of this plugin, its recommended to install eslint-plugin-react in addition to ESLint. If you installed ESLint globally, you have to install eslint-plugin-react globally too. Otherwise, install it locally.

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

Similarly, install eslint-plugin-react-native

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

Configuration

Add plugins section and specify ESLint-plugin-React (optional) and ESLint-plugin-react-native as a plugin.

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

If it is not already the case you must also configure ESLint to support JSX.

{
  "parserOptions": {
      "ecmaFeatures": {
          "jsx": true
      }
  }
}

In order to whitelist all browser-like globals, add react-native/react-native to your config.

{
  "env": {
    "react-native/react-native": true
  }
}

To use another stylesheet providers.

settings: {
    'react-native/style-sheet-object-names': ['EStyleSheet', 'OtherStyleSheet', 'PStyleSheet']
}

Finally, enable all of the rules that you would like to use.

{
  "rules": {
    "react-native/no-unused-styles": 2,
    "react-native/split-platform-components": 2,
    "react-native/no-inline-styles": 2,
    "react-native/no-color-literals": 2,
    "react-native/no-raw-text": 2,
    "react-native/no-single-element-style-arrays": 2,
  }
}

List of supported rules

Shareable configurations

All

This plugin also exports an all configuration that includes every available rule.

{
  "plugins": [
    /* ... */
    "react-native"
  ],
  "extends": [/* ... */, "plugin:react-native/all"]
}

Note: These configurations will import eslint-plugin-react-native and enable JSX in parser options.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].