1.0.0 • Published 2 years ago
eslint-plugin-check-import-naming v1.0.0
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
With "startWith" === "Icon" and "endsWith" === ".svg"
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
1.0.0
2 years ago