You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root.warn(result,`Unknown feature: "${featureName}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);
18
-
return;
19
-
}
24
+
constuniqueSuggestions=newSet();
20
25
21
-
if(byId.distance<byPackage.distance){
22
-
root.warn(result,`Unknown feature: "${featureName}", did you mean: "${byId.mostSimilar}"`);
23
-
}else{
24
-
root.warn(result,`Unknown feature: "${featureName}", did you mean: "${packageNamesToIds[byPackage.mostSimilar]}"`);
25
-
}
26
-
});
27
-
}
26
+
for(leti=0;i<suggestions.length;i++){
27
+
uniqueSuggestions.add(suggestions[i][0]);
28
28
29
-
functionmostSimilar(a,b){
30
-
letmostSimilar='unknown';
31
-
letleastDistance=Infinity;
29
+
if(uniqueSuggestions.size>=3){
30
+
break;
31
+
}
32
+
}
32
33
33
-
for(letj=0;j<b.length;j++){
34
-
constdistance=levenshteinDistance(a,b[j]);
35
-
if(distance<leastDistance){
36
-
leastDistance=distance;
37
-
mostSimilar=b[j];
34
+
if(!uniqueSuggestions.size){
35
+
root.warn(result,`Unknown feature: "${featureName}", see the list of features https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md`);
0 commit comments