From f42d44112d268588f0d25f81715d01190b7047ea Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 20 Sep 2024 09:11:29 +0100 Subject: Add eslint rule to fix imports without the `#/` path alias (#5175) --- eslint/use-exact-imports.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'eslint/use-exact-imports.js') 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: -- cgit 1.4.1