b50dfd1974
fix: preserve empty lines between nested SCSS maps ( #13931 )
...
Co-authored-by: Jeremy Neander <jeremy.neander@glassdoor.com >
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2022-12-15 14:54:47 +08:00
Jed Fox
bfb09bf214
Format pseudo-selector args like a function call ( #13577 )
2022-10-02 11:11:44 -04:00
José Pereira and fisker Cheung
2d3a274847
fix: extra space between '#' and '{' ( #13286 )
...
* fix: extra space between '#' and '{'
* Update src/language-css/printer-postcss.js
Co-authored-by: fisker Cheung <lionkay@gmail.com >
* adding changelog
* Update 13286.md
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2022-08-17 23:32:29 +09:00
fisker Cheung
6bc6914d0b
Enable unicorn/prefer-logical-operator-over-ternary rule ( #13060 )
2022-07-09 16:03:46 +09:00
fisker Cheung
b429cee273
Fix less/scss format error ( #12536 )
2022-03-29 20:44:28 +08:00
737dd536c7
Fix lowercasing postcss values ( #12393 )
...
Co-authored-by: HallvardMM no-reply
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2022-03-09 06:36:14 +08:00
Lucas Duailibe
543aa9abf1
Fix printing of SCSS selector() function ( #12213 )
2022-02-03 12:54:10 -03:00
Lucas Duailibe
e22c4911f8
Preserve empty lines in CSS/SCSS paren groups ( #12210 )
2022-02-02 07:38:59 -03:00
Sosuke Suzuki
a0cc4ab43b
Reduce bundle size of parser-postcss.js ( #12204 )
...
* Extract utils
* Move `utils.js` to `utils/index.js`
2022-01-31 16:46:47 +09:00
Sosuke Suzuki
8f7c2f77a4
Respect spacing for between expressions and parentheses in embedded CSS ( #11800 )
...
* Fix embedded css formatting
* Add changelog
2021-11-12 23:17:29 +09:00
db0e9d228d
Fix @forward with formatting error ( #11683 )
...
* Resolves #11636 . Added null check for iPrevNode
* undefined check
* Add changelog
* Add tests
* Update tests
* Update changelog
Co-authored-by: Sriram Arul <sriram.arul@zohocorp.com >
Co-authored-by: sosukesuzuki <aosukeke@gmail.com >
2021-10-29 18:16:50 +09:00
Sosuke Suzuki
79fa4f9383
Improve with (...) formatting ( #11637 )
...
* Null checking
* Improve configuration formatting
* Add tests
* Add changelog
* Format
2021-10-19 15:31:53 +09:00
Ivan Nikolić and Georgii Dolzhykov
59b5eb4e1f
Fix wildcard syntax in @forward ( #11482 ) ( #11487 )
...
* Fix wildcard syntax in `@forward` (#11482 )
* Add additional tests
* Apply suggestions from code review
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com >
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com >
2021-09-16 14:08:03 +09:00
fisker Cheung
894f841fbd
Style: Enforce extensions ( #11227 )
2021-07-21 09:10:34 +08:00
fisker Cheung
9b7ba8a42c
Style: Use dotAll regexp ( #10864 )
2021-05-18 02:44:21 +08:00
fisker Cheung
383f622942
Style: Remove useless flags ( #10861 )
2021-05-15 14:37:17 +03:00
fisker Cheung and Georgii Dolzhykov
7cc52da144
Simplified printGenerically ( #10557 )
...
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com >
2021-03-22 16:57:03 +02:00
fisker Cheung
230428f34b
Add consistent-negative-index-access rule ( #10569 )
2021-03-20 14:06:12 +02:00
fisker Cheung
863eb079dc
Forbid AstPath.call without name ( #10541 )
2021-03-15 17:20:27 +08:00
Sosuke Suzuki and fisker Cheung
07b30645ec
style: Add new ESLint rule no-empty-string-for-ifbreak ( #10172 )
...
* Add new ESLint rule for ifBreak
* Fix for third argument
* Run fix with new rule
* Address review
* Fix
* Update no-empty-flat-contents-for-if-break.js
* Fix CI config
Co-authored-by: fisker Cheung <lionkay@gmail.com >
2021-01-29 20:03:11 +09:00
fisker Cheung
743ef3de9b
SCSS: Fix maps with keys that are lists or maps ( #10005 )
2021-01-26 09:45:25 +08:00
fisker Cheung
7b24335064
Refactor: Use Doc[] instead of concat() ( #9993 )
2021-01-11 13:46:05 +08:00
fisker Cheung
358ad36a84
Forbid use concat() in concat() ( #9998 )
2021-01-11 10:19:13 +08:00
fisker Cheung and Sosuke Suzuki
7ec7a0f21f
Fix using concat() on single Doc ( #9994 )
...
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com >
2021-01-04 14:40:02 +08:00
fisker Cheung
181a325c1c
Enable unicorn/explicit-length-check ( #9975 )
2021-01-04 10:11:57 +08:00
fisker Cheung and Georgii Dolzhykov
9d9c0e2b6f
Add Doc[] as Doc ( #9733 )
...
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com >
2021-01-04 10:04:30 +08:00
Christopher Chedeau
eec3e82f48
Fix absolute path in custom CSS url() calls ( #9966 )
...
At Facebook we have some custom pre-processor `-fb-url(/abs/path/)` that gets messed up as `-fb-url(/ abs/path)` with the current version of prettier.
The parser has hardcoded logic to only parse as path things that use `url()` but not `-fb-url()` and it parses it as `division /` and `abs/path/`. Because we put a space after division, the bug is introduced.
I don't really know the impact of changing the parser, but on the printer side, it is straightforward to not add a space after `/` if it's the first element in a group. I can't think of any reason why you could write `(/ something` in CSS so I think it's a safe change.
2020-12-28 20:22:25 -03:00
fisker Cheung
ec5f60725b
Send array to FastPath#{each,map} callback ( #9901 )
2020-12-17 15:52:51 +08:00
fisker Cheung
c7e354e38c
Add isNonEmptyArray ( #9902 )
2020-12-17 14:46:59 +08:00
fisker Cheung
25d53fa9b3
SCSS/LESS: Fix comment inside parens ( #9710 )
2020-11-26 19:28:00 +08:00
fisker Cheung
60a5729a19
Move prettier-ignore related functions into language-js/ ( #9555 )
2020-11-10 09:12:46 +08:00
fisker Cheung
84b81c8a1a
Enable directly-loc-start-end in language-css ( #9591 )
2020-11-05 19:26:05 +08:00
Sosuke Suzuki and fisker
f7554c62a2
Revert breaking changes related to adding pure css parser for minor releasing ( #9500 )
...
* revert without tests
* Downgrade postcss-scss and postcss-less
* Fix tests
* Revert "Make `isSCSS*` function stricter (#9093 )"
This reverts commit 01f986bea9 .
* Revert "Remove `css` parser from `isLessParser` check (#9092 )"
This reverts commit c0bca1805d .
* Revert "Add pure css parser (#7933 )"
This reverts commit 589ebf670b .
* Disable `parser-postcss.js` minify
* Try to fix build script
* Update fs.mjs
* Update fs.mjs
* Style
Co-authored-by: fisker <lionkay@gmail.com >
2020-10-31 22:22:35 +09:00
fisker Cheung and Georgii Dolzhykov
fbee029497
Add index to FastPath#each() callback ( #9499 )
...
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com >
2020-10-30 12:27:20 +08:00
fisker Cheung
9efeb8309e
Update postcss-scss to v3 ( #9210 )
2020-09-27 08:49:16 +08:00
fisker Cheung
b77da32a80
Update postcss to v8 ( #9209 )
...
* Update `postcss` v8
* Parser custom properties
* Improve logic
* Update lint script
* Fix node location
* Fix comments inside
* Add a test
* Test on `less` and `scss` too
* Fix empty prop print
* Clean
* Update `postcss`
* Exclude `regenerator`
* Test `no-semi`
* Add changelog
* Typo
* Apply review suggestion
* Style
* Simplify logic
* Remove error test, we don't throw on this anymore
* Style
* Update postcss
* Update postcss
2020-09-25 00:51:55 +08:00
fisker Cheung
01f986bea9
Make isSCSS* function stricter ( #9093 )
2020-09-01 16:58:35 +08:00
fisker Cheung
c0bca1805d
Remove css parser from isLessParser check ( #9092 )
2020-09-01 15:28:11 +08:00
fisker Cheung
0aba03062d
Remove a unnecessary check in css printer ( #9094 )
2020-09-01 11:24:58 +08:00
Sosuke Suzuki
cc63358c90
Respect spacing between template values in embedded css ( #9078 )
...
* Respect no space for embedded css
* Fix by lint
* Add changelog
2020-08-28 11:08:29 +09:00
fisker Cheung
d31ebf4619
Test: Improve coverage ( #8811 )
2020-08-21 09:43:24 +08:00
fisker Cheung and sosukesuzuki
c8f9d254b9
Minor refactor ( #8752 )
...
Co-authored-by: sosukesuzuki <aosukeke@gmail.com >
2020-07-17 09:08:03 +08:00
fisker Cheung and Georgii Dolzhykov
c0abefb662
SCSS: Fix Comments at the end of the file were lost if the final semicolon was omitted ( #8675 )
...
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com >
2020-07-14 23:36:40 +08:00
fisker Cheung
0998366d41
Less: Fix incorrect comment in selector() ( #8707 )
2020-07-06 17:48:30 +08:00
fisker Cheung
350f641fca
Fix util import ( #8696 )
2020-07-05 00:34:35 +08:00
fisker Cheung
0c2b918078
ESLint: enable import/order ( #8635 )
2020-06-26 20:30:21 +08:00
Boyen Vaesen and Boyen Vaesen
aefc9a48e5
Fix: [Sass] Unexpectedly add extra space after function when passing arbitrary arguments ( #8567 )
...
Co-authored-by: Boyen Vaesen <boyen.vaesen@kbc.be >
2020-06-17 09:26:28 +08:00
boyenn and Boyen Vaesen
ff865794a6
Fix: Incorrect whitespace added after escaped colon in css line name ( #8535 )
...
* {fix}: Incorrect whitespace added after escaped colon in css grid line name
* {chore}: update changelog
* {fix}: add check for prevNode to be defined
Co-authored-by: Boyen Vaesen <boyen.vaesen@kbc.be >
2020-06-10 14:05:21 +03:00
fisker Cheung
3e44061f84
SCSS: Fix broken comments between declaration prop and value ( #8366 )
2020-06-09 18:41:16 +03:00
boyenn and Boyen Vaesen
f051170f98
fix: Update scss comment indentation ( #7844 )
...
Co-authored-by: Boyen Vaesen <boyen.vaesen@kbc.be >
2020-06-09 14:55:24 +08:00