Commit graph

1217 commits

Author SHA1 Message Date
Boshen
b2db6f7ef1
chore(benchmark): remove the measurement_time 2023-08-24 14:31:19 +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
Boshen
28544e1d59
deps: bump deps per security advice for rustls-webpki
rustls-webpki: CPU denial of service in certificate path building
2023-08-23 11:16:58 +08: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
c3560856cb
fix(website): convert utf8 <> utf16 span for correct unicode hover display (#772)
closes #426
closes #749

This fixes the unicode 16 issue but I'm not sure if this is the correct
solution.
2023-08-21 23:57:39 +08:00
Boshen
1851a8ae26
deps(rust): bump dependencies (#771)
generated with `cargo upgrade -i` then `cargo update`
2023-08-21 18:04:29 +08:00
Boshen
50ea72afe6
Release oxidation-compiler v0.2.3 2023-08-21 16:49:33 +08:00
Boshen
f9636242df
Release oxlint v0.0.10 2023-08-21 16:25:01 +08:00
Boshen
58d2d1e30d
fix(cli): fix a race condition where the program will hang 2023-08-21 16:21:19 +08:00
Boshen
773b77922e
ci: add write permission for creating releases 2023-08-21 15:54:37 +08:00
Boshen
bd830598b6
Release oxlint v0.0.9 with npm provernance 2023-08-21 15:40:56 +08:00
Boshen
877c92856a
Release oxidation-compiler 0.2.2 2023-08-21 15:26:09 +08:00
Boshen
4a1fdc1728
Release oxidation-compiler 0.2.1 2023-08-21 15:22:52 +08:00
Boshen
e14dd065f7
fix(npm): add package.repository and other fields according to provernance 2023-08-21 15:21:10 +08:00
Boshen
1a1fc3c99c
Release oxidation-compiler 0.2.1 2023-08-21 15:07:08 +08:00
Boshen
f7d26759c2
fix(npm): fix github link according to provernance 2023-08-21 15:04:33 +08:00
Boshen
3297c22cb1
Release oxidation-compiler 0.2.1 2023-08-21 14:47:39 +08:00
Boshen
9a20902dac
ci: add "id-token" permission for publishing project provenance 2023-08-21 14:47:10 +08:00
Boshen
6d23488ce4
Release oxidation-compiler 0.2.1 2023-08-21 14:28:17 +08:00
Boshen
3c375c413e
ci: use node v18 for npm project provenance 2023-08-21 14:27:02 +08:00
Boshen
be64f5240d
Release oxidation-compiler 0.2.0 2023-08-21 12:31:39 +08:00
Boshen
0c51b6cac9
chore: add publish to npm with project provenance 2023-08-21 12:25:51 +08:00
Boshen
bfe3e9a507
Release oxlint v0.0.8 2023-08-21 12:19:29 +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
EYHN
1781318f44
fix(rulegen): handle join('\n') style test code (#763)
# 1. Support join('\n')

I'm trying to run `just new-rule no-unexpected-multiline`, It found
rulegen not support test code pieced together using `array.json("\n")`,
like

```js
{
  code: [
      "const x = aaaa<",
      "  test",
      ">/*",
      "test",
      "*/`foo`"
  ].join("\n")
}
```

I found this kind of code widely in the eslint codebase, so it will be
great if we can support this.


![](https://github.com/web-infra-dev/oxc/assets/13579374/195ed4ba-1efb-4c3f-9e49-0ebdb5527506)

# 2. remove extra `,`

And I found when meet unsupported code, rulegen will generate an extra
`,`, so I added a filter at


45cf5fc3da/tasks/rulegen/src/main.rs (L363)

# 3. handle escape string

The escape `/` and trailing `/` in the javascript code will break
rulegen. example: `"\"abc\\\n(123)\""`

I made the following changes:

```diff
- test_code.replace('\n', "\n\t\t\t")
+ test_code.replace('\n', "\n\t\t\t").replace('\\', "\\\\").replace('\"', "\\\"")
```
2023-08-19 23:19:51 +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