@appshack/react-native-eslint
v0.0.3
Published
A comprehensive ESLint configuration for React Native projects with TypeScript support
Downloads
871
Readme
@app-shack/react-native-eslint
A comprehensive ESLint configuration for React Native projects with TypeScript support. This package provides a well-tested, opinionated set of ESLint rules specifically tailored for React Native development.
Features
- 🚀 React Native optimized rules
- 📱 TypeScript support with strict type checking
- ⚡ ESLint 9 flat config format
- 🎯 Jest testing rules included
- 🎨 Stylistic rules for consistent code formatting
- 🔧 Promise-based async/await best practices
- 🛡️ Security-focused React rules
Installation
npm install --save-dev @app-shack/react-native-eslintOr with yarn:
yarn add --dev @app-shack/react-native-eslintUsage
Create an eslint.config.mjs file in your project root:
import reactNativeConfig from '@app-shack/react-native-eslint'
export default reactNativeConfigOr extend it with additional configuration:
import reactNativeConfig from '@app-shack/react-native-eslint'
export default [
...reactNativeConfig,
{
// Your custom rules here
rules: {
// Override or add rules
'no-console': 'warn'
}
}
]What's Included
This configuration includes rules for:
- JavaScript/TypeScript: Core language rules and TypeScript-specific linting
- React: React best practices and hooks rules
- React Native: Platform-specific rules for React Native development
- Jest: Testing rules and best practices
- Promises: Async/await and Promise handling
- Stylistic: Code formatting and style consistency
Scripts
Add these scripts to your package.json:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Requirements
- Node.js >= 18.0.0
- ESLint >= 9.0.0
- TypeScript project
License
MIT © App Shack
Contributing
Issues and pull requests are welcome! Please check the issues page before contributing.
Publishing Notes
To publish this package, you need to set up an NPM auth token:
echo 'export NPM_AUTH_TOKEN=<YOUR_TOKEN>' >> ~/.zshrc
source ~/.zshrc
# or for bash
echo 'export NPM_AUTH_TOKEN=<YOUR_TOKEN>' >> ~/.bashrc
source ~/.bashrc