@@ -245,6 +245,24 @@ ruleTester.run("no-important", rule, {
245245 } ,
246246 ] ,
247247 } ,
248+ {
249+ code : "a { color: red /* comment with surrogate pairs: 👍🚀 */ !important; }" ,
250+ errors : [
251+ {
252+ messageId : "unexpectedImportant" ,
253+ line : 1 ,
254+ column : 57 ,
255+ endLine : 1 ,
256+ endColumn : 67 ,
257+ suggestions : [
258+ {
259+ messageId : "removeImportant" ,
260+ output : "a { color: red /* comment with surrogate pairs: 👍🚀 */; }" ,
261+ } ,
262+ ] ,
263+ } ,
264+ ] ,
265+ } ,
248266 {
249267 code : dedent `
250268 a {
@@ -272,6 +290,25 @@ ruleTester.run("no-important", rule, {
272290 } ,
273291 ] ,
274292 } ,
293+ {
294+ // NOTE: dedent`` converts 👍🚀 to \u{1f44d}\u{1f680} in Bun, causing unexpected report locations
295+ code : "a {\ncolor: red /* comment with surrogate pairs: 👍🚀 */\n!important;\n}" ,
296+ errors : [
297+ {
298+ messageId : "unexpectedImportant" ,
299+ line : 3 ,
300+ column : 1 ,
301+ endLine : 3 ,
302+ endColumn : 11 ,
303+ suggestions : [
304+ {
305+ messageId : "removeImportant" ,
306+ output : "a {\ncolor: red /* comment with surrogate pairs: 👍🚀 */;\n}" ,
307+ } ,
308+ ] ,
309+ } ,
310+ ] ,
311+ } ,
275312 {
276313 code : "a { color: red !/* comment */important; }" ,
277314 errors : [
@@ -290,6 +327,24 @@ ruleTester.run("no-important", rule, {
290327 } ,
291328 ] ,
292329 } ,
330+ {
331+ code : "a { color: red !/* comment with surrogate pairs: 👍🚀 */important; }" ,
332+ errors : [
333+ {
334+ messageId : "unexpectedImportant" ,
335+ line : 1 ,
336+ column : 16 ,
337+ endLine : 1 ,
338+ endColumn : 66 ,
339+ suggestions : [
340+ {
341+ messageId : "removeImportant" ,
342+ output : "a { color: red; }" ,
343+ } ,
344+ ] ,
345+ } ,
346+ ] ,
347+ } ,
293348 {
294349 code : "a { color: red ! /* comment */ important; }" ,
295350 errors : [
@@ -335,6 +390,25 @@ ruleTester.run("no-important", rule, {
335390 } ,
336391 ] ,
337392 } ,
393+ {
394+ // NOTE: dedent`` converts 👍🚀 to \u{1f44d}\u{1f680} in Bun, causing unexpected report locations
395+ code : "a {\ncolor: red\n!/* comment with surrogate pairs: 👍🚀 */important;\n}" ,
396+ errors : [
397+ {
398+ messageId : "unexpectedImportant" ,
399+ line : 3 ,
400+ column : 1 ,
401+ endLine : 3 ,
402+ endColumn : 51 ,
403+ suggestions : [
404+ {
405+ messageId : "removeImportant" ,
406+ output : "a {\ncolor: red;\n}" ,
407+ } ,
408+ ] ,
409+ } ,
410+ ] ,
411+ } ,
338412 {
339413 code : dedent `
340414 a {
0 commit comments