Commit graph

820 commits

Author SHA1 Message Date
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