about summary refs log tree commit diff
path: root/eslint/use-exact-imports.js
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-09-20 09:11:29 +0100
committerGitHub <noreply@github.com>2024-09-20 09:11:29 +0100
commitf42d44112d268588f0d25f81715d01190b7047ea (patch)
treecc5a7240650fd17bcca4a08c3bb3770f9cad7e69 /eslint/use-exact-imports.js
parent22410a3cee459761a9eb2d1a52de99557a424797 (diff)
downloadvoidsky-f42d44112d268588f0d25f81715d01190b7047ea.tar.zst
Add eslint rule to fix imports without the `#/` path alias (#5175)
Diffstat (limited to 'eslint/use-exact-imports.js')
-rw-r--r--eslint/use-exact-imports.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/eslint/use-exact-imports.js b/eslint/use-exact-imports.js
index 06723043f..26e688563 100644
--- a/eslint/use-exact-imports.js
+++ b/eslint/use-exact-imports.js
@@ -1,4 +1,3 @@
-/* eslint-disable bsky-internal/use-exact-imports */
 const BANNED_IMPORTS = [
   '@fortawesome/free-regular-svg-icons',
   '@fortawesome/free-solid-svg-icons',
@@ -6,11 +5,12 @@ const BANNED_IMPORTS = [
 
 exports.create = function create(context) {
   return {
-    Literal(node) {
-      if (typeof node.value !== 'string') {
+    ImportDeclaration(node) {
+      const source = node.source
+      if (typeof source.value !== 'string') {
         return
       }
-      if (BANNED_IMPORTS.includes(node.value)) {
+      if (BANNED_IMPORTS.includes(source.value)) {
         context.report({
           node,
           message: