Open vilchik-elena opened 4 years ago
Thanks for the issue. Pull Requests are welcomed!
I just got the same bug. My description was here https://github.com/postcss/postcss/issues/1530 . I thought it was because of multiple @{substitutions}, but now tried to insert space between selector and «{», and it worked. So, thank you for workaround, but it would be nice to fix it, so than lessc and postcss work the same.
me too
myindex.less
file
@import '~antd/es/style/themes/default.less';
.headerWrapper {
margin: 0;
:global {
.@{ant-prefix}-tabs-nav {
margin: 0;
}
.@{ant-prefix}-tabs-tab {
height: 48px;
}
}
}
Error message
["ERROR" - 下午1:32:51] Error formatting document.
CssSyntaxError: <css input>:6:8: Unknown word
at Input.error (f:\Rep\yifei\micro\node_modules\postcss\lib\input.js:128:16)
at Parser.unknownWord (f:\Rep\yifei\micro\node_modules\postcss\lib\parser.js:561:22)
at Parser.other (f:\Rep\yifei\micro\node_modules\postcss\lib\parser.js:166:12)
at Parser.parse (f:\Rep\yifei\micro\node_modules\postcss\lib\parser.js:75:16)
at parse (f:\Rep\yifei\micro\node_modules\postcss\lib\parse.js:17:12)
at new LazyResult (f:\Rep\yifei\micro\node_modules\postcss\lib\lazy-result.js:64:16)
at Processor.<anonymous> (f:\Rep\yifei\micro\node_modules\postcss\lib\processor.js:142:12)
at Processor.process (f:\Rep\yifei\micro\node_modules\postcss\lib\processor.js:121:23)
at module.exports (f:\Rep\yifei\micro\node_modules\prettier-plugin-style-order\src\config\sorter.js:8:6)
at Object.preprocess (f:\Rep\yifei\micro\node_modules\prettier-plugin-style-order\src\index.js:40:18)
at Object.parse (f:\Rep\yifei\micro\node_modules\prettier\index.js:13620:21)
at coreFormat (f:\Rep\yifei\micro\node_modules\prettier\index.js:14899:14)
at format (f:\Rep\yifei\micro\node_modules\prettier\index.js:15131:14)
at f:\Rep\yifei\micro\node_modules\prettier\index.js:57542:12
at Object.format (f:\Rep\yifei\micro\node_modules\prettier\index.js:57562:12)
at t.default.<anonymous> (c:\Users\CRRCDT_WYF\.vscode\extensions\esbenp.prettier-vscode-5.9.2\dist\extension.js:1:17599)
at Generator.next (<anonymous>)
at s (c:\Users\CRRCDT_WYF\.vscode\extensions\esbenp.prettier-vscode-5.9.2\dist\extension.js:1:11597)
["INFO" - 下午1:32:51] Formatting completed in 23.6298ms.
@beiifeng please don't post "me too" replies on issues. No one likes those. Use the reaction buttons instead.
@beiifeng please don't post "me too" replies on issues. No one likes those. Use the reaction buttons instead.
ok.
LESS
JavaScript
Errors
Expected Behavior
When space is added after
.height-@{num}
less code is parsed normally, still it is valid even without that space and should be parsed.Actual Behavior
Parsing error is emitted.
How can we reproduce the behavior?
Execute the js script I've provided.
I checked your sources quickly, may be problem is in https://github.com/shellscape/postcss-less/blob/master/lib/nodes/interpolation.js#L7, it consumes second
{
as there is no space to stop consumption.