eslint-plugin-check-import-naming
What's this?
This is an package with eslint plugin that allows keep logical block in component in defined order. Triggers when useEffect expression exist.
How to use
Add this code into your eslint config in rules section:
{
"plugins": [
"check-import-naming"
],
"rules": {
"check-import-naming/import-naming": [
"error",
{
"startsWith": "Icon",
"endsWith": ".svg",
}
]
}
}
Example
"startWith" === "Icon" and "endsWith" === ".svg"
With Valid code:
import IconLogin from 'assets/login.svg'
Invalid code:
import Login from 'assets/login.svg'
Why invalid?
Cause 'Login' missed 'Icon', so 'IconLogin' is valid