@rnw-community/eslint-plugin
v1.8.2
Published
RNW-Community ESLint plugin
Maintainers
Readme
RNW ESLint plugin
Elevate your React/ReactNative projects with our ESLint plugin, meticulously crafted to ensure adherence to the best practices in the industry.
Notable Rule: no-complex-jsx-logic
Our plugin features the no-complex-jsx-logic rule, specifically designed to streamline JSX in your React components. It ensures simplicity in JSX by restricting complex expressions, thus enhancing readability and maintainability. For a comprehensive guide on this rule, see our detailed documentation.
Installation
Incorporating our plugin into your project is straightforward. Follow these simple steps:
Install via NPM: Run the following command in your project directory:
npm install @rnw-community/eslint-plugin --save-devConfiguration(legacy: .eslintrc*):
Custom rule configuration:
{
"plugins": [
"@rnw-community"
],
"rules": {
"@rnw-community/no-complex-jsx-logic": "error"
}
}Extending "recommended":
{
"extends": [
"plugin:@rnw-community/recommended"
]
}Configuration(new: eslint.config.js):
Custom rule configuration
import rnwcPlugin from '@rnw-community/eslint-plugin';
module.exports = [
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
rnwcPlugin,
},
rules: {
"@rnw-community/no-complex-jsx-logic": "error"
},
}
];Extending "recommended"
import rnwcPlugin from '@rnw-community/eslint-plugin';
module.exports = [
{
files: ['**/*.{js,jsx,ts,tsx}'],
extends: [rnwcPlugin.configs['flat/recommended']],
}
];License
This library is licensed under The MIT License.
