bsky-app/eslint/use-exact-imports.js
dan e30575c0dc
Use exact imports for icons (#4549)
* Use exact imports for icons

* Add a lint rule
2024-06-18 15:37:08 +03:00

22 lines
524 B
JavaScript

/* eslint-disable bsky-internal/use-exact-imports */
const BANNED_IMPORTS = [
'@fortawesome/free-regular-svg-icons',
'@fortawesome/free-solid-svg-icons',
]
exports.create = function create(context) {
return {
Literal(node) {
if (typeof node.value !== 'string') {
return
}
if (BANNED_IMPORTS.includes(node.value)) {
context.report({
node,
message:
'Import the specific thing you want instead of the entire package',
})
}
},
}
}