eslint-config-react-native-ialoig

1.0.1Β β€’Β PublicΒ β€’Β Published

eslint-config-react-native-ialoig github npm

Hi πŸ‘‹

this is an ESLint configuration for React Native developers

πŸš€ Getting Started

Installation

    npm install eslint-config-react-native-ialoig

πŸ“ Rules

indent

⛔️ error if not tabbed indentation

quotes

⚠️ warning if not double

semi

⛔️ disallows semicolons as the end of statements

curly-spacing

βœ… require spaces between curly braces

sort-imports

⛔️ error if not correctly sorted
βœ… ignores the case-sensitivity of the imports local name
βœ… Ignores the sorting of import declaration statements
βœ… Do not ignores the member sorting within a multiple member import declaration
βœ… default member syntax sort order is:
    * `none` - import module without exported bindings
    * `all` - import all members provided by exported bindings
    * `multiple` - import multiple members
    * `single` - import single member

πŸ”Œ Plugins

eslint-plugin-react-native

βœ… detect unused StyleSheet rules in React components
βœ… enforce using platform specific filenames when necessary
βœ… no inline styles in components. 
Styles should be separate from the view layout
βœ… detect color literals in styles. 
Color definitions should be stored in variables instead of hardcoding them inside styles
βœ… all strings should be wrapped with a Text component
βœ… no Single Element Style Arrays are allowed.
These cause unnecessary re-renders as each time the array's identity changes.

eslint-plugin-import

βœ… Ensure imports point to a file/module that can be resolved
βœ… Ensure named imports correspond to a named export in the remote file
βœ… Ensure imported namespaces contain dereferenced properties as they are dereferenced
βœ… Ensure a default export is present, given a default import
βœ… Enforce a convention in module import order
the order is as shown in the following example:

// 1. node "builtin" modules
import fs from 'fs';
import path from 'path';
// 2. "external" modules
import _ from 'lodash';
import chalk from 'chalk';
// 3. "internal" modules
// (if you have configured your path or webpack to handle your internal paths differently)
import foo from 'src/foo';
// 4. modules from a "parent" directory
import foo from '../foo';
import qux from '../../foo/qux';
// 5. "sibling" modules from the same or a sibling's directory
import bar from './bar';
import baz from './bar/baz';
// 6. "index" of the current directory
import main from './';

eslint-plugin-i18n-json

βœ… ICU Message syntax validation
βœ… linting of each JSON translation file
βœ… automatic case-sensitive ascending sort of all keys in the translation file
βœ… compare each translation file's key structure with a reference translation file to ensure consistency

VS Code configuration to auto fix

Create .vscode/settings.json

{
    "editor.formatOnSave": true,
    "eslint.run": "onSave",
    "eslint.alwaysShowStatus": true,
    "eslint.format.enable": true,
}

made with 🧠 by ialoig

Package Sidebar

Install

npm i eslint-config-react-native-ialoig

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

9.88 kB

Total Files

6

Last publish

Collaborators

  • ialoig