11import type { AtRule } from 'postcss' ;
22import type { DiagnosticPosition , DiagnosticWithDetachedLocation , Location } from '../type.js' ;
3- import { JS_IDENTIFIER_PATTERN } from '../util.js' ;
43
54interface ValueDeclaration {
65 type : 'valueDeclaration' ;
@@ -84,17 +83,6 @@ export function parseAtValue(atValue: AtRule): ParseAtValueResult {
8483 column : start . column + name . length ,
8584 offset : start . offset + name . length ,
8685 } ;
87-
88- if ( ! JS_IDENTIFIER_PATTERN . test ( name ) ) {
89- diagnostics . push ( {
90- start : { line : start . line , column : start . column } ,
91- length : name . length ,
92- text : `css-modules-kit does not support non-JavaScript identifier as value names.` ,
93- category : 'error' ,
94- } ) ;
95- continue ;
96- }
97-
9886 const result = { name, loc : { start, end } } ;
9987 if ( localName === undefined ) {
10088 values . push ( result ) ;
@@ -110,17 +98,6 @@ export function parseAtValue(atValue: AtRule): ParseAtValueResult {
11098 column : start . column + localName . length ,
11199 offset : start . offset + localName . length ,
112100 } ;
113-
114- if ( ! JS_IDENTIFIER_PATTERN . test ( localName ) ) {
115- diagnostics . push ( {
116- start : { line : start . line , column : start . column } ,
117- length : localName . length ,
118- text : `css-modules-kit does not support non-JavaScript identifier as value names.` ,
119- category : 'error' ,
120- } ) ;
121- continue ;
122- }
123-
124101 values . push ( { ...result , localName, localLoc : { start, end } } ) ;
125102 }
126103 } else {
@@ -177,17 +154,6 @@ export function parseAtValue(atValue: AtRule): ParseAtValueResult {
177154 column : start . column + name . length ,
178155 offset : start . offset + name . length ,
179156 } ;
180-
181- if ( ! JS_IDENTIFIER_PATTERN . test ( name ) ) {
182- diagnostics . push ( {
183- start : { line : start . line , column : start . column } ,
184- length : name . length ,
185- text : `css-modules-kit does not support non-JavaScript identifier as value names.` ,
186- category : 'error' ,
187- } ) ;
188- return { diagnostics } ;
189- }
190-
191157 const parsedAtValue : ValueDeclaration = {
192158 type : 'valueDeclaration' ,
193159 name,
0 commit comments