diff options
author | Kuwa Lee <kuwalee1069@gmail.com> | 2024-06-19 02:47:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 02:47:38 +0800 |
commit | a6d49062e6d50b7c9a6c0d50c38fcfeb8f63e46f (patch) | |
tree | 65ef4f28c174d1da9c8f7085635b05b754e95746 /eslint/use-exact-imports.js | |
parent | fad73fe9281baee8409a65a10923749ec24dfd68 (diff) | |
parent | 35e54e24a0b08ce0f2e3389aeb4fb0f29778170e (diff) | |
download | voidsky-a6d49062e6d50b7c9a6c0d50c38fcfeb8f63e46f.tar.zst |
Merge branch 'bluesky-social:main' into zh
Diffstat (limited to 'eslint/use-exact-imports.js')
-rw-r--r-- | eslint/use-exact-imports.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/eslint/use-exact-imports.js b/eslint/use-exact-imports.js new file mode 100644 index 000000000..06723043f --- /dev/null +++ b/eslint/use-exact-imports.js @@ -0,0 +1,22 @@ +/* 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', + }) + } + }, + } +} |