eslint-config-react-native-ialoig
v1.0.1
Published
๐จ ESLint configuration for React Native - made with ๐ง by ialoig
Downloads
2
Maintainers
Readme
eslint-config-react-native-ialoig
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