Commit graph

2015 commits

Author SHA1 Message Date
u9g
9a5bb008e7
feat(query): Add is_getter, is_setter, is_constructor to all Function implementors (#1526)
---

<details open="true"><summary>Generated summary (powered by <a href="https://app.graphite.dev">Graphite</a>)</summary>

> # TL;DR
> This pull request adds new properties to the `ArrowFunction`, `FnDeclaration`, and `Function` interfaces in the Trustfall schema. It also adds implementation for resolving these properties in the `adapter.rs` and `properties.rs` files. Additionally, it adds a new method `function_scope_flag` to the `Vertex` struct in the `vertex.rs` file.
> 
> # What changed
> - Added new properties (`is_getter`, `is_setter`, `is_constructor`) to the `ArrowFunction`, `FnDeclaration`, and `Function` interfaces in the Trustfall schema.
> - Implemented the resolution of these properties in the `resolve_arrow_function_property`, `resolve_fn_declaration_property`, and `resolve_function_property` functions in the `properties.rs` file.
> - Added a new method `function_scope_flag` to the `Vertex` struct in the `vertex.rs` file.
> 
> # How to test
> 1. Run the test suite to ensure that all existing tests pass.
> 2. Add new tests to cover the newly added properties and the `function_scope_flag` method.
> 3. Run the test suite again and ensure that all tests pass.
> 
> # Why make this change
> - The new properties (`is_getter`, `is_setter`, `is_constructor`) provide additional information about functions in the Trustfall schema, allowing clients to query for these properties.
> - The `function_scope_flag` method in the `Vertex` struct provides a convenient way to access the scope flags of a function node, which can be useful for various analysis and processing tasks.
</details>
2023-11-27 12:22:41 +08:00
IWANABETHATGUY
8251a343aa
fix(oxc_vscode): vscode extension - check on file change (not on file save) (#1525)
1. Closed https://github.com/oxc-project/oxc/issues/1518

[录屏 2023年11月24日
12时08分14秒.webm](https://github.com/oxc-project/oxc/assets/17974631/6ff42edf-b837-466a-a9fa-a1d1244dfd45)
2023-11-27 12:20:50 +08:00
Dunqing
85e8c8bad5
fix(prettier): incorrect order of print in AssignmentTargetPropertyProperty (#1545) 2023-11-27 12:18:32 +08:00
Cameron
d5b636b197
feat(prettier) Improve assignment compatibility (#1547) 2023-11-27 10:01:01 +08:00
Ken-HH24
a2510be7a0
feat(linter): no-is-mounted for eslint-plugin-react (#1550)
Try to implement `no-is-mounted` for #1022
2023-11-26 11:06:08 +00:00
Boshen
023e6eabcd
chore(resolver): add a path alias test (#1549) 2023-11-26 07:14:32 +00:00
Cameron
08b659455b
refactor(prettier) move assignment printing into seperate file (#1544) 2023-11-26 14:09:57 +08:00
Radu Baston
59d0428eb5
feat(linter): eslint 9.0 no empty static block (#1543)
Related [issue](https://github.com/oxc-project/oxc/issues/1191)

---------

Co-authored-by: Radu Baston <radu.baston@sectorlabs.ro>
2023-11-25 17:09:50 +00:00
magic-akari
9ff0ffcc6f
feat(ast): implement new proposal-import-attributes (#1476)
- [Import Attributes](https://tc39.es/proposal-import-attributes)
2023-11-25 15:56:09 +08:00
Wenzhe Wang
46d1086c3e
feat(prettier): add LineSuffix Doc (#1542) 2023-11-25 13:46:02 +08:00
Wenzhe Wang
924d99e8d7
feat(prettier): init command of Fill (#1460) 2023-11-25 12:03:26 +08:00
Boshen
13cac62402
feat(prettier): print leading comments for all ast nodes (#1537) 2023-11-25 00:35:51 +08:00
Cameron
41bb0060eb
fix(linter) fix panic in no hex escape (#1540)
🦀🦶🔫

lol https://twitter.com/boshen_c/status/1719033308682870891

closes #1539
2023-11-24 23:57:02 +08:00
Boshen
32b19561a8
chore(prettier_conformance): ignore bind-expressions (#1535) 2023-11-24 20:26:27 +08:00
Dunqing
3ca2f50773
feat(prettier): align ObjectProerty with prettier (#1536) 2023-11-24 20:20:07 +08:00
Dunqing
ac8a5ce574
feat(prettier): support handling of BlockStatement within consequent in SwitchCase (#1533) 2023-11-24 17:15:29 +08:00
Dunqing
ec0ee5cd07
feat(prettier): keep empty lines in SwitchStatement (#1532) 2023-11-24 17:10:27 +08:00
Boshen
4a0d18048b
feat(prettier): format () => ({} ? 1 : 2); to () => ({}) ? 1 : 2; (#1534) 2023-11-24 17:07:19 +08:00
Dunqing
75c75887e3
feat(prettier): trim spaces when printing hardline (#1531) 2023-11-24 17:05:20 +08:00
Boshen
e55fdc6452
feat(prettier): add parens to conditional and arrow expr (#1530) 2023-11-24 15:07:29 +08:00
IWANABETHATGUY
9897cab220
chore(vscode): improve dx (#1528) 2023-11-24 15:05:27 +08:00
Boshen
6e81b3d41a
fix(prettier): pop the stack in should_wrap_function_for_export_default (#1529) 2023-11-24 14:57:06 +08:00
RiESAEX
8afda7d247
feat(linter): eslint-plugin-unicorn: escape-case (#1495)
[Rule](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md)
#684
2023-11-24 10:44:34 +08:00
u9g
ec2af2b24a
chore: add lint plugins to gitignore (#1524) 2023-11-24 10:43:34 +08:00
Boshen
6ebb42dbd7
fix(ast): remove debug_assertions from debug_name 2023-11-24 10:24:15 +08:00
IWANABETHATGUY
f4616815ea
chore: remove nextest config (#1522)
1. remove nextext config since we don't use it anymore.
2023-11-24 10:12:50 +08:00
Boshen
1dc365c204
ci: cargo test run --no-run --workspace -> cargo test --quiet --no-run
Doesn't seem to have a difference with `--workspace`
2023-11-23 21:55:41 +08:00
Boshen
78c6fcd1d0
feat(prettier): improve format of ExportDefaultDeclaration (#1520) 2023-11-23 21:52:56 +08:00
Wenzhe Wang
f4c89ce5a6
feat(prettier): implement DocBuidler trait for Printer and Prettier (#1519) 2023-11-23 21:48:13 +08:00
Dunqing
3758e6f6a5
feat(prettier): handle the logic inside the parentheses in BinaryExpression and LogicalExpression (#1516) 2023-11-23 18:32:25 +08:00
Shannon Rothe
0115314cf4
feat(ast/semantic): parse jsdoc on PropertyDefinition (#1517)
This should be enough to handle jsdoc comments on class
properties/fields.

See #1506
2023-11-23 18:30:14 +08:00
Dunqing
490a589ded
feat(prettier): print binarylish correctly in SwitchStatement (#1515) 2023-11-23 18:29:00 +08:00
Ken-HH24
ebf5cf8c82
feat(linter): heading-has-content for eslint-plugin-jsx-a11y (#1501)
Try to implement `heading-has-content` for #1141 .
2023-11-23 09:28:22 +00:00
Dunqing
635008a408
feat(prettier): support print empty switch (#1514) 2023-11-23 16:19:42 +08:00
Boshen
ef59f544b4
feat(prettier): handle binary in in for statement init (#1512) 2023-11-23 12:50:30 +08:00
Cameron
7930f90112
feat(linter): eslint-plugin-unicorn prefer-set-size (correctness) (#1508) 2023-11-23 11:03:25 +08:00
Cameron
0dd5ec1bcf
feat(linter): eslint-plugin-unicorn prefer-native-coercion-functions (pedantic) (#1507) 2023-11-23 10:59:19 +08:00
Dunqing
bec365e1b6
feat(prettier): support propagate breaks (#1511)
regression tests are the expected result
2023-11-23 10:44:41 +08:00
u9g
cac7c2eba8
chore(ast): document connection between TemplateLiteral's quasis & expression arrays (#1509) 2023-11-23 10:43:15 +08:00
Boshen
2d5e0d5d07
feat(prettier): handle parens for member expression inside new expression (#1505) 2023-11-22 16:22:49 +00:00
ubugeeei
8e923f1372
Initialize JS Regex crates and def AST. (#1500)
ref: https://github.com/oxc-project/oxc/issues/1164

I have initialized a crate for handling JavaScript Regexp and defined
the AST.
I implemented the AST while referring to
[eslint-community/regexpp](2e8f1af992/src/ast.ts).
2023-11-23 00:22:17 +08:00
Boshen
6410502cc6
refactor(prettier): rename file need_parens -> needs_parens (#1504) 2023-11-23 00:04:00 +08:00
Boshen
d3b7629b46
feat(prettier): handle parens for logical assignment expression (#1503) 2023-11-22 23:58:43 +08:00
Boshen
93c461a5b9
feat(prettier): format number in member expression (#1499) 2023-11-22 21:52:06 +08:00
Boshen
272f6d292d
fix(wasm): fix prettier crashing 2023-11-22 21:27:47 +08:00
Boshen
7af6d129cb
fix(wasm): turn off Parser::preserve_parens for the playground (#1498) 2023-11-22 19:45:26 +08:00
Boshen
567c6ed757
feat(prettier): print directives (#1497) 2023-11-22 19:39:25 +08:00
Boshen
cf803d379a
feat(prettier): add parens to ExportDefaultDeclaration (#1494) 2023-11-22 19:34:37 +08:00
JonaAnders
08164b0e18
refactor(parser) Updated comments mentioning the ecma specification section 12.x (#1496)
The ECMA specification seems to added the "Tokens" section to the
specification as 12.6. This pushed all the other sections down,
resulting in e.g. former 12.6 now being 12.7. Comments in the parser
mention this part of the specification. All the mentions of section
12.6+ therefor are outdated now. This pull request tries to fix that by
updating all the comments.
2023-11-22 19:29:04 +08:00
Dunqing
aa8656df0f
feat(task/prettier-confromance): escape template literal (#1493) 2023-11-22 15:30:59 +08:00