Commit Graph
41 Commits
Author SHA1 Message Date
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
Bogdan Chadkin 92e6f44bba Replace minimatch with micromatch (#12225) 2022-02-11 21:15:32 +08:00
Jed Fox 98f560839c Include vendors/ when installing from GitHub (#12250) 2022-02-06 23:22:44 -05:00
Sosuke Suzuki 0abd1907bb Bundle Pure ESM Packages into /vendors/*.js as CommonJS (#12217)
* string-width

* Add bundle script

* Update package.json

* mem

* Add version validator

* Throw error

* Change filename

* Add documents

* Generate d.ts

* Fix lint problems

* globby

* Add workflow to validate vendor versions

* Fix eslintignore

* Fix

* Fix spell

* Address review

* process.exitCode = 1

* test validation

* Revert "test validation"

This reverts commit 5a86d5f71212e0e900709238a8cc109716678864.

* Remove exists files

* Fix conflicts

* Clean

* Remove globby
2022-02-06 17:31:50 +09:00
fisker Cheung e96dc509ec Update eslint config (#11595) 2021-09-28 11:16:39 +08:00
fisker Cheung 894f841fbd Style: Enforce extensions (#11227) 2021-07-21 09:10:34 +08:00
Sosuke Suzuki aefcb0cc0a Add types for cosmiconfig explorer (#11224) 2021-07-19 16:41:40 +09:00
fisker Cheung d3b777dd7d Update build script (#10946) 2021-05-27 08:54:42 +08:00
fisker Cheung f04b2b991c Enable no-implicit-coercion rule (#10186) 2021-02-01 13:14:04 +08:00
fisker Cheung ce26805e84 Enable unicorn/prefer-spread (#10129) 2021-01-26 09:46:14 +08:00
fisker CheungandGeorgii Dolzhykov 6175013ae3 Enable unicorn/no-array-for-each (#10112)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-01-24 19:26:42 +08:00
dependabot[bot]andfisker 1a21ba94e4 Build(deps): Bump editorconfig-to-prettier from 0.1.1 to 0.2.0 (#9067)
* Build(deps): Bump editorconfig-to-prettier from 0.1.1 to 0.2.0

Bumps [editorconfig-to-prettier](https://github.com/josephfrazier/editorconfig-to-prettier) from 0.1.1 to 0.2.0.
- [Release notes](https://github.com/josephfrazier/editorconfig-to-prettier/releases)
- [Commits](https://github.com/josephfrazier/editorconfig-to-prettier/compare/v0.1.1...v0.2.0)

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

* Remove `insertFinalNewline`

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-08-27 06:27:28 +08:00
fisker Cheung 7c318cc677 Support .prettierrc.json5 config file (#8957) 2020-08-15 21:16:49 +08:00
dependabot[bot]andfisker 07fbf265fa Build(deps): Bump cosmiconfig from 6.0.0 to 7.0.0 (#8890)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
2020-08-10 21:59:41 +08:00
fisker Cheung 0c2b918078 ESLint: enable import/order (#8635) 2020-06-26 20:30:21 +08:00
fisker Cheung 9e8df9d922 Fix resolve EditorConfig for files in deep directory (#8591)
* Fix resolve editorConfig for files in deep directory

* Add  changelog,  remove `find-project-root`

* Simplify

* Use `existsSync` instead of `readdirSync`
2020-06-24 23:58:02 +03:00
fisker Cheung aeeb2ff7a8 Throw original error when loading external config (#7973) 2020-04-10 21:27:50 +08:00
Georgii Dolzhykov 6a9c9951f2 workaround for require.resolve in prettier-vscode (#7951) 2020-04-05 21:53:15 +03:00
Georgii Dolzhykov 9dad95b35f Bump Prettier dependency to 2.0.0 2020-03-21 22:09:54 +02:00
fisker Cheung 129fcb6005 Remove resolve package (#7508) 2020-02-25 03:03:58 +02:00
fisker Cheung ee61bdf435 Remove usage of cosmiconfig v4 interface (#7458)
* Remove usage of cosmiconfig v4 interface

* Remove `loadEditorConfig` second argument
2020-02-17 16:42:04 +02:00
fisker Cheung ebd0c6d605 Remove useless argument in editorconfig load function (#7459) 2020-01-29 12:51:05 +03:00
fisker Cheung c493bdef8d Update mem to v6 (#7260)
* Style: use async for `editorconfigAsyncNoCache`

* Update `mem` to v6

* Fix usage of `mem`

* Fix: add `await`

* Use JSON.stringify
2020-01-28 19:10:01 +02:00
fisker Cheung 00d2299bce Fix prefer-object-spread in src/config (#7354) 2020-01-19 13:42:48 +02:00
fisker Cheung 4abd19ae14 Use array destructuring for some simple case (#7330)
* Use array destructuring for some simple case

* Revert [0]
2020-01-15 19:24:52 +02:00
Georgii Dolzhykov 7e3c0c73b3 Merge branch 'master' into next 2020-01-14 20:36:21 +02:00
fisker Cheung beeaa98cb9 Fix quote style, enable quote rule (#7304) 2020-01-14 13:58:20 +03:00
fisker CheungandGeorgii Dolzhykov ea23fc5d92 Update cosmiconfig to v6 (#6850)
* Update `cosmiconfig` to v6

* fix changes required

* style

* replace parentModule logic

* fix build script

* fix import-fresh

* fix rebase consequences

* remove babel-plugin-transform-async-to-promises

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-01-10 03:21:44 +02:00
fisker Cheung 98ec2c4512 Style: use async functions (#6935) 2019-11-14 18:23:06 +01:00
Zaven MuradyanandSimon Lydell 3d52ab7016 Gracefully handle nonexistent paths passed to --stdin-filepath. (#6687)
Co-authored-by: Simon Lydell <simon.lydell@gmail.com>
2019-11-02 15:56:26 +01:00
Lucas Duailibe 3805034bdf Improve Rollup setup 2019-06-07 18:20:40 -03:00
fisker Cheung 99d4b86c18 Rollup update (#6200) 2019-06-07 16:58:05 -03:00
Lucas Duailibe 448328270d Support overrides for dotfiles (#6194) 2019-06-07 09:45:56 -03:00
Lucas Azzola f32b289032 Support shared Prettier configuration (#5963)
* Support external configuration

* Document changes

* Update existing snapshots

* Update existing snapshots (2)

* Fix typo in docs

* Add example config repo
2019-03-13 09:34:51 +11:00
Ika 514b6d3741 Bump Prettier dependency to 1.15.0 2018-11-07 09:12:25 +08:00
Jorge Gonzalez 7d78ce68ef feat(config): support TOML configuration files (#4877)
* Add initial support for TOML in configuration files

* Missed brace

* Fix snapshots

* refactor: move loadToml to utils

* Use @iarna/toml

* Add tests for loadToml

* Fix test for CI

* Remove jest-extended

* Create snapshot for load-toml

* Add feat to docs

* lint docs

* Use @iarna/toml/parse-string

* Change path string
2018-08-03 06:27:19 -04:00
Ika 440ab4f60b refactor: upgrade to cosmiconfig@5 (#4899)
* refactor: upgrade to cosmiconfig@5

* fix: use custom require
2018-07-29 16:57:36 +08:00
Ika 18aa527adc feat(api): support relative paths for plugin(SearchDir)s in config files (#4667)
* feat(api): support relative paths for plugin(SearchDir)s in config files

* fix: convince appveyor
2018-06-15 04:25:03 +08:00
Joseph Frazier 5153b15245 Respect EditorConfig when --config is passed (#3992)
* Respect EditorConfig when `--config` is passed

* Clarify config-resolution test file

See https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* Update test snapshots
2018-02-24 19:11:23 +11:00
Joseph Frazier 7b211eab24 editorconfig: Only search for .editorconfig up to the VCS directory (#3559)
* editorconfig: Only search for .editorconfig up to $PWD

This addresses https://github.com/prettier/prettier/issues/3558

I'm not sure if this is the best way to find the "project root", but it
seems better than before.

* editorconfig: Search for `.editorconfig` up to the VCS directory

This uses [find-project-root] to find the nearest directory containing `.git` or `.hg`

See here for context: https://github.com/prettier/prettier/pull/3559#issuecomment-353756948

[find-project-root]: https://github.com/kirstein/find-project-root

* editorconfig: Add test for finding VCS directory

It's a little hacky in that the .hg file isn't really a Mercurial
repository, but it's enough to illustrate the intent. See here for
context: https://github.com/prettier/prettier/pull/3559#issuecomment-353857109
2017-12-26 18:16:09 +11:00
Lucas Azzola 4c9d4061da Prettier Plugin API (#3536)
* Move files around in preparation for refactor

* Update paths in build script

* Extract generic printing logic from the JavaScript printer

* Conform printer API

* Fixup decorator handling

* Fix multiparser

* Create plugin entry for markdown

* Create plugin entry for javascript/typescript

* Create plugin entry for html

* Create plugin entry for graphql

* Create plugin entry for css/less/scss

* Move JSON to JS plugin entry

* Integrate plugins into getSupportInfo()

* Move astFormat to parser definition

* Move util to common

* Implement parser loading

* remark -> mdast

* Rename cli/cli -> cli/index

* Rename builder -> doc package, fix printer resolution

* Fix doc shape assumption in CSS-in-JS logic

* Fix third-party.js prod resolution

* Fixup build-docs script

* Distribute multiparser code

* Remove requirement to forward options

* Flatten closure

* Remove debug directory

* Expose doc

* Add external plugins

* Pass options to loadPlugins

* Export getParsers

* Pin resolve version

* Use getSupportInfo in Markdown embed

* Document plugin API

* Update build-docs

* Add CLI for plugins

* Lint docs

* Fixup build.js

* Add vue language

* Fixup multiparser for vue

* Upgrade rollup and rollup-plugin-commonjs

* Fixup third-party build

* Change AST format in docs
2017-12-26 12:23:50 +11:00