We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42278fe commit e91aa36Copy full SHA for e91aa36
lib/node-utils/accessors.ts
@@ -4,6 +4,8 @@ import {
4
type TSESTree,
5
} from '@typescript-eslint/utils';
6
7
+import { isLiteral } from './is-node-of-type';
8
+
9
/**
10
* A `Literal` with a `value` of type `string`.
11
*/
@@ -22,7 +24,7 @@ const isStringLiteral = <V extends string>(
22
24
node: TSESTree.Node,
23
25
value?: V
26
): node is StringLiteral<V> =>
- node.type === AST_NODE_TYPES.Literal &&
27
+ isLiteral(node) &&
28
typeof node.value === 'string' &&
29
(value === undefined || node.value === value);
30
0 commit comments