Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JonnyBurger/eslint-plugin-10x
Some ESLint rules to increase productivity in React
https://github.com/JonnyBurger/eslint-plugin-10x
Last synced: about 2 months ago
JSON representation
Some ESLint rules to increase productivity in React
- Host: GitHub
- URL: https://github.com/JonnyBurger/eslint-plugin-10x
- Owner: JonnyBurger
- License: mit
- Created: 2020-01-11T18:06:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-12T14:53:09.000Z (over 2 years ago)
- Last Synced: 2024-07-06T13:42:40.643Z (3 months ago)
- Language: TypeScript
- Size: 352 KB
- Stars: 33
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## eslint-plugin-10x
This plugins allows you to define a whitelist of symbols, that if they are undefined, ESLint will automatically import when you have autofixing enabled in your editor.
## Installation
```console
npm i eslint-plugin-10x
```## Usage
Add it to your `.eslintrc`:
```json
{
"plugins": ["10x"],
"rules": {
"10x/auto-import": [
"error",
{
"imports": {
"useRef": "import {useRef} from 'react'",
"useEffect": "import {useEffect} from 'react'",
"useState": "import {useState} from 'react'",
"useCallback": "import {useCallback} from 'react'"
}
}
]
}
}
```## Tips
Use this plugin in conjunction with [`prettier-plugin-organize-imports`](https://www.npmjs.com/package/prettier-plugin-organize-imports) and it will automatically merge two imports from the same library into one.
## License
MIT
## Author
© 2021 Jonny Burger