eslint-config-qlean-react-native
Installation
Install config with peerDependencies with following command:
npm install -D eslint-config-qlean-react-native \
eslint-config-airbnb@17.1.0 \
eslint@5.4.0 \
babel-eslint@9.0.0 \
eslint-plugin-import@2.14.0 \
eslint-plugin-jsx-a11y@6.1.1 \
eslint-plugin-react@7.11.1 \
eslint-plugin-react-native@3.2.1 \
eslint-plugin-no-loops@0.3.0
Usage
Add "extends": "qlean-react-native"
to your .eslintrc
Motivation
global-require
"global-require": 0
Rule is redundant without Node.js
react/jsx-filename-extension
"react/jsx-filename-extension": [2, { "extensions": [".js"] }]
Use JSX only inside files with .js
extension
react/jsx-curly-spacing
"react/jsx-curly-spacing": [2, "never", { "allowMultiline": false }]
Use stricter option for disallow spaces in paired tags
react/jsx-tag-spacing
"react/jsx-tag-spacing": [2, {
"closingSlash": "never",
"beforeSelfClosing": "never",
"afterOpening": "never"
}]
Forbid spaces near closing bracket
react/destructuring-assignment
"react/destructuring-assignment": [always, { "ignoreClassFields": true }]
Allow to omit destructing props inside classes
react-native/split-platform-components
"react-native/split-platform-components": 2
Use platform specific filenames when you use platform specific components
react-native/no-inline-styles
"react-native/no-inline-styles": 2
Inline styles negative affect performance
react-native/no-color-literals
"react-native/no-color-literals": 2
Reuse color variables throughout codebase
no-loops/no-loops
"no-loops/no-loops": 2
Disallow loops (for, for-in, while, do-while, for-of).