Commit Graph
100 Commits
Author SHA1 Message Date
sosukesuzuki 043043b8de Git blame ignore 2.4.0 2021-09-09 18:23:34 +09:00
sosukesuzuki ef514b9b5c Bump Prettier dependency to 2.4.0 2021-09-09 18:23:34 +09:00
sosukesuzuki e49951e5a3 Release 2.4.0 2021-09-09 18:19:39 +09:00
Sosuke Suzuki ce1bb16c17 Use node 16.8.0 for GitHub Actions (#11470)
* Use node 16.8

* More fix
2021-09-09 10:01:43 +09:00
Sosuke Suzuki 0eb1493988 Refactor html printer (#11462)
* tmp: not working

* works

* renamae

* Refactor

* Address review
2021-09-08 16:32:20 +09:00
Sosuke Suzuki bf2a24fdd1 Add tests for release script (#11454)
* Install jest

* Configure jest script

* Fix eslintrc

* Add @types/jest

* Add test for validate-new-version

* Fix eslintrc

* Add workflow file

* Add node version

* cd to script/release

* Fix workflow file

* Fix version

* Ignore from root

* Update yarn.lock

* Set defaults.run.working-directory
2021-09-07 14:53:45 +09:00
Sosuke Suzuki 2bbe331f64 Regenerate lockfile (#11458)
* Regenerate yarn.lock

* Fix  tests

* Add yarn.lock to workflow paths
2021-09-07 13:10:54 +09:00
Sosuke Suzuki f5abf17bf0 Update stage 3 -> stage 4 (#11456) 2021-09-06 04:34:53 +09:00
Sosuke Suzuki affc17392d Fix blog draft script (#11453) 2021-09-05 22:51:23 +09:00
Sosuke Suzuki bef39f2394 Update @babel/parser to 7.15.4 (#11436)
* Install new babel/parser

* Add tests for static blocks with line breaks
2021-09-04 22:02:30 +09:00
Sosuke Suzuki c2808faf2a Fix Playground (#11433)
* Revert ENABLED_OPTIONS

* Fix

* Fix typo
2021-09-02 17:55:30 +09:00
Sosuke Suzuki af19dd18d6 Improve generate changelog script (#11427)
* Output file path

* Address review
2021-08-31 10:55:16 +09:00
Sosuke Suzuki 6dd2788e85 Support TypeScript 4.4 (#11426)
* Update to ts-estree 4.30

* Add tests

* Add changelog
2021-08-31 10:29:20 +09:00
Sosuke Suzuki 53f95f3500 Support hack-style pipeline (#11335)
* Avoid to conflicts to v8intrinsic plugin

* Support hack-style pipeline

* Update tests for hask-style pipeline

* Update tests 2

* Add changelog

* Update misc tests

* Address reviews

* Fix type error

* Copy plugin array

* Add tests

* Address review

* Add error tests
2021-08-15 01:16:13 +09:00
Sosuke Suzuki 83e5ebe891 Add a script to generate unreleased changelog (#10988)
* Add script to generate changelog

* Fix by prettier

* Use CHANGELOG_CATEGORIES from utils

* Fix filename

* Fix typo

* Add comments

* Replace codeblock

* Fix typo

* Avoid to use top-level await

* Use enquirer

* Address review

* Use meriyah for mjs

* Add comment

* Update usase comment

* Update CONTRIBUTING.md
2021-08-13 12:47:18 +09:00
Sosuke Suzuki 0507897bde Use cspell options (#11336) 2021-08-12 18:55:21 +09:00
Sosuke Suzuki a14c55009a Improve types for using babel parser (#11316) 2021-08-11 23:06:52 +09:00
Sosuke Suzuki 9e34cbcc98 Update @babel/parser to 7.15.2 (#11331)
* Install new babel

* Remove ts-expect-error
2021-08-09 02:26:42 +09:00
Sosuke Suzuki 9dcfd16e6a Use ts-expect-error instead of ts-ignore (#11330) 2021-08-09 00:00:22 +09:00
Sosuke Suzuki 6ea2aa22c4 Follow up #11314 (#11315) 2021-08-07 03:18:53 +09:00
Sosuke Suzuki e315513178 Use regexp instead of two include methods (#11314) 2021-08-06 23:34:35 +09:00
Sosuke Suzuki 1645e7a9c4 Update to babel/parser 7.15.0 (#11310)
* Update to babel/parser 7.15

* Avoid plugin conflicts

* Remove allowAwaitOutsideFunction

* Add remove private-in

* Update tests for top-level-await

* Update typescript tests

* Handle bar style record/tuple

* Update tests

* Use appendPlugin

* Dont consider about bar style record and tuple

* Revert appendChild

* Update appendPlugins
2021-08-05 19:14:42 +09:00
Sosuke Suzuki b6fd414918 Count correctly regex literals in method chain arguments (#11299)
* Use getStringWidth instead of String length

* Add changelog

* Fix changelog
2021-08-02 14:15:07 +09:00
Sosuke Suzuki bd1c1bd08f Update node-actionlint to 1.1 (#11277) 2021-07-28 21:14:15 +09:00
Sosuke Suzuki 0792cf9604 Fix formatting intersection types that includes mapped types (#11247)
* Treat TSMappedType as object types

* Add tests

* Add changelog
2021-07-27 00:49:24 +09:00
Sosuke Suzuki 0696f583ee Use node-actionlint (#11268) 2021-07-26 09:23:54 +09:00
Sosuke Suzuki 1ecae48ae8 Support parenthesized tagged template literals for styled components (#11246)
* Support parenthesized styled.property

* Add changelog

* Fix changelog
2021-07-25 18:16:25 +09:00
Sosuke Suzukiandfisker Cheung 4d8871c106 Migrate generate-schema script to ESM (#11226)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-07-20 19:25:54 +08:00
Sosuke Suzuki aefcb0cc0a Add types for cosmiconfig explorer (#11224) 2021-07-19 16:41:40 +09:00
Sosuke Suzukiandfisker Cheung c2599d4714 Fix workflow files according to actionlint (#11197)
* Fix by actionlint

* Run actionlint in GH Actions

* Update cspelljson

* Test

* Revert

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-07-13 17:27:04 +09:00
Sosuke Suzuki fceaab3e84 Move type definition for angular-html-parser (#11193) 2021-07-12 15:42:29 +09:00
Sosuke Suzuki 392c72b3cd Fix replace-module plugin name (#11192) 2021-07-12 07:45:33 +08:00
Sosuke Suzuki 1a535de3f8 Clean changelog unreleased (#11111) 2021-06-26 17:37:17 +09:00
sosukesuzuki d345f173ea Git blame ignore 2.3.2 2021-06-26 17:31:48 +09:00
sosukesuzuki 0747d92041 Bump Prettier dependency to 2.3.2 2021-06-26 17:31:48 +09:00
sosukesuzuki 9a8b579d36 Release 2.3.2 2021-06-26 17:27:44 +09:00
Sosuke Suzuki 2faf01b8b4 Add changelog-for-patch script (#11052)
- Add ./scripts/changelog-for-patch.mjs
- Extract common functions to ./scripts/utils/changelog
- Use changelog-for-patch.mjs from release script
2021-06-26 16:29:30 +09:00
Sosuke Suzuki 82687f1c02 Print override modifier for parameter property (#11074)
* Install new typescript-estree

* Print override modifier for parameter property

* Add tests

* Add changelog

* Fix by Prettier

* Update babel-parser

* Update snapshot

* Update snapshots
2021-06-15 15:28:31 +09:00
Sosuke Suzuki 17d8cb57b7 Add PR and users link (#11072) 2021-06-14 22:05:06 +09:00
Sosuke Suzuki 3332a28aaf Update generate-schema script (#11043)
* Support custom parser and use anyOf

* Update snapshots
2021-06-11 14:04:51 +09:00
Sosuke Suzuki e2694e2b21 Clean changelog_unreleased (#11033) 2021-06-09 14:42:00 +09:00
Sosuke Suzukiandfisker Cheung 321f736183 Retry "npm publish" when to enter OTP is faeild (#11031)
* Retry "npm publish" when to enter OTP is faeild

* Fix else

* Break

* Use async function

* Update cspell.json

* Address review

* Update scripts/release/steps/publish-to-npm.js

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

* Update scripts/release/steps/publish-to-npm.js

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

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-06-07 13:07:22 +09:00
sosukesuzuki 4b4499a0d8 Move TS4.3 section to top of CHANGELOG 2021-06-05 19:51:47 +09:00
sosukesuzuki 79a9c1e77b Update dependents count 2021-06-05 19:37:25 +09:00
sosukesuzuki d426741013 Fix bump script 2021-06-05 19:36:33 +09:00
sosukesuzuki 13d4d8bdd5 Git blame ignore 2.3.1 2021-06-05 19:36:05 +09:00
sosukesuzuki a34b4a711e Bump Prettier dependency to 2.3.1 2021-06-05 19:36:05 +09:00
sosukesuzuki d770f49dc0 Release 2.3.1 2021-06-05 19:19:23 +09:00
Sosuke Suzuki 09d65c35af Revert features for minor (#11016)
This reverts commit f8cb785758.
2021-06-05 18:32:49 +09:00
Sosuke Suzuki 3ec9414ae9 Fix order of override modifiers (#10961)
* Fix modifiers order

* Add tests

* Add changelog
2021-05-30 23:50:33 +09:00
Sosuke Suzukiandfisker Cheung 9d53f64d85 Update to TypeScript 4.3 (#10959)
* Update links

* Update changelog_unreleased/typescript/10945.md

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

* Install TS 4.3.2

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-05-28 16:12:00 +09:00
Sosuke Suzuki 84f72be9dc Avoid to break after assignment for call expression that has complex type parameters (#10949)
* Avoid break-after-operator when call expr has complex type params

* Add tests

* Add changelog

* Fix issue number

* Update snapshpts

* Address review

* Support Flow

* Rename parameters => arguments

* Remove isCallExpression
2021-05-28 10:40:33 +09:00
Sosuke Suzuki 06065bf49b Support TypeScript 4.3 (#10945)
* Update deps

* Add tests

* Add changelog
2021-05-25 10:39:32 +03:00
Sosuke Suzuki f1e0f639c3 refactor: Add isObjectProperty util function (#10942)
* Add isObjectProperty

* Rename to isProperty

* Address review

* Address review2

* Make isProperty strict

* Rename to isObjectProperty
2021-05-25 11:07:08 +09:00
Sosuke Suzuki c40a0cf2b8 Add heuristics to detect assignments whose id has complex type annotations (#10916) 2021-05-24 01:24:56 +03:00
Sosuke Suzuki 4b9e881b33 Add heuristics to detect type aliases that has complex typeparameters (#10901) 2021-05-19 09:22:33 +08:00
Sosuke Suzuki cedf4800ae Add JSDoc type for isNonEmptyArray (#10902) 2021-05-17 20:51:47 +08:00
Sosuke Suzuki 711c6d0d27 Support typescript 4.3 via babel (#10811)
* Suppor type members get/set

* Add tests for static index signature in class

* Support override modifier in class

* Add changelog
2021-05-05 22:32:51 +03:00
Sosuke Suzuki edc7a30f26 Support async do expressions proposal (#10813)
* Support async-do-expression proposal

* Add more tests

* Add changelog
2021-05-05 22:32:26 +03:00
Sosuke Suzuki 3a1512f043 Add tests for indexed access via Babel (#10812)
* Add tests for optional indexed access via Babel

* Add tests for indexed access via Babel
2021-05-05 20:49:24 +03:00
Sosuke Suzuki 63c744823b Update babel parser (#10802)
* Update

* Use error codes instead of error messages

* Update js tests

* Update ts tests

* Add comments

* Remove plugins enabled by default

* update misc error tests

* Remove moduleStringNmaes

* use allowedMessagesCode directly

* Remove some misc tests

* Update snapshots for integration tests

* Add Redeclaration to cspell.json
2021-05-03 12:12:25 +09:00
Sosuke Suzuki 6b204193c0 Improve formatting for Module Blocks Proposal (#10758)
* Improve

* Add tests

* Fix tests

* Detect specified option object expression
2021-04-27 12:11:53 +09:00
Sosuke Suzuki 0cdc62e405 Improve formatting for do expression (#10693) 2021-04-12 04:22:44 +03:00
Sosuke Suzuki 34cff1095a Fix changelog for support TypeScript 4.2 (#10595) 2021-03-25 15:36:21 +09:00
Sosuke SuzukiandGeorgii Dolzhykov a49942c1ba Support module blocks proposal (#10417)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-24 18:19:11 +02:00
Sosuke Suzuki f0a612a302 Update @typescript-eslint/typescript-estree (#10589) 2021-03-24 19:39:00 +09:00
046ffb11f9 Support better formatting for curried arrow functions (#9992)
* Support formatting for curried arrow functions

* Fix test file name

* Fix threshold

* Add changelog

* Fix operator for comparing

* Fix return pos

* Fix eslint

* level 2

* Refactor for level2

* Update tests

* Remove concat

* If it fits on one line, print on one line

* Indent second level arg

* Break before last return value

* Use isCallLikeExpression

* Improve printing

* Add tests

* Remove unnecesary condition

* Fix lint problems

* Update src/language-js/utils.js

Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>

* Update changelog

* Add ImportExpression

* Add ImportExpression to isCallLikeExpression

* Resolve conflicts

* Address reviews

* Fix ESLint problem

* Fix changelog

* Add tests

* More tests

* Print simple arrow chains on one line

* Don't forcibly break chain when a segment has a return type but no params

* Prevent excessive wrapping in assignments

* Simplify

* Format object bodies like blocks

* Update changelog

* Fix last arg expansion

* Simplify

* Fix arrow chains in assignment chains

Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-08 23:18:53 +02:00
Sosuke Suzuki c9144daf47 Support TS 4.2 abstract construct types via ts-estree (#10466) 2021-03-06 19:16:51 +02:00
Sosuke Suzukiandfisker Cheung f1b5720fc7 Remove unstable AST testing (#10462)
* Add unstable AST testing for json-stringify parser

* Deduplicate yarn.lock

* Ignore `tokens`

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-03-05 12:17:42 +02:00
Sosuke Suzuki eb5139b7a9 Remove unnecessary condition (#10032) 2021-03-05 09:24:46 +02:00
Sosuke Suzuki fc396277fc Support TS 4.2 abstract constructor signature (#10418) 2021-02-28 22:00:17 +02:00
Sosuke Suzuki feacf82892 Update babel/parser to v7.12.17 (#10345) 2021-02-25 18:28:06 +08:00
Sosuke Suzuki b0d66bb3c6 Support TS 4.1 intrinsic keyword (#10390) 2021-02-22 13:49:49 +02:00
Sosuke Suzuki f858f5519f Add prettier-ignore comment for cpied markdown (#10343) 2021-02-18 23:24:10 +09:00
Sosuke Suzuki 2598803a2a Improve formatting for React Hooks call (#10238)
* Add isReactHookCallWithDepsArray

* Improve formatting for React hooks call

* Refactor

* Add changelog

* Use isReactHookCallWithDepsArray in shouldGroupLastArg

* Support general pattern
2021-02-14 23:57:26 +02:00
Sosuke Suzukiandfisker Cheung 7d84c0a5a4 Fix inconsistent indentation for ternary in call expressions (#10266)
* Refactor with do while

* return false when ternary in CallExpression is not callee

* Update changelog

* For computed member property

* Fix

* Simplify

* Minor tweak

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-02-12 08:11:24 +09:00
Sosuke Suzuki 2d97df8ec7 Fix unnecessary line breaks in method type declaration parameters (#10024) 2021-02-11 09:49:38 +02:00
Sosuke Suzuki cc1f0543e6 Consistent indentations for conditional operators (#10187) 2021-02-07 16:53:05 +02: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
Sosuke Suzukiandfisker Cheung c881350e8c Break assignment whose rhs is wrapped by an unary expression (#10158)
* Break assignment whose rhs is wrapped unary expression

* Add changelog

* Recursive

* Refactor

* With loop

* Use if

* Update assignment.js

* Update assignment.js

This rewrite not totally equal, but should safe.

* Revert "Update assignment.js"

This reverts commit 14549442b7726461b0e39d0b1077cdbb00195e73.

* Try move parser check upper

* Simplify `switch`

* Simplify

* Move parser check to top

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-01-28 23:06:16 +09:00
Sosuke SuzukiandGeorgii Dolzhykov 53a7e9782b Print trailing comma for type parameters (#10109)
* Print type parameters for TypeScript

* Add more tests

* Add changelog

* Avoid duplicates printing trailing-commas

* Fix changelog

* Address review

* Update src/language-js/print/type-parameters.js

* Update 10109.md

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-01-28 23:03:16 +09:00
Sosuke Suzuki c7a3c16f7d Improve visual separation between header and body in classes with multiline headers (#10085)
* Add hardline for a class whose extends part is broken

refactor

Use groupId

Remove isPreviousLineEmpty

* Avoid leading comments

* Rename to heritage

* Add heuristic for implements

* Fix lint problems

* Fix

Fix

Fix

* Extract getGroupId patterns

* Adopots solution 2

* Fix

* Fix lint problem

* Add changelog

* Address reviews

* Update tests

* Rename to createGroupIdMapper

* Split files

* Add tests for complex extends

* Fix changelog
2021-01-20 15:01:16 +09:00
Sosuke Suzuki fbb3c421e5 Remove workaround for rollup/plugin-node-resolve 11 (#10075) 2021-01-18 16:51:00 +09:00
Sosuke Suzuki 0144c7aa2f Rename shouldNotPrePrintHardline to shouldPrePrintHardline (#10067) 2021-01-18 10:50:02 +09:00
Sosuke Suzuki 87b5cfc8ab Refactor: Use getLastStatement function in printStatementSequence (#10066)
* Add getLastStatement function

* Use loop

* Fix lint problem
2021-01-17 10:54:38 +09:00
Sosuke Suzuki 2f3fc241f8 Add meriyah to getMarkdownSyntax (#10061) 2021-01-15 23:05:31 +09:00
Sosuke Suzuki 671fa5ddaf Move checkCache to Cache class (#10029)
* Move checkCache to Cache class

* Address reviews
2021-01-11 13:25:34 +09:00
Sosuke Suzukiandfisker Cheung e70ad5b7fb Check cache only when purge-cache is off (#10031)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-01-11 10:24:24 +08:00
Sosuke Suzuki e2c84527e7 Use fs.promises in build script (#10025) 2021-01-09 02:09:40 +09:00
Sosuke Suzuki 23521ded6c Refactor CLI context with ES2015 class (#9964)
* Remove createContext

* Remove initContext

* Remove pushContextPlugins

* Remove popContextPlugins

* Move JSDoc comments

* Remove updateContextArgv

* Remove normalizeContextArgv

* Remove updateContextOptions

* Fix typedef

* Change exports format

* Add comment for initContext
2021-01-01 01:56:32 +09:00
Sosuke Suzuki de882505f0 Fix params mistaking at #9900 (#9912) 2020-12-16 18:46:56 +09:00
Sosuke Suzuki cb6a977733 Prints bundle sizes in build script log (#9900)
* Prints bundle size with flags

* Add "gzipped" to cspell.json

* Print esm bundle size

* Remove gzipped size from log
2020-12-16 08:45:29 +09:00
Sosuke Suzuki 8d0c8b2bf4 Extract files and rename util -> core (#9826)
WIP

Extract create-minimist-options

Remove warning

Fix

Extract format.js

Fix

Remove

fix

Fix

Extract files for cli and rename util -> core

Update tsconfig
2020-12-08 14:36:46 +09:00
Sosuke Suzuki aaa9363e6f Print null argument list item (#9787)
* Print null argument list item

* Add changelog

* Add tests for comments
2020-12-08 13:52:30 +09:00
Sosuke Suzuki 083b501663 Refactor: Make Cache modern in build scripts (#9809)
* Make cache class

* equal -> strictEqual

* Use strict mode assert module
2020-12-02 15:03:32 +09:00
sosukesuzuki 9ee97183a0 Clean changelog_unreleased for patch-release 2020-11-28 09:46:33 +09:00
sosukesuzuki eb7972a86d Clean changelog_unreleased for patch-release 2020-11-28 09:39:51 +09:00
sosukesuzuki 81cf06129b Merge branch 'patch-release' 2020-11-28 09:28:07 +09:00
sosukesuzuki de00bf1018 Update dependents count 2020-11-28 09:26:43 +09:00
sosukesuzuki 2df7277501 Git blame ignore 2.2.1 2020-11-28 09:26:36 +09:00