Commit Graph
68 Commits
Author SHA1 Message Date
fisker Cheung c163d346d4 Extract json parser (#10405) 2021-02-28 11:38:21 +08:00
fisker Cheung 95c8086c2c Add flat-ast-path-call rule (#10354) 2021-02-26 09:26:50 +08:00
fisker Cheung 64a3906571 Enable unicorn/prefer-optional-catch-binding (#9464) 2021-02-25 18:28:55 +08:00
dependabot[bot]andfisker Cheung 73daa85a56 Build(deps-dev): Bump eslint-config-prettier from 7.2.0 to 8.0.0 (#10369)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-02-21 21:56:49 +08:00
fisker Cheung 9c6de24405 Style: Disallow == (#10338) 2021-02-21 02:44:16 +02:00
fisker Cheung c3d08c943e Style: Disallow else if in no-else-return (#10310) 2021-02-15 05:29:58 +02:00
Georgii Dolzhykov f3906d84d4 Refactor: rename FastPath → AstPath (#10276) 2021-02-10 13:42:06 +02:00
fisker Cheung ba3930d63e Replace concat in src/document/ with array (#10185) 2021-02-08 09:48:25 +08:00
Georgii Dolzhykov 5a33fec904 RFC: indentIfBreak (#10221) 2021-02-05 01:03:40 +02:00
fisker Cheung f04b2b991c Enable no-implicit-coercion rule (#10186) 2021-02-01 13:14:04 +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 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
fisker Cheung dd606d9ce1 Enable unicorn/no-array-push-push (#10111)
* Enable rule

* Apply auto-fix

* Manual fix
2021-01-23 22:37:01 +02:00
fisker Cheung 0009e0d276 Enable unicorn/prefer-regexp-test (#10045) 2021-01-12 20:37:05 +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
fisker Cheung f0f18d3090 Enable unicorn/prefer-number-properties (#9935) 2020-12-21 17:09:20 +08:00
fisker Cheung c7e354e38c Add isNonEmptyArray (#9902) 2020-12-17 14:46:59 +08:00
fisker Cheung 0fd2a28cff Enable arrow-body-style rule (#9918) 2020-12-17 14:31:51 +08:00
fisker Cheung 89402482ee Consistent Jsx case in variables (#9871) 2020-12-15 12:23:40 +08:00
fisker Cheung d8e40cd978 JS: Add hasComment and getComments (#9742) 2020-11-25 22:14:27 +08:00
fisker Cheung 9e9cc85072 Enable directly-loc-start-end for all languages (#9610) 2020-11-10 09:06:08 +08:00
fisker Cheung 84b81c8a1a Enable directly-loc-start-end in language-css (#9591) 2020-11-05 19:26:05 +08:00
fisker Cheung c7390d33b7 Refactor: Use locStart and locEnd directly from language-js/loc.js (#9576) 2020-11-04 08:52:02 +08: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 771a09dfee Refactor needs-parens.js (#9485) 2020-10-26 09:05:21 +08:00
fisker Cheung e8b299d164 Rename native shims to .mjs (#9079) 2020-08-28 10:03:36 +08:00
fisker Cheung c6b3ed6e1c Enforce .json extensions (#8908) 2020-08-06 00:37:16 +08:00
fisker Cheung 8a635f5bdf Fix expect.resolves assert (Part 2) (#8756) 2020-07-14 21:53:45 +08:00
fisker Cheung a0e2efca04 JS: Cleanup loc.js (#8678)
* Cleanup js `loc.js`

* Simplify `composeLoc`

* Simplify `locEnd`

* Simplify

* Fix Ast

* Remove use of loc

* Remove use of loc
2020-07-01 19:50:15 +03:00
554b15473d Document recommended setup and improve docs overall (#8510)
Co-authored-by: Jed Fox <git@twopointzero.us>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2020-06-28 09:47:29 +08:00
fisker Cheung 0c2b918078 ESLint: enable import/order (#8635) 2020-06-26 20:30:21 +08:00
Simon Lydell 9184743081 Quote and unquote number keys (#8508)
* Quote and unquote number keys

* Add changelog entry

* Add tests for escapes

* Fix idempotency

* Only run flow-repo/ tests with flow

271 jsfmt.spec.js in flow-repo use only the flow parser.
18 use flow and babel.
Now, all of them use only flow.

* Don’t unquote negative numbers

* Don’t quote/unquote numbers in TypeScript

* Quote BigInt

* Fix AST check

* Fix condition

* Fix BigInt to string

* Fix ESLint not recognizing BigInt

* Only quote/unquote “simple” numbers

* No need to clean BigIntLiteral anymore

* Add tests for 1. and .1

* Fix 1. and .1

* Remove unnecessary babel-ts from tests

* Only unquote numbers for babel

* Update changelog
2020-06-18 18:13:25 +03:00
fisker Cheung 76b4970c2e Update ESLint related dependencies (#8299) 2020-05-14 10:51:11 +08:00
fisker Cheung 207d5245c5 Build: exclude index.js from bin-prettier (#8119) 2020-05-06 18:43:04 +08:00
fisker Cheung 4c4d044fbb Bump eslint-plugin-unicorn to v19 (#8158) 2020-04-27 17:59:42 +08:00
fisker Cheung ab1ea713d6 Missing files on lint (#8127) 2020-04-23 19:33:40 +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
fisker Cheung 69d121b19e Enable unicorn/prefer-set-has (#7990) 2020-04-09 13:22:28 +08:00
fisker Cheung c0517441b2 Enable unicorn/prefer-string-slice (#7251) 2020-01-23 15:15:28 +03:00
fisker Cheung 27b5cb4d9d Enable ESLint prefer-rest-params rule (#7400) 2020-01-23 10:36:18 +02:00
fisker Cheung c472358a92 Enable eslint rule prefer-object-spread (#7398) 2020-01-20 19:21:51 +02:00
fisker Cheung 7264566d55 Move React ESLint rules to "/website" (#7332) 2020-01-20 13:51:40 +03:00
fisker Cheung 9b2c7f342f Fix prefer-object-spread in /scripts (#7336) 2020-01-20 13:49:52 +03:00
fisker Cheung 00d46ee26e Fix prefer-object-spread in /tests* (#7337) 2020-01-19 01:23:16 +02:00
fisker Cheung f805388d65 Fix prefer-object-spread in /website (#7338) 2020-01-15 18:27:46 +02:00