Skip to content

JonnyBurger/eslint-plugin-10x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

npm i eslint-plugin-10x

Usage

Add it to your .eslintrc:

{
	"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 and it will automatically merge two imports from the same library into one.

License

MIT

Author

© 2021 Jonny Burger

About

Some ESLint rules to increase productivity in React

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published