Fix semicolon duplicated at the end of LESS file (#14007)
Fix semicolon duplicated at the end of file
This commit is contained in:
1 parent
369bf2a1c1
commit
efa6aa68b6
4 files changed
+44
-1
No files matched your search
@@ -0,0 +1,19 @@
|
||||
#### Fix semicolon duplicated at the end of LESS file (#14007 by @mvorisek)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```less
|
||||
// Input
|
||||
@variable: {
|
||||
field: something;
|
||||
};
|
||||
|
||||
// Prettier stable
|
||||
@variable: {
|
||||
field: something;
|
||||
}; ;
|
||||
|
||||
// Prettier main
|
||||
@variable: {
|
||||
field: something;
|
||||
};
|
||||
```
|
||||
@@ -101,7 +101,10 @@ function genericPrint(path, options, print) {
|
||||
return [node.raw, hardline];
|
||||
case "css-root": {
|
||||
const nodes = printNodeSequence(path, options, print);
|
||||
const after = node.raws.after.trim();
|
||||
let after = node.raws.after.trim();
|
||||
if (after.startsWith(";")) {
|
||||
after = after.slice(1).trim();
|
||||
}
|
||||
|
||||
return [
|
||||
nodes,
|
||||
|
||||
@@ -83,6 +83,24 @@ a: b;
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`issue-11483--never-append-anything.less format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["less"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
@variable: {
|
||||
field: something;
|
||||
};
|
||||
|
||||
=====================================output=====================================
|
||||
@variable: {
|
||||
field: something;
|
||||
};
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`less.less format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["less"]
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@variable: {
|
||||
field: something;
|
||||
};
|
||||
Reference in new issue
Block a user