Commit Graph
151 Commits
Author SHA1 Message Date
Yuji Sugiura f95cfbca7d Playground: Enable v3.5.0 features (#17093) 2025-02-10 02:14:03 +00:00
SUZUKI Sosuke 0cba62ee4d Comment out objectWrap for playground (#17026) 2025-01-18 22:45:07 +09:00
Paul DraperandSosuke Suzuki bef1d61a7a Implement objectWrap config option (#16163)
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2025-01-15 16:44:45 +09:00
fisker Cheung 07b468917e Remove blank lines between imports (#16450) 2024-09-29 17:56:37 +08:00
fisker Cheung e0117a165b Add Knip (#16653) 2024-09-18 16:40:10 +08:00
fisker Cheung c03a12ad2b Enable require-unicode-regexp and regexp/strict rule (#16408) 2024-06-18 07:52:54 +09:00
fisker Cheung b26f56bd31 Update eslint-plugin-unicorn to v53 (#16275) 2024-06-04 09:39:19 +08:00
SUZUKI SosukeandAlexander Kachkaev c9fc23e0e7 Update issue template (#15886)
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2024-01-13 00:09:16 +09:00
fisker Cheung 1dc924f2f2 Add jsonc parser (#15831) 2024-01-02 10:59:34 +08:00
Alexander Kachkaev 1ea2fd059a Add eslint-plugin-simple-import-sort (#15817) 2023-12-18 03:34:12 +08:00
Georgii Dolzhykov 39e4e7bf40 Add cursorOffset to Playground (#15751) 2023-12-08 16:34:26 +02:00
SUZUKI Sosuke 093745f0ec Enable --experimental-ternaries in playground (#15677) 2023-11-18 15:41:34 +08:00
Sosuke Suzuki eebf0e4b5e Bump Prettier dependency to 3.1.0 2023-11-13 12:00:57 +09:00
Sosuke Suzuki fa48415617 Bump Prettier dependency to 3.0.0 2023-07-05 21:50:05 +09:00
fisker Cheung 817460b93a Merge branch 'main' into next
# Conflicts:
#	netlify.toml
2022-12-01 15:22:35 +08:00
Pete Meehanandfisker Cheung a60bee2e2d Add '--single-attribute-per-line' option to Playground (#13587)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-11-24 09:59:39 +08:00
fisker Cheung 9689357e58 Enable unicorn/no-typeof-undefined rule (#13878) 2022-11-22 14:50:24 +08:00
renovate[bot]andfisker 6959f30a81 Update dependency eslint-plugin-unicorn to v45 (#13876)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2022-11-21 23:41:27 +08:00
fisker Cheung decc3bae65 Enable regexp/prefer-lookaround rule (#13859) 2022-11-20 15:35:03 +08:00
fisker Cheung 9eafbf6854 Enable unicorn/prefer-string-replace-all rule (#13788) 2022-11-06 19:55:24 +08:00
fisker Cheung 2d23d33a40 Remove since from options and languages (#13699) 2022-10-23 11:18:36 +08:00
Georgii Dolzhykov effe30a3b8 Playground: show preprocessed AST (#13606) 2022-10-10 14:26:55 +03:00
Georgii Dolzhykov b893eeefb2 Update angular-html-parser (#13578) 2022-10-03 16:38:22 +03:00
Georgii Dolzhykov a82a7e0233 Playground: press ctrl-q to generate a dummy id (#13405) 2022-09-01 23:20:56 +03:00
Georgii Dolzhykov 05c873f09d Playground: fix 'show doc', add folding for doc-explorer (#13336) 2022-08-22 09:25:18 +03:00
fisker Cheung 5fa0802315 Add getVisitorKeys (#13255) 2022-08-17 09:47:08 +08:00
fisker 5daa8eba6c Merge remote-tracking branch 'remotes/upstream/main' into next
# Conflicts:
#	.gitignore
#	website/playground/PrettierFormat.js
#	website/static/worker.js
2022-08-06 11:42:33 +08:00
Georgii Dolzhykov bbbeeb07f6 Playground: "Rethrow embed errors" checkbox (#13227) 2022-08-05 17:05:50 +03:00
fisker Cheung 298347c9fb Merge branch 'main' into next
# Conflicts:
#	netlify.toml
#	src/cli/find-cache-file.js
#	src/cli/utils.js
#	src/main/parser.js
#	website/playground/PrettierFormat.js
#	website/static/worker.js
2022-08-01 11:27:34 +08:00
Georgii Dolzhykov b65cb6c1f6 Playground: doc explorer (#10183) 2022-07-23 22:46:16 +03:00
fisker 0e0f879c1a Merge branch 'main' into next
# Conflicts:
#	docs/browser.md
#	package.json
#	scripts/release/yarn.lock
#	scripts/vendors/vendor-meta.json
#	scripts/vendors/vendors.mjs
#	src/cli/expand-patterns.js
#	src/cli/format.js
#	src/cli/utils.js
#	src/language-js/index.js
#	src/language-js/parse/postprocess/index.js
#	src/language-js/parse/postprocess/typescript.js
#	tests/format/misc/errors/invalid/jsfmt.spec.js
#	tests/integration/__tests__/__snapshots__/support-info.js.snap
#	website/playground/sidebar/SidebarOptions.js
#	yarn.lock
2022-06-19 11:12:22 +08:00
Sosuke SuzukiandSimon Lydell fdccc0f48e Add --cache CLI option (#12800)
* Install `file-entry-cache` and types

* Implement `FormatResultsCache`

* Add `--cache` and `--cache-location` option

* Implement `--cache` and `--cache-location`

* Add tests for `--cache`

* Add tests for `--cache-location`

* Avoid spellcheck error

* Update snapshots for new options

* Add `groupBy` for website

* Use `fs.promises` instead of `fs/promises`

* Use `rimraf` instead of `fs.rm`

* Fix properties order of `options`

* Install `find-cache-dir` and types

* Change default cache file location to `node_modules/.cache/prettier`

* Fix tests following to change default cache file location

* Update snapshots for changing default cache file location

* Set `os.tmpdir()` as a fallback for default cache dir

* Add docs for `--cache` and `--cache-location`

* Use `sdbm` instead of `node:crypto`

* Add changelog

* Fix `getHashOfOptions`

* Remove `cache-location`

* `prettiercache` -> `prettier-cache`

* Remove cache file when run Prettier without `--cache` option

* Implement `--cache-strategy`

* Add tests for invalid cache strategy

* Fix lint problems

* Tweaks tests

* Add tests for timestamp

* Add tests for `--cache-strategy`

* Add docs for cache-strategy

* Address review

* Fix `findCacheFile`

* Use Set.prototype.has

* Throw error with --stdin-filepath

* Update snapshots

* Fix error for cache and stdin

* Use string constructor instead of toString

* Update changelog

* Use flag validation

* Fix `cache-strategy` definition

* Update docs

* Mark highlihgt

* Throw error for `--cache-strategy` without `--cache`

* Update docs

* Fix typo

* Updates snapshots

* Update docs/cli.md

Co-authored-by: Simon Lydell <simon.lydell@gmail.com>

* Fix error message

* Remove `:::` syntax

* Defaults `content`

* Update docs

* Fix by Prettier

Co-authored-by: Simon Lydell <simon.lydell@gmail.com>
2022-06-11 23:32:32 +09:00
fisker Cheung 23f5ca2476 Fix website (#12745) 2022-04-29 15:09:54 +08:00
fisker Cheung c6d6b25833 prettier.{format,formatWithCursor,check}() are now async (#12574) 2022-04-29 14:22:24 +08:00
fisker Cheung a85f38f096 Merge branch 'main' into next
# Conflicts:
#	.github/workflows/dev-test.yml
#	jest.config.mjs
#	package.json
#	scripts/vendors/vendor-meta.json
#	scripts/vendors/vendors.mjs
#	src/cli/format.js
#	src/cli/options/create-minimist-options.js
#	src/cli/options/parse-cli-arguments.js
#	src/cli/usage.js
#	src/cli/utils.js
#	src/common/create-ignorer.js
#	src/common/load-plugins.js
#	src/config/resolve-config.js
#	src/index.js
#	src/language-css/utils/css-units.evaluate.js
#	src/language-html/ast.js
#	src/language-html/print-preprocess.js
#	src/language-html/utils/index.js
#	src/main/multiparser.js
#	tests/format/markdown/auto-link/jsfmt.spec.js
#	tests/integration/__tests__/__snapshots__/config-resolution.js.snap
#	tests/integration/__tests__/__snapshots__/with-config-precedence.js.snap
#	tests/integration/__tests__/file-info.js
#	yarn.lock
2022-04-25 14:28:27 +08:00
Ansgar Prause 3390aa12b8 Fix groupBy usage in playground sidebar (#12642)
The groupBy function added in fa3b95c2e1
does not support the property name shorthand from lodash.
2022-04-10 19:20:33 +08:00
Sosuke Suzukiandfisker Cheung fa3b95c2e1 Remove lodash (#12628)
* Replace `groupBy`

* Replace `partition`

* Replace `pick`

* Move `partition`

* Replace `uniqBy`

* Replace `fromPairs`

* Remove usage from website

* Reuse `partition`

* Remove from package.json

* Fix

* Use `ignore.default`

* Add `resolveConfig` to `FileInfoOptions`

* Explicit tuple types

* Make `cache` optional

* Fix cosmiconfig type

* Use `@ts-expect-error` for private property access

* Add type annotation for validate

* Fix type errors for `OptionInfo`

* Add `@ts-expect-error`

* Fix type of `normalizeOptions`

* Fix `OptionInfo` type

* Add `@ts-expect-error` for `option-normalizer`

* Avoid type error

* Fix typo

* Add types for lodash fns

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-10 15:26:07 +09: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
fisker Cheung 9691e7bc37 Add acorn parser (#12172) 2022-01-28 15:25:30 +08:00
fisker Cheung 8ffbcbbcae Refactor integration test files to use ES Module (#11891) 2021-12-02 10:19:32 +08:00
Sosuke Suzukiandfisker Cheung 2664fcb2ba Enable import/no-anonymous-default-export (#11478)
* Enable import/no-anonymous-default-export

* Add names to default exported

* More

* Ignore shims

* Update scripts/build/config.mjs

Co-authored-by: fisker Cheung <lionkay@gmail.com>

* lint  for shims

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-09-10 11:17:09 +09:00
Sosuke Suzuki 6739679767 Revert workaround (#11481) 2021-09-09 19:59:04 +09:00
Sosuke Suzuki c2808faf2a Fix Playground (#11433)
* Revert ENABLED_OPTIONS

* Fix

* Fix typo
2021-09-02 17:55:30 +09:00
4992d97203 Deprecate jsxBracketSameLine option in favour of multi-language bracketSameLine option (#11006)
* deprecate jsxBracketSameLine in favour of multi-language angleBracketSameLine option

* update docs and snapshots

* update tests to to make them more reviewable

* Rewrite angular tests

* Rewrite html tests

* Rewrite vue tests

* Restore unnecessary changes in jsx

* Fix file location

* Test both `true` and `false`

* Revert changes in markdown

* Run tests on all js parsers

* Improve html test

* fix changelog comment

* move bracketSameLine to common options

* mark jsxBracketSameLine as deprecated

* Update changelog_unreleased/html/11006.md

Co-authored-by: fisker Cheung <lionkay@gmail.com>

* Update 11006.md

* fix tests by removing `jsxBracketSameLine` `default` property

* fix style

* Revert docs under website dir

* Add tests for deprecated options

* Fix lint problems

Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-08-31 11:47:50 +09:00
fisker Cheung a77845638f Combine ESLint config files (#11240) 2021-07-26 09:25:13 +08:00
fisker Cheung 894f841fbd Style: Enforce extensions (#11227) 2021-07-21 09:10:34 +08:00
Georgii Dolzhykov 3d8dc612b5 Bump Prettier dependency to 2.3.0 2021-05-10 00:07:47 +03:00
Georgii Dolzhykov dfd471f334 Playground: autofold more AST properties (#10596) 2021-03-26 01:48:36 +02:00
dependabot[bot]andfisker Cheung ae1d29c1ce Build(deps-dev): Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0 (#10578)
* Build(deps-dev): Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0

Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 28.0.2 to 29.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v28.0.2...v29.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Apply fix

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-03-22 17:11:35 +02:00
fisker Cheung ff32d6b823 Playground: Order options (#10501)
* Playground: Order options

* Remove `rangeStart/End` from `ENABLED_OPTIONS`
2021-03-10 22:20:47 +02:00