Commit Graph
174 Commits
Author SHA1 Message Date
Sosuke Suzuki e92dcbd1a5 Add new ESLint prefer-ast-path-node (#13470)
* Add new lint rule `prefer-path-get-value`

* Add new rule

* Apply fix

* Ingore projects in benchmark

* Add comment
2022-09-11 18:39:06 +09:00
Sosuke Suzuki 40af3ed1ca Keep trailing-comma for var function (#13402)
* Keep trailing-comma for last el

* Make hasComma function

* Fix tests

* Add changelog
2022-08-31 00:59:34 +09:00
fisker Cheung f47a852afa Move print pre-check into core (#13400) 2022-08-30 22:42:58 +08:00
fisker Cheung 17cb07665f Improve css/yaml embed traverse (#13294) 2022-08-30 11:00:12 +08:00
fisker Cheung 8d86bc1a78 Add print pre-check to CSS printer (#13398) 2022-08-30 10:30:47 +08:00
fisker Cheung 6712071e24 Stop passing undefine and null to printer (#13397) 2022-08-29 16:10:50 +03:00
fisker Cheung 0b072060b5 Merge branch 'main' into next
# Conflicts:
#	src/language-js/print/flow.js
#	src/language-js/print/literal.js
2022-08-26 10:29:09 +08:00
José Pereiraandfisker 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 5fa0802315 Add getVisitorKeys (#13255) 2022-08-17 09:47:08 +08:00
fisker Cheung cdb1494170 Revert "Switch print/embed to async (#13104)" (#13210) 2022-08-02 18:11:34 +08:00
fisker Cheung 8dae4abf41 Switch print/embed to async (#13104) 2022-07-17 16:10:06 +08:00
fisker Cheung e3cb487706 Merge branch 'main' into next
# Conflicts:
#	.eslintrc.cjs
#	package.json
#	src/language-yaml/index.js
#	yarn.lock
2022-07-11 17:03:30 +08:00
fisker Cheung 6bc6914d0b Enable unicorn/prefer-logical-operator-over-ternary rule (#13060) 2022-07-09 16:03:46 +09:00
fisker Cheung 2bcee631a2 Refactor: Import document/*.js directly (#12739) 2022-04-29 14:04:17 +08:00
fisker Cheung 65ce63b4dc Merge branch 'main' into next
# Conflicts:
#	package.json
#	scripts/vendors/bundle-vendors.mjs
#	scripts/vendors/vendor-meta.json
#	scripts/vendors/vendors.mjs
#	src/language-handlebars/utils.js
#	src/language-html/utils/html-elements-attributes.js
#	vendors/tempy.js
2022-04-01 10:37:35 +08:00
fisker Cheung b429cee273 Fix less/scss format error (#12536) 2022-03-29 20:44:28 +08:00
fisker Cheung 8118299c67 Merge branch 'main' into next
# Conflicts:
#	.github/workflows/validate-vendor-versions.yml
#	package.json
#	src/language-css/printer-postcss.js
#	src/language-js/print/assignment.js
2022-03-10 11:30:31 +08:00
Niklas VatnHallvardMM no-replyfisker Cheung
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
fisker Cheung 1caec5de69 Migrate CSS language to ES Module (#12341) 2022-02-21 14:22:51 +08:00
fisker Cheung 1b6388e9b1 Fix 2022-02-09 10:08:32 +08:00
fisker Cheung f0b63f3dff Merge branch 'main' into next
# Conflicts:
#	CONTRIBUTING.md
#	cspell.json
#	docs/options.md
#	package.json
#	scripts/build/bundler.mjs
#	src/language-css/loc.js
#	src/language-css/parser-postcss.js
#	src/language-css/utils/index.js
#	tests/format/js/arrows-bind/jsfmt.spec.js
#	tests/format/js/async-do-expressions/jsfmt.spec.js
#	tests/format/js/bind-expressions/jsfmt.spec.js
#	tests/format/js/classes/top-level-super/jsfmt.spec.js
#	tests/format/js/comments-pipeline-own-line/jsfmt.spec.js
#	tests/format/js/decorator-comments/jsfmt.spec.js
#	tests/format/js/decorators-export/jsfmt.spec.js
#	tests/format/js/decorators/jsfmt.spec.js
#	tests/format/js/do/jsfmt.spec.js
#	tests/format/js/export-default/escaped/jsfmt.spec.js
#	tests/format/js/export-extension/jsfmt.spec.js
#	tests/format/js/export-star/jsfmt.spec.js
#	tests/format/js/exports/jsfmt.spec.js
#	tests/format/js/invalid-code/jsfmt.spec.js
#	tests/format/js/logical-assignment/jsfmt.spec.js
#	tests/format/js/multiparser-invalid/jsfmt.spec.js
#	tests/format/js/no-semi-babylon-extensions/jsfmt.spec.js
#	tests/format/js/object-property-comment/jsfmt.spec.js
#	tests/format/js/partial-application/jsfmt.spec.js
#	tests/format/js/pipeline-operator/jsfmt.spec.js
#	tests/format/js/private-in/jsfmt.spec.js
#	tests/format/js/record/jsfmt.spec.js
#	tests/format/js/reserved-word/jsfmt.spec.js
#	tests/format/js/strings/jsfmt.spec.js
#	tests/format/js/throw_expressions/jsfmt.spec.js
#	tests/format/js/trailing-whitespace/jsfmt.spec.js
#	tests/format/js/v8_intrinsic/jsfmt.spec.js
#	tests/format/misc/errors/js/literal/jsfmt.spec.js
#	tests/format/misc/errors/js/object/jsfmt.spec.js
#	tests/format/misc/errors/js/variable-declarator/jsfmt.spec.js
#	tests/integration/__tests__/bundle.js
#	tsconfig.json
#	yarn.lock
2022-02-09 09:22:32 +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
fisker Cheung 3001154f8d Merge branch 'main' into next
# Conflicts:
#	package.json
#	scripts/build/bundler.mjs
#	scripts/build/config.mjs
#	yarn.lock
2021-11-18 10:40:53 +08: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
sosukesuzuki 7446e06d47 Merge branch 'main' into next 2021-10-10 14:58:57 +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 a998e3c34d Merge branch 'main' into next
# Conflicts:
#	package.json
#	scripts/build/bundler.mjs
#	src/language-css/loc.js
#	yarn.lock
2021-08-13 11:45:05 +08:00
fisker Cheung 894f841fbd Style: Enforce extensions (#11227) 2021-07-21 09:10:34 +08:00
fisker 77f8f0ddb5 Merge branch 'main' into next
# Conflicts:
#	package.json
#	scripts/build/bundler.mjs
#	yarn.lock
2021-06-14 00:31:55 +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 85fc1fa017 Merge branch 'main' into next
# Conflicts:
#	package.json
#	src/language-css/printer-postcss.js
#	yarn.lock
2021-03-29 19:47:56 +08: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
fisker Cheung d3c58df606 Merge branch 'main' into next
# Conflicts:
#	package.json
#	src/language-css/utils.js
#	yarn.lock
2021-03-08 17:38:10 +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 fdfb6ff312 Merge branch 'master' into next
# Conflicts:
#	docs/options.md
#	package.json
#	scripts/build/bundler.js
#	src/language-css/printer-postcss.js
#	yarn.lock
2021-01-11 14:26:20 +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