Skip to content

Commit 862d01d

Browse files
authored
New diagnostic type for issue quick-lint#953
1 parent 481d5ed commit 862d01d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/quick-lint-js/diag/diagnostic-types.h

+10-7
Original file line numberDiff line numberDiff line change
@@ -2960,6 +2960,16 @@
29602960
"expression literal always returns '{1}'"), \
29612961
equals_operator, comparison_result)) \
29622962
\
2963+
QLJS_DIAG_TYPE( \
2964+
diag_pointless_comp_against_string_expression_literal, "E0373", \
2965+
diagnostic_severity::warning, \
2966+
{ \
2967+
source_code_span or_operator; \
2968+
}, \
2969+
MESSAGE(QLJS_TRANSLATABLE("comparison with a non-empty string literal " \
2970+
" always returns '{1}'"), \
2971+
or_operator)) \
2972+
\
29632973
QLJS_DIAG_TYPE( \
29642974
diag_unexpected_function_parameter_is_parenthesized, "E0349", \
29652975
diagnostic_severity::error, \
@@ -2976,13 +2986,6 @@
29762986
diag_unexpected_colon_after_generic_definition, "E0331", \
29772987
diagnostic_severity::error, { source_code_span colon; }, \
29782988
MESSAGE(QLJS_TRANSLATABLE("':' should be 'extends' instead"), colon)) \
2979-
\
2980-
QLJS_DIAG_TYPE( \
2981-
diag_pointless_nullish_coalescing_operator, "E0369", \
2982-
diagnostic_severity::warning, { source_code_span question_question; }, \
2983-
MESSAGE(QLJS_TRANSLATABLE("nullish coalescing operator does nothing " \
2984-
"when left operand is never null"), \
2985-
question_question)) \
29862989
/* END */
29872990

29882991
// QLJS_X_RESERVED_DIAG_TYPES lists reserved error codes. These codes were used

0 commit comments

Comments
 (0)