Yunfei He
5bf9dddaec
refactor(resolver): remove unnecessary RefCell ( #849 )
2023-09-04 13:27:22 +08:00
Wenzhe Wang
8588f8b9c6
chore(linter): downgrade category of expect-expect and no-alias-methods ( #848 )
...
There are too many errors(7000+) in vscode repo, so downgrade this rule.
And I think
[no-alias-methods](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md )
is also too strict when it is placed in [style
config](https://github.com/jest-community/eslint-plugin-jest/blob/main/README.md#style ),
so change it also.
2023-09-03 18:28:40 +08:00
Boshen
6706541049
refactor(linter): remove complicated linter service setup
2023-09-03 18:14:05 +08:00
Boshen
b9bd5ff7ab
refactor(cli): collect all the paths before linting
2023-09-03 16:36:02 +08:00
Boshen
deb50e1a25
chore(semantic): return Arc<ModuleRecord> from semantic
2023-09-03 15:41:11 +08:00
Boshen
91f4896247
refactor(linter): clean up Test a bit
2023-09-03 15:36:46 +08:00
Boshen
ba54eb67b3
chore(semantic): use Arc<ModuleRecord>
2023-09-03 15:29:00 +08:00
Boshen
aa7b665fe9
feat(resolver): add thiserror ( #847 )
2023-09-03 14:50:31 +08:00
Devin-Yeung
a969f69627
perf(linter): parse ts-directive manually ( #845 )
2023-09-03 14:13:16 +08:00
Boshen
93adc9b9c2
Release oxc v0.1.3
2023-09-03 12:22:05 +08:00
Boshen
37bf4c4421
Release oxc v0.1.2
2023-09-03 11:30:44 +08:00
Boshen
7bcf2d7c43
chore(oxc): add features for semantic, formatter and minifier
2023-09-03 11:28:20 +08:00
Boshen
6f270f1198
perf(linter): swap the order of checks for no_caller ( #844 )
2023-09-03 10:19:27 +08:00
Yunfei He
815db57a25
fix(semantic): symbol of identifier of top level function declaration should be in the root scope ( #843 )
...
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2023-09-03 10:16:47 +08:00
Boshen
d25355c9e8
perf(lexer): reduce an extra branch from peek ( #841 )
2023-09-03 00:02:42 +08:00
Boshen
53b094e46c
chore: clean up deps ( #840 )
2023-09-02 21:34:24 +08:00
Boshen
56aaf31fb1
refactor(benchmark): use codspeed for all benchmarks ( #839 )
2023-09-02 20:35:48 +08:00
Boshen
e4a3838ecb
chore(resolver): benchmark with codspeed ( #838 )
2023-09-02 18:27:37 +08:00
Boshen
6ed57532cd
fix(resolver): fix a case where ignored package has a fallback ( #837 )
2023-09-02 17:22:35 +08:00
Boshen
7f504961ec
fix(resolver): fix a case where an alias is part of a dashed package name ( #836 )
2023-09-02 16:37:07 +08:00
Boshen
9724365862
refactor(resolver): remove nodejs_resolver comparison
...
we no longer need to compare with nodejs_resolver
2023-09-02 15:12:26 +08:00
Boshen
bebdbfb9a6
feat(resolver): add tracing example
2023-09-02 15:12:25 +08:00
Boshen
d74da2f3bf
fix(resolver): fix cases with conflicting node_modules path ( #835 )
2023-09-02 14:45:10 +08:00
Wenzhe Wang
fa1d7da090
feat(linter): add eslint-plugin-jest/no-conditional-expect rule ( #832 )
...
port
[no-conditional-expect](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-expect.md )
2023-09-02 14:37:15 +08:00
Boshen
6ae6532245
fix(resolver): add test case for resolve_to_context ( #834 )
2023-09-02 12:03:07 +08:00
Boshen
47a076c226
feat(resolver): add an option to turn off builtin_modules ( #833 )
2023-09-02 11:38:03 +08:00
dependabot[bot]
8caf77300b
chore(deps): bump the dependencies group with 10 updates ( #831 )
2023-09-01 13:56:12 +08:00
Boshen
0921b733f7
deps: pin ezno-checker so dependabot can do its work
2023-09-01 12:18:05 +08:00
Boshen
693145107c
refactor(linter): less a global hashmap to reduce rule timer macro expansion ( #822 )
...
closes #819
2023-09-01 10:32:17 +08:00
Boshen
129191fc44
perf(resolver): stop descending into node_modules when possible ( #821 )
2023-09-01 10:18:59 +08:00
Boshen
777cc003a5
fix(resolver): resolve exports field that are directories ( #820 )
2023-08-31 16:10:03 +08:00
Boshen
92e7ecedc5
chore(linter): remove unmaintained typescript/isolated-declaration
2023-08-30 22:42:09 +08:00
Wenzhe Wang
7233aef0de
feat(linter): add eslint-plugin-jest/no_alias_method rule ( #818 )
...
port
[no_alias_method](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-alias-methods.md )
2023-08-30 22:38:01 +08:00
Boshen
e52157976f
fix(resolver): fix resolving package_self with the correct subpath
2023-08-30 19:05:33 +08:00
Boshen
c68bafe776
fix(resolver): correct behavior for enforceExtension
2023-08-30 18:28:07 +08:00
Boshen
589a4d6cd8
fix(resolver): do not resolve browser field that are strings ( #816 )
2023-08-30 14:00:59 +08:00
u9g
a38619b780
feat(vscode): Add linter plugin to vscode extension ( #813 )
2023-08-29 23:35:32 -04:00
Boshen
66e883ae8c
fix(resolver): make sure package name is valid when loading package self ( #810 )
2023-08-29 22:56:48 +08:00
u9g
05bb29a11e
feat(query): Add fields ( #807 )
...
```diff
+ Expression.or_value_at_declaration
+ Function.body
```
2023-08-28 13:56:05 +08:00
u9g
8f5cb4be8c
rename get_node_by_ident to get_declaration_of_variable ( #806 )
...
The previous function name wasn't really clear to me, I think this is
better.
2023-08-28 13:00:25 +08:00
EliLichtblau
6a9d57061c
TSTypeName change identifer name to identifier reference ( #804 )
...
When initially written types were not in the symbol table. Now that
types are in the symbol table it makes sense given
```ts
type A = 1
type B = A
```
that you can get to the symbol id for for A from type B = A.
Please correct me if I'm wrong about how I implemented this. I also
verified that occurrence (I believe this is the correct word) behaves
how I would expect.
```ts
type RecursiveType = string | {[x: string]: RecursiveType}
```
Does populate a reference.
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2023-08-28 11:42:21 +08:00
u9g
a44dde5303
feat(linter_plugin): Add linter plugin crate ( #798 )
...
Adds a `linter_plugin` crate which adds `oxc_query` support to any
`oxc_linter` consumers such as `oxc_cli` and `editor/vscode`
2023-08-28 11:40:00 +08:00
Wenzhe Wang
8b24052438
fix(linter): no-var-requires not warning if has bindings in ancestors ( #799 )
2023-08-28 11:24:17 +08:00
Boshen
dd7749f949
improve README ( #800 )
...
closes #686
Rendered: https://github.com/web-infra-dev/oxc/blob/readme/README.md
This is a refinement for the README, which should include information
for different interests: first time reader, explorer, rust crate / napi
user etc.
2023-08-27 22:36:17 +08:00
Wenzhe Wang
3721837e13
feat(linter): eslint-plugin-jest/expect-expect ( #802 )
...
Port [eslint-plugin-jest/expect-expect
](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/expect-expect.md )
2023-08-27 21:42:58 +08:00
Boshen
ed9e3e0774
refactor(linter): move the label message to help
2023-08-27 11:49:26 +08:00
Boshen
1f27426570
Release crates as v0.1.1
2023-08-26 17:53:11 +08:00
u9g
ad05e196cf
feat(query): Fix Spread typename ( #797 )
2023-08-26 10:50:21 +08:00
Boshen
c88823244e
fix(cli): correct ignore-pattern behavior; add more cli tests ( #796 )
2023-08-26 00:03:49 +08:00
Boshen
12798e075f
refactor: improve code coverage a little bit
2023-08-25 23:07:14 +08:00
Boshen
3d8ee2567f
feat(resolver): check for node.js core modules ( #794 )
2023-08-25 22:33:10 +08:00
Boshen
1bc1418ee6
feat(resolver): implement nested alias field ( #795 )
2023-08-25 22:32:57 +08:00
Boshen
4ee56576c7
feat(cli): add basic unit tests ( #793 )
2023-08-25 21:26:14 +08:00
Boshen
1b5ef7cdc8
refactor(cli): remove unused lint/error.rs ( #792 )
2023-08-25 16:46:26 +08:00
Boshen
592137586c
feat(cli): use insta_cmd for cli snapshot testing ( #791 )
...
closes #776
2023-08-25 16:26:34 +08:00
Boshen
33ea85813e
fix(linter): show the escaped span for no-useless-escape ( #790 )
...
closes #782
2023-08-25 15:21:17 +08:00
u9g
1c6b87b415
feat(query): Unify spread types, add ExpressionArrayElement, and ancestors is nullish now ( #788 )
...
```diff
- ArrayElementAST
- SpreadArrayElement
- SpreadArrayElementAST
- SpreadIntoObject
- SpreadIntoObjectAST
+ ExpressionArrayElement
+ ExpressionArrayElement implements HasSpan
+ ExpressionArrayElement implements ArrayElement
+ ExpressionArrayElement.expression
+ ExpressionArrayElementAST
+ ExpressionArrayElementAST implements ArrayElement
+ ExpressionArrayElementAST implements HasSpan
+ ExpressionArrayElementAST implements ExpressionArrayElement
+ Spread
+ Spread implements ObjectProperty
+ Spread implements ArrayElement
+ Spread implements HasSpan
+ Spread.expression
+ SpreadAST
+ SpreadAST implements ObjectProperty
+ SpreadAST implements HasSpan
+ SpreadAST implements ArrayElement
+ SpreadAST implements ASTNode
+ SpreadAST implements Spread
```
2023-08-25 13:29:06 +08:00
Boshen
ba8ef7bfc7
fix(deps): use one version of textwrap
2023-08-25 12:54:38 +08:00
u9g
e0a85eec01
feat(query): Add fields and new ArrayElement types ( #787 )
...
```diff
- Array.elements
+ Array.element
+ ElidedArrayElement
+ ElidedArrayElement implements ArrayElement
+ ElidedArrayElement implements HasSpan
+ ElidedArrayElementAST
+ ElidedArrayElementAST implements ArrayElement
+ ElidedArrayElementAST implements HasSpan
+ ElidedArrayElementAST implements ElidedArrayElement
+ SpreadArrayElement
+ SpreadArrayElement implements ArrayElement
+ SpreadArrayElement implements HasSpan
+ SpreadArrayElement.spread
+ SpreadArrayElementAST
+ SpreadArrayElementAST implements ArrayElement
+ SpreadArrayElementAST implements HasSpan
+ SpreadArrayElementAST implements SpreadArrayElement
+ VariableDeclarationAST.kind
```
2023-08-24 23:46:00 -04:00
u9g
741aa8df1f
feat(ast): Add to ChainExpression and ExpressionArrayElement to ASTKind ( #785 )
2023-08-25 03:03:53 +00:00
Wenzhe Wang
31d56698f7
refactor(linter): extract is_valid_jest_call ( #781 )
2023-08-24 23:05:03 +08:00
Boshen
2f0ff28f47
Rust 1.72.0 ( #784 )
2023-08-24 23:02:19 +08:00
Boshen
531e89a74a
Revert "fix(resolver): fix a case where package name and specifier is the wrong order"
...
This reverts commit caf1dfbfcd .
2023-08-24 22:03:30 +08:00
Boshen
a272c1ffe4
perf(lexer): reduce checks on ident -> keyword ( #783 )
2023-08-24 18:43:03 +08:00
Boshen
c8a215ea5e
perf(lexer): jump table ( #779 )
2023-08-24 15:02:06 +08:00
u9g
4f686b6a75
feat(query): add Paren*Expr* type and add index to Argument type and fix todo in ObjectExpr ( #780 )
...
```diff
+ Argument.index
+ ParenthesizedExpression
+ ParenthesizedExpression implements Expression
+ ParenthesizedExpression implements HasSpan
+ ParenthesizedExpression.expression
+ ParenthesizedExpressionAST
+ ParenthesizedExpressionAST implements Expression
+ ParenthesizedExpressionAST implements HasSpan
+ ParenthesizedExpressionAST implements ParenthesizedExpression
+ ParenthesizedExpressionAST implements ASTNode
```
2023-08-24 04:21:02 +00:00
Wenzhe Wang
fd2f8fb12b
feat(linter): detect import ( #778 )
...
Support test cases like
```js
import { test } from '@jest/globals';
test('something');
```
2023-08-24 11:34:15 +08:00
u9g
89d115704b
feat(query): Add types & Visit Array in AST for ArrayAST type ( #777 )
...
```diff
+ RegExpLiteral
+ RegExpLiteral implements HasSpan
+ RegExpLiteral implements Expression
+ RegExpLiteral.pattern
+ RegExpLiteralAST
+ RegExpLiteralAST implements ASTNode
+ RegExpLiteralAST implements RegExpLiteral
+ RegExpLiteralAST implements HasSpan
+ RegExpLiteralAST implements Expression
```
2023-08-23 09:27:49 -04:00
Maneren
b18a91312e
refactor loss-of-precision rule to remove the slow regex ( #775 )
...
This achieves around 2x speedup in the rule execution by using a manual
parser instead of a regex.
2023-08-23 11:16:05 +08:00
Makoto Tateno
9c50bc0b9c
feat(linter): implement no-unsafe-declaration-merging ( #748 )
...
Related to https://github.com/web-infra-dev/oxc/issues/503
Implement
https://typescript-eslint.io/rules/no-unsafe-declaration-merging/
2023-08-23 11:12:49 +08:00
u9g
2b1e535e6d
feat(query) add declaration field to VarRef ( #774 )
2023-08-22 00:18:32 -04:00
Boshen
29f8c02258
refactor(linter): clean up tester with fixes ( #773 )
2023-08-22 00:12:08 +08:00
Boshen
58d2d1e30d
fix(cli): fix a race condition where the program will hang
2023-08-21 16:21:19 +08:00
Boshen
6eca2adc66
fix(linter): change severity of no-obj-calls to warning
2023-08-21 11:54:36 +08:00
Boshen
dafdc95d81
chore(linter): add rule name to no-instanceof-array
2023-08-21 11:51:16 +08:00
Boshen
4032e4799c
fix(linter): improve error and help message on no-duplicate-enum-values
2023-08-21 11:51:15 +08:00
Boshen
a1c2fa65f7
fix(linter): improve help message on no-namespace
2023-08-21 11:51:15 +08:00
Boshen
cc862536f6
fix(cli): print timing after lint run
2023-08-21 11:51:15 +08:00
Boshen
03df8fcc68
refactor(cli): print the final result; fix plural on number of files
2023-08-21 11:51:15 +08:00
u9g
8e6f84c40d
feat(query): Add new types ( #770 )
...
```diff
+ Array
+ Array implements HasSpan
+ Array implements Expression
+ Array.elements
+ ArrayAST
+ ArrayAST implements Expression
+ ArrayAST implements ASTNode
+ ArrayAST implements HasSpan
+ ArrayAST implements Array
+ ArrayElement
+ ArrayElement implements HasSpan
+ ArrayElementAST
+ ArrayElementAST implements HasSpan
+ ArrayElementAST implements ASTNode
+ File.expression
+ StringLiteral
+ StringLiteral implements Expression
+ StringLiteral implements HasSpan
+ StringLiteralAST
+ StringLiteralAST implements Expression
+ StringLiteralAST implements ASTNode
+ StringLiteralAST implements HasSpan
+ StringLiteralAST implements StringLiteral
+ TemplateLiteral
+ TemplateLiteral implements HasSpan
+ TemplateLiteral implements Expression
+ TemplateLiteralAST
+ TemplateLiteralAST implements ASTNode
+ TemplateLiteralAST implements TemplateLiteral
+ TemplateLiteralAST implements Expression
+ TemplateLiteralAST implements HasSpan
```
2023-08-21 03:50:05 +00:00
Boshen
de7735dc1d
fix(cli): fix race condition when resolving paths
2023-08-20 23:13:00 +08:00
Boshen
e5d7618457
fix(linter): reduce the span of no-namespace to the keyword
2023-08-20 18:19:18 +08:00
Boshen
77bc9135f0
fix(linter): no-extra-boolean-cast false positive
2023-08-20 16:28:42 +08:00
Boshen
e44b6b3eee
chore(linter): demote no_undef to nursery
2023-08-20 15:53:36 +08:00
Boshen
a7a834a3f7
fix(linter): fix some race conditions
2023-08-20 15:53:20 +08:00
Boshen
5152b39b17
chore: clean up Cargo.toml with cargo machete ( #767 )
2023-08-20 15:29:09 +08:00
Boshen
a9a6bb800c
refactor(cli,linter): move path processing logic from cli to linter ( #766 )
2023-08-20 15:12:08 +08:00
u9g
3b3babed2e
feat(query): Add types and add field to Argument ( #765 )
...
```diff
+ Argument.is_spread
+ DoWhileStatement
+ DoWhileStatement implements HasSpan
+ DoWhileStatement implements Statement
+ DoWhileStatement.body
+ DoWhileStatement.condition
+ DoWhileStatementAST
+ DoWhileStatementAST implements HasSpan
+ DoWhileStatementAST implements Statement
+ DoWhileStatementAST implements DoWhileStatement
+ DoWhileStatementAST implements ASTNode
+ ForStatement
+ ForStatement implements HasSpan
+ ForStatement implements Statement
+ ForStatement.body
+ ForStatement.step
+ ForStatement.condition
+ ForStatementAST
+ ForStatementAST implements HasSpan
+ ForStatementAST implements Statement
+ ForStatementAST implements ASTNode
+ ForStatementAST implements ForStatement
+ New
+ New implements Expression
+ New implements HasSpan
+ New.callee
+ New.argument
+ NewAST
+ NewAST implements Expression
+ NewAST implements HasSpan
+ NewAST implements New
+ NewAST implements ASTNode
+ TernaryExpression
+ TernaryExpression implements HasSpan
+ TernaryExpression implements Expression
+ TernaryExpression.condition
+ TernaryExpression.if_true
+ TernaryExpression.if_false
+ TernaryExpressionAST
+ TernaryExpressionAST implements TernaryExpression
+ TernaryExpressionAST implements HasSpan
+ TernaryExpressionAST implements ASTNode
+ TernaryExpressionAST implements Expression
+ Throw
+ Throw implements HasSpan
+ Throw implements Expression
+ Throw.to_throw
+ ThrowAST
+ ThrowAST implements HasSpan
+ ThrowAST implements Throw
+ ThrowAST implements ASTNode
+ ThrowAST implements Expression
```
2023-08-20 14:54:25 +08:00
Boshen
324acfccc8
refactor(cli,linter): move the lint runner from cli to linter ( #764 )
2023-08-20 00:59:49 +08:00
Boshen
275124068b
refactor(cli,diagnostics): implement DiagnosticService ( #762 )
2023-08-19 18:18:09 +08:00
Yunfei He
e7c2313817
feat(ast): add SymbolId and ReferenceId ( #755 )
...
Closes #510
2023-08-19 18:09:47 +08:00
u9g
fd3fa6ca84
feat(query): Add some new types ( #761 )
...
```diff
+ BlockStatement
+ BlockStatement implements HasSpan
+ BlockStatement implements Statement
+ BlockStatement.statement
+ BlockStatementAST
+ BlockStatementAST implements BlockStatement
+ BlockStatementAST implements Statement
+ BlockStatementAST implements ASTNode
+ BlockStatementAST implements HasSpan
+ ExpressionStatement
+ ExpressionStatement implements HasSpan
+ ExpressionStatement implements Statement
+ ExpressionStatement.expression
+ ExpressionStatementAST
+ ExpressionStatementAST implements HasSpan
+ ExpressionStatementAST implements ExpressionStatement
+ ExpressionStatementAST implements ASTNode
+ ExpressionStatementAST implements Statement
+ VarRef
+ VarRef implements HasSpan
+ VarRef implements Expression
+ VarRef.name
+ VarRefAST
+ VarRefAST implements HasSpan
+ VarRefAST implements Expression
+ VarRefAST implements VarRef
+ VarRefAST implements ASTNode
+ WhileStatement
+ WhileStatement implements Statement
+ WhileStatement implements HasSpan
+ WhileStatement.condition
+ WhileStatement.body
+ WhileStatementAST
+ WhileStatementAST implements ASTNode
+ WhileStatementAST implements Statement
+ WhileStatementAST implements WhileStatement
+ WhileStatementAST implements HasSpan
```
2023-08-19 16:15:22 +08:00
Boshen
1fdce7e517
refactor(cli): split out group options ( #760 )
2023-08-19 12:09:35 +08:00
Boshen
6f1daa67b2
refactor(cli): clean up lint and cli options ( #759 )
2023-08-19 00:06:12 +08:00
Boshen
5bcd736ae9
fix(cli): correctly parse clippy like filters "-A rule -D rule" ( #758 )
2023-08-18 22:00:05 +08:00
Boshen
772f71f191
refactor(cli): add WalkOptions for walk logic ( #757 )
2023-08-18 18:09:11 +08:00
Boshen
a9c4fddb6d
refactor(cli): use bpaf instead clap ( #756 )
2023-08-18 17:14:06 +08:00
u9g
61bf583333
feat(query): New types added ( #754 )
...
```diff
+ LogicalExpression
+ LogicalExpression implements HasSpan
+ LogicalExpression implements Expression
+ LogicalExpression.operator
+ LogicalExpression.left
+ LogicalExpression.right
+ LogicalExpressionAST
+ LogicalExpressionAST implements LogicalExpression
+ LogicalExpressionAST implements ASTNode
+ LogicalExpressionAST implements Expression
+ LogicalExpressionAST implements HasSpan
+ Parameter implements HasSpan
+ UnaryExpression
+ UnaryExpression implements HasSpan
+ UnaryExpression implements Expression
+ UnaryExpression.operator
+ UnaryExpression.value
+ UnaryExpressionAST
+ UnaryExpressionAST implements ASTNode
+ UnaryExpressionAST implements Expression
+ UnaryExpressionAST implements HasSpan
+ UnaryExpressionAST implements UnaryExpression
```
2023-08-18 00:04:52 -04:00
Boshen
3110490f36
refactor(cli,linter): move LintOptions from cli to linter ( #753 )
...
This also simplifies the Runner trait.
2023-08-17 22:28:34 +08:00
阿良仔
5a73f0e1b5
feat(formatter): add EndOfLine ( #747 )
2023-08-17 19:04:23 +08:00
Kei Sakamoto
2fde2255f9
feat(linter): implement eslint-plugin-unicorn/no-instanceof-array ( #752 )
...
implement
[eslint-plugin-unicorn/no-instanceof-array](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md ).
Related issue: #684
2023-08-17 17:08:03 +08:00
Boshen
6ab4ce0a6b
feat(resolver): implement tsconfig-paths ( #750 )
...
This PR includes 3 core functinalies of tsconfig-paths:
* matching tsconfig.compilerOptions.paths
* use tsconfig.compilerOptions.baseUrl
* extend tsconfig with tsconfig.extends
This PR does not include tsconfig.references
2023-08-17 16:24:46 +08:00
Boshen
9fa52fa61c
chore: run just fmt
2023-08-17 14:58:59 +08:00
u9g
b346a9ad6d
feat(query): New types and new fields for existing types ( #746 )
...
```diff
+ Argument.value
+ Argument implements HasSpan
+ ArgumentAST
- FnCall.arguments
+ FnCall.argument
- FnCallAST.arguments
+ FnCallAST.argument
+ interface Function
+ Function.is_async
+ Function.is_generator
+ Function.parameter
+ Function implements Expression
+ Function implements HasSpan
+ Parameter
+ Parameter.is_readonly
+ Parameter.assignment
+ Parameter.type_annotation
+ Parameter implements HasSpan
+ ParameterAST
+ ArrowFunction implements Function
+ ArrowFunction implements Expression
+ ArrowFunctionAST implements Function
+ ArrowFunctionAST implements Expression
+ FnDeclaration implements Function
+ FnDeclaration implements Expression
+ FnDeclarationAST implements Function
+ FnDeclarationAST implements Expression
```
2023-08-16 00:56:43 -04:00
Lqxc
f4d16c2166
fix(linter): perf @eslint/no-shadow-restricted-names check ( #617 ) ( #743 )
...
In previous implements, when facing "undefined = <expr>", the lint will
search all nodes to check if undefined was declared. In this
implementation, the lint will only run once and check all nodes.
2023-08-16 12:24:52 +08:00
Wenzhe Wang
3022655965
feat(linter): add no-commented-out-tests ( #723 )
...
port
[no-commented-out-tests](e894f51a0d/docs/rules/no-commented-out-tests.md )
2023-08-16 12:23:46 +08:00
Yunfei He
ec85fd8b7d
fix(eslint/no-obj-calls): should resolve non-global binding correctly ( #745 )
...
Fixes #744
2023-08-15 18:37:40 +08:00
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
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
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
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
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
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
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