From a59dca90b40fa2eea4fe88a7bf405c45fc1770b4 Mon Sep 17 00:00:00 2001 From: Dmytro Kirpa Date: Tue, 31 Dec 2024 13:10:03 +0100 Subject: [PATCH] use enum instead of hardcoded literals --- .../src/rules/prefer-fluentui-v9.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-components/eslint-plugin-react-components/src/rules/prefer-fluentui-v9.ts b/packages/react-components/eslint-plugin-react-components/src/rules/prefer-fluentui-v9.ts index f486ae42a41f29..b248947d40de9c 100644 --- a/packages/react-components/eslint-plugin-react-components/src/rules/prefer-fluentui-v9.ts +++ b/packages/react-components/eslint-plugin-react-components/src/rules/prefer-fluentui-v9.ts @@ -1,3 +1,5 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import { createRule } from './utils/create-rule'; export const RULE_NAME = 'prefer-fluentui-v9'; @@ -31,7 +33,10 @@ export const rule = createRule({ } for (const specifier of node.specifiers) { - if (specifier.type === 'ImportSpecifier' && specifier.imported.type === 'Identifier') { + if ( + specifier.type === AST_NODE_TYPES.ImportSpecifier && + specifier.imported.type === AST_NODE_TYPES.Identifier + ) { const name = specifier.imported.name; switch (name) {