Commit Graph
140 Commits
Author SHA1 Message Date
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ćandGeorgii 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 CheungandGeorgii 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 Suzukiandfisker 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 CheungandSosuke 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 CheungandGeorgii 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 Suzukiandfisker 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 CheungandGeorgii 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 Cheungandsosukesuzuki c8f9d254b9 Minor refactor (#8752)
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2020-07-17 09:08:03 +08:00
fisker CheungandGeorgii 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 VaesenandBoyen 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
boyennandBoyen 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
boyennandBoyen 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
fisker Cheung 44bae94647 Support dynamic languages in front matter (#8381) 2020-05-26 16:18:39 +08:00
Georgii Dolzhykov b1791e0def refactor(css): calculate correct location data for value-* nodes (#8266)
* calculate correct loc for value-* nodes

* update clean.js to fix idempotence tests
2020-05-16 02:48:25 +03:00
Georgii Dolzhykov ce2114533a Fix extra space after minus in CSS-in-JS (#8255)
* Fix extra space after minus in CSS-in-JS

* add changelog entry
2020-05-08 16:53:36 +03:00
Evilebot Tnawiandfisker 3f4da31c62 fix: comment at end of at-rule with selector (#7009)
* fix: comment at end of at-rule with selector

* Improve a little bit

* Fix test

* sass directives

Co-authored-by: fisker <lionkay@gmail.com>
2020-05-08 21:39:41 +08:00
fisker Cheung 14f5f8589f Less: parser :extend as selector (#8178) 2020-04-30 11:58:21 +03:00
Brian Schlenker 2a7515b77e Remove trailing semicolon on single line html style attribute (#8013) 2020-04-25 09:48:26 +08:00
fisker Cheung f0207e6850 Enable unicorn/better-regex (#7991)
* Enable `unicorn/better-regex`

* Spellcheck ignore regex
2020-04-10 21:20:40 +08:00
Georgii Dolzhykov 2d1142fc30 Use scss parser for css-in-js (#7883) 2020-03-31 17:10:38 +03:00
Georgii Dolzhykov 9dad95b35f Bump Prettier dependency to 2.0.0 2020-03-21 22:09:54 +02:00
Evilebot TnawiandGeorgii Dolzhykov 4602bb6b95 refactor css comments (#7021)
* refactor css comments

* workarounds for postcss-less location bugs

* improve replaceQuotesInInlineComments

* update changelog

* fix comments in selectors

* fix comments in values

* use \ufffe instead of \0 because that's what these characters are for

see http://www.unicode.org/faq/private_use.html#nonchar6

* fix quoted urls

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-03-20 18:09:07 +02:00
fisker Cheung acff41e7c9 Update postcss-less to v3 (#6981) 2020-03-10 01:14:34 +02:00