Commit graph

1153 commits

Author SHA1 Message Date
u9g
5dc69ea4ec
feat(query): Add many types (#742) 2023-08-15 03:30:59 -04:00
Devin-Yeung
607fa6a2a4
feat(linter): implement typescript-eslint/ban-ts-comment (#741)
related to #503, marked as nursery(though all tests pass) since we use
rust `regex` crate to parse the regex, may have compatibility problems
with ECMA regex.
2023-08-15 13:32:41 +08:00
Devin-Yeung
c0b06a5700
feat(rulegen): automatically detect proxy (#740)
detect `HTTP_PROXY/HTTPS_PROXY/ALL_PROXY` environments automatically,
since visiting https://raw.githubusercontent.com sometimes need proxy,
upstream PR
[algesten/ureq#649](https://github.com/algesten/ureq/pull/649)
2023-08-15 13:32:09 +08:00
Sg
fae9a7c28b
feat(formatter): add "Quote Props" option (#652)
For #634. 



This PR prepares for the fix of #634, adding an option to formatter to
control whether to quote object properties. After this PR, the rulegen
script can use oxc-formatter to output JSON-like object literal.

The `Quote Props` option is from Prettier. For detail:
https://prettier.io/docs/en/options.html#quote-props

> Change when properties in objects are quoted.
> Valid options:
> "as-needed" - Only add quotes around object properties where required.
> "consistent" - If at least one property in an object requires quotes,
quote all properties.
> "preserve" - Respect the input use of quotes in object properties.

---------

Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2023-08-15 11:40:38 +08:00
Boshen
b466de522b
fix(ast_lower): remove wrong usage of SymbolFlags::Function (#680)
closes #678

SymbolFlags::Function means something else (the whole function
declaration stored as a anonymous symbol) in TypeScript
2023-08-15 11:37:50 +08:00
Boshen
4fa6aafa3e
feat(resolver): handle path alias with # (#739)
`#` can be:

* an actual path fragment `path#fragment`
* esm import module specifier `#import-path`
* part of a path `path/to/#/fragment`
* part of path alias `#` -> `./path/alias`

This is driving me crazy.
2023-08-14 15:04:09 +08:00
Boshen
7c3e29d421
feat(resolver): expose raw package_json value; improve print debug (#738) 2023-08-14 11:57:17 +08:00
u9g
99a7ad4319
feat(query): add FnCall and Argument types (#737) 2023-08-14 10:25:03 +08:00
Devin-Yeung
a041fbd96b
fix(rulegen): import thiserror correctly (#735)
close #734
2023-08-14 10:20:25 +08:00
Boshen
f6e3b654b1
feat(resolver): implement configurable exports_fields option (#733) 2023-08-14 10:18:57 +08:00
u9g
087abd3cf1
feat(query): Add Reassignment type and add str property to span (#731) 2023-08-13 22:18:41 +08:00
u9g
5e9927745e
feat(website): Improve autocomplete (#730) 2023-08-13 15:31:22 +08:00
Lqxc
6f00461c9d
feat(linter): implement @eslint/no-shadow-restricted-names (#617) (#728)
related issue: #617
2023-08-12 23:58:13 +08:00
Kei Sakamoto
4f5e4c1bac
feat(linter): implement @typescript-eslint/no-duplicate-enum-values (#726)
implement
[@typescript-eslint/no-duplicate-enum-values](https://typescript-eslint.io/rules/no-duplicate-enum-values)
Related issue: #503.
2023-08-12 23:55:26 +08:00
Boshen
37efbd7af3
feat(resolver): resolve # as path instead of a fragment (#727) 2023-08-12 23:51:37 +08:00
Boshen
629055cfce
deps(rust): bump dependencies 2023-08-12 16:48:24 +08:00
Wenzhe Wang
0c645170a8
feat(linter): valid-describe-callback(eslint-plugin-jest) (#706) 2023-08-12 16:47:49 +08:00
u9g
9566378119
feat(query): add many types to oxc_query (#724)
Adds `Name(AST)?`, `IfStatementAST`, `SpreadIntoObject(AST)?`,
`ObjectEntry(AST)?`, `DotProperty(AST)?` types

Fixes `ObjectLiteral`'s value field's output type

Added `entry` field to `ObjectLiteral(AST)?`
2023-08-12 16:43:58 +08:00
u9g
7daab49ca5
feat(website): fix highlighting edgecase in codemirror theme (#725)
Problem described here:
https://discuss.codemirror.net/t/basicsetup-breaks-cursor-highlighting/6964/5
2023-08-12 16:41:58 +08:00
Boshen
9935eb1259 feat(resolver): pass on query string from alias fields 2023-08-11 19:46:57 +08:00
Boshen
17e525cc0f feat(resolver): complete browser_field implementation 2023-08-11 19:46:57 +08:00
Boshen
fdf288c685
refactor: improve code coverage in various places (#721) 2023-08-11 15:17:49 +08:00
u9g
c6ed90900c
feat(query): Add name to class (#720) 2023-08-11 14:36:40 +08:00
u9g
f48db3f85e
fix(website): return early on failed highlight range (#719) 2023-08-11 05:55:58 +00:00
u9g
97c5cd379e
feat(query): Add right to VariableDeclaration (#718) 2023-08-11 05:40:35 +00:00
u9g
9c05866cc1
feat(query): add NumberLiteral type (#717) 2023-08-11 05:37:29 +00:00
u9g
c7fc1d99b5
feat(query): add name to interface (#716) 2023-08-11 05:22:12 +00:00
u9g
a953a96529
fix(query): make ObjectLiteralAST implement ObjectLiteral (#715) 2023-08-11 05:15:22 +00:00
Boshen
8c7109b24e
feat(resolver): check for infinite recursion (#714) 2023-08-11 12:53:42 +08:00
u9g
99a4816ce7
feat(website): add query playground (#698) 2023-08-11 10:53:21 +08:00
Boshen
17a6f63c31
refactor(resolver): remove the leading dot trim on extensions 2023-08-10 21:05:48 +08:00
Boshen
11954326b3 feat(resolver): implement main_fields 2023-08-10 19:48:30 +08:00
Boshen
f717cb02e3 feat(resolver): add exports_fields and main_fields for logging purposes. 2023-08-10 19:48:30 +08:00
Boshen
caf1dfbfcd fix(resolver): fix a case where package name and specifier is the wrong order 2023-08-10 19:48:30 +08:00
Boshen
66c9d764d1 fix(resolver): add a case with multi-dot filename 2023-08-10 19:48:30 +08:00
Boshen
8ae345bde0
chore(parser): add an AST Send example (#712)
relates #709

The allocator and lifetime gets in the way if we want to parse in
parallel but process them in a single thread.

This example uses `ouroboros` to provide a safe API for working with
this unsafe behavior.
2023-08-10 15:56:31 +08:00
Kei Sakamoto
3adca1ce08
feat(linter): implement @typescript-eslint/prefer-as-const (#707)
implement @typescript-eslint/prefer-as-const
Related issue: #503.
2023-08-10 15:48:24 +08:00
Boshen
2f48bdf26f
fix(parser,semantic): make semantic own Trivias (#711)
closes #708

Making the parser return Rc<Trivias> is not a good API, and ideally
`Semantic` should just own `Trivias` so it can process or mutate it.
2023-08-10 15:30:32 +08:00
Boshen
9714e46a02
feat(resolver): add tracing (#710) 2023-08-10 13:51:28 +08:00
Boshen
909d037f0d
refactor(resolver): clean up some code and tests 2023-08-09 23:21:03 +08:00
Alexandr Metreniuc
f8358a148a
feat(linter): @typescript-eslint/no-namespace (#703) 2023-08-09 23:02:24 +08:00
Boshen
17acbc4e02
fix(resolver): add derive to serde 2023-08-09 21:53:19 +08:00
Boshen
08a9ba3d5e
refactor(resolver): clean up the tests a little bit 2023-08-09 21:21:56 +08:00
Boshen
fdded5e97c
refactor(resolver): remove the identity-hash crate 2023-08-09 19:01:26 +08:00
Boshen
341c678b2f
fix(resolver): fix a case with multi-dot file extensions (#704) 2023-08-09 18:31:17 +08:00
Boshen
09761b4f8b
refactor(resolver): add a EnforceExtension tri state 2023-08-09 16:49:34 +08:00
Boshen
7c5ff9e27d
refactor(resolver): make Resolution::full_path not owned 2023-08-09 16:03:07 +08:00
Boshen
91fd375a3b
refactor(resolver): return package json error immediately instead of saving it (#702)
The error is propagated so there is no need to save it.
2023-08-09 14:28:44 +08:00
Boshen
89b49bdb07
doc(ast): document why Directive.directive is a raw string 2023-08-09 14:06:25 +08:00
Yunfei He
35167599bc
refactor(ast): use atom for Directive and Hashbang (#701)
The main reason is using Atom to remove the lifetime for convenience.

And after removing the lifetime of these nodes, the `Program<'a>`
doesn't rely on `&'a source` anymore, which allows us to [specify more
accurate
lifetimes](https://github.com/web-infra-dev/oxc/discussions/700).
2023-08-09 13:52:56 +08:00