eslint-config-rn-ts-prettier
v1.0.1
Published
Shareable ESLint config for React Native + TypeScript + Prettier.
Maintainers
Readme
eslint-config-rn-ts-prettier
:sparkles: Shareable ESLint config for React Native projects using TypeScript and Prettier.
Strict, modern, and focused on fast, readable code.
✨ Features
- Airbnb, React, and Prettier code style out of the box
- TypeScript and React Native accessibility support
- Sorted imports, unused import removal, and lodash import hygiene
- Developer-friendly and easy to extend
📦 Installation
npm install --save-dev eslint-config-rn-ts-prettier eslint prettier typescriptor with Yarn:
yarn add --dev eslint-config-rn-ts-prettier eslint prettier typescript🚀 Usage
Add to your ESLint config (e.g., .eslintrc.js):
module.exports = {
extends: ['rn-ts-prettier'],
};🛠️ Customizing Internal Import Order
This config does not enforce a specific internal import order for your folders like components, screens, or utils.
To customize your order, override the simple-import-sort/imports rule:
module.exports = {
extends: ['rn-ts-prettier'],
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
['^\\u0000'],
['^react', '^@?\\w'],
['^(screens|components|utils|hooks)(/.*)?$'], // Customize as needed!
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
],
},
],
},
};📝 Example
A minimal .eslintrc.js for React Native + TypeScript:
module.exports = {
extends: ['rn-ts-prettier'],
rules: {
// Customize rules as needed
},
};🙌 Contributing
Contributions, issues, and PRs are welcome! Feel free to open an issue or submit a PR.
📄 License
MIT
