Commit graph

5445 commits

Author SHA1 Message Date
Wenzhe Wang
48385f48b4
fix: skip early error check for ts definition (#219) 2023-03-28 11:45:32 +08:00
yangchenye
88cd82b698
feat(macros): property generate declarations for nested modules (#212) 2023-03-27 10:30:47 +08:00
Boshen
31ec78bd8b
chore(linter): update snapshots 2023-03-26 22:24:39 +08:00
Boshen
a0cccf09f6
feat(diagnostics): bold warnings 2023-03-26 22:23:06 +08:00
Boshen
cda0c69ba1
fix(linter): change severity to warning for no_debugger and no_empty_pattern 2023-03-26 22:03:46 +08:00
Boshen
8a9cf9bed1
fix(linter): fix some checks on isolated_declaration
* check return type on AssignmentPattern
* do not check on return type of Constructor and Getter
2023-03-26 22:02:04 +08:00
Boshen
9487b3958e
feat(diagnostic): change termwidth and with_cause_chain on GraphicalReportHandler 2023-03-26 21:35:42 +08:00
Boshen
b65e8397de
feat(diagnostics): change color displays
related #203
2023-03-26 21:20:54 +08:00
Boshen
366dc3037a
feat(diagnostics): port miette GraphicalReportHandler for further tuning 2023-03-26 20:20:53 +08:00
Boshen
90f043fe66
feat(linter): improve target span and message on isolated_declaration 2023-03-26 19:55:01 +08:00
yangchenye
929b0efebb
feat(linter): implement isolated_declaration (#209)
* feat(linter): implement isolated_declaration

* Implement check for class elements

* Set up Export SymbolFlag and store declaration AST in Symbol

* Fix tests and comments
2023-03-26 04:37:10 -07:00
Boshen
ef19895cc3
feat(cli): add -A all -D isolated-declarations (#211)
* feat(linter): add restriction category for lint rules

* feat(cli): add "--allow" and "--deny" commands

* feat(linter): use a single instance of linter

* feat(cli): derive rules from args

* feat(cli): print number of rules
2023-03-26 04:34:31 -07:00
Boshen
d095d45818
refactor(semantic): add source_text and trivias to semantic 2023-03-25 14:19:53 +08:00
yangchenye
5ae3f5e007
feat(linter): implement eslint(no-class-assign) (#204) 2023-03-24 11:23:39 +08:00
Boshen
5939f817f0
refactor(linter): use the Span::new constructor instead of Span {} 2023-03-23 20:30:02 +08:00
RiESAEX
55ba093a85
feat(linter): implement validTypeof rule (#202) 2023-03-23 18:32:02 +08:00
Xuan
71e575ab41
feat(linter): implement no-new-symbol rule (#201) 2023-03-23 18:29:57 +08:00
yangchenye
0d8d67b593
feat(linter): implement eslint(no-const-assign) (#199)
* feat(linter): implement eslint(no-const-assign)

* feat(semantics & linter): resolve symbols

* Use run_on_symbol

* Add resolved_reference to SymbolTable
2023-03-23 12:55:40 +08:00
Boshen
9dfd4cd936
chore(rust): remove unnecessary missing_const_for_fn 2023-03-22 12:35:52 +08:00
Boshen
ff9a2c3ab0
feat(linter): eslint disable comments (#196)
feat(linter): eslint disable comments

closes #100
closes #170
2023-03-22 11:27:42 +08:00
yangchenye
2bb40844d2
fix(linter): skip abstract methods for dupe member check (#198) 2023-03-22 10:08:03 +08:00
yangchenye
3487772644
feat(linter): implement eslint(no-dupe-class-members) (#195) 2023-03-21 12:43:23 +08:00
Boshen
f52770d08a
chore(oxc_wasm): remove unnecessary lines from .gitignore 2023-03-20 14:38:09 +08:00
Boshen
b6a7c5bba9
fix(cli): remove extra source_text clone before linting 2023-03-19 12:58:00 +08:00
yangchenye
4549fb3cdd
fix(parser): parse decorator with separate grammar (#192) 2023-03-19 11:35:59 +08:00
Boshen
d134c1d89a
refactor(oxc_cli): clean up code around spawning tasks 2023-03-19 11:32:46 +08:00
Boshen
ea7ae1011f
chore(cli): removed unused glob dependency 2023-03-19 10:35:55 +08:00
Boshen
c20f60c289
feat(cli): add ignore_pattern to walker 2023-03-18 18:24:04 +08:00
Boshen
89542be81e
feat(cli): use a single walker for all paths 2023-03-18 17:58:42 +08:00
Boshen
5135118bc8
refactor(cli): move lint command and options into modules 2023-03-18 17:53:06 +08:00
Boshen
0ec5f0b111
refactor(cli): cleanup command 2023-03-18 15:48:45 +08:00
Boshen
37c7b7a752
refactor(oxc_parser): simply diagnostic messages 2023-03-18 14:39:44 +08:00
Boshen
14babe92a0
refactor(oxc_parser): remove unused diagnostics 2023-03-18 14:05:29 +08:00
Boshen
237e063d37
fix(rust): fix clippy warnings 2023-03-17 15:47:03 +08:00
Boshen
6a89f085b7
refactor(rust): add more clippy restriction rules 2023-03-17 14:51:25 +08:00
Boshen
a1315e3999
refactor(rust): add clippy::clone_on_ref_ptr 2023-03-17 14:51:25 +08:00
Boshen
57f3065d68
refactor: remove unused #[allow(clippy:..)] 2023-03-17 13:28:06 +08:00
Boshen
678cfae967
feat(cli, linter): propage --fix option and apply fixes
closes #68
2023-03-17 13:01:04 +08:00
Boshen
bee548b945
fix(coverage): correct the number on AST Parsed 2023-03-17 11:15:33 +08:00
Boshen
9ed682a38e
fix(semantic): fix function redeclaration errors
The problem here we face here is that TypeScript does not consider Annex
B.3.2, which makes implementation a bit more difficult.

This implementation conforms to test262.
2023-03-17 10:06:02 +08:00
Boshen
5b2474600f
fix(cli): should return semantic errors 2023-03-17 09:43:53 +08:00
yangchenye
37ad6f3a15
feat(parser): support decorators in class expression (#190)
feat(parser): support decorator in class expression
2023-03-17 09:33:04 +08:00
Boshen
164c2831e1 feat(linter): report export errors in javascript 2023-03-15 18:12:34 -07:00
Boshen
8d3a5c46ba feat(ast,semantic): add ModuleRecord 2023-03-15 18:12:34 -07:00
Boshen
26efbbe59c
chore(deps): bump insta 2023-03-15 21:31:08 +08:00
Xuan
ed0c4b1ea3
feat(linter): add no-dupe-keys rule (#188)
* feat(linter): add no-dupe-keys rule

* refactor(linter): use map.insert

* fix(linter): fix the comment
2023-03-15 16:23:42 +08:00
Boshen
d1c04523b6
feat(oxc_ast): add VisitMut trait
closes #184
2023-03-15 13:35:54 +08:00
yangchenye
aaaefc8ba5
feat(linter): implement eslint(no-unsafe-negation) (#186) 2023-03-15 11:36:56 +08:00
yangchenye
74c731c415
feat(linter): Implement eslint(no-compare-neg-zero) (#185) 2023-03-15 10:44:11 +08:00
magic-akari
867f879483
feat(linter): no-async-promise-executor (#180)
* feat(linter): no-async-promise-executor

* fix: cargo lint

* fix: prefer `get_inner_expression`

* chore: update

* fix: use precise span
2023-03-15 10:31:08 +08:00
Boshen
b5af93575f
deps: update dependencies (#183) 2023-03-15 10:30:12 +08:00
Xuan
fca882085f
feat(linter): add no-duplicate-case rule (#179) 2023-03-14 16:55:04 +08:00
Xuan
5d3a52c1bb
feat(linter): add no-caller rule (#178)
* feat(linter): add no-caller rule

* fix(linter): add help message
2023-03-14 12:45:02 +08:00
Boshen
ee31f5cc6f
feat(linter): check duplicated bound names in ImportDeclaration 2023-03-14 10:42:18 +08:00
Boshen
89f28e9f93
feat(linter): check module in javascript and skip in typescript 2023-03-14 08:53:16 +08:00
Boshen
7b1a7d47b6
feat(linter): check await in ClassStaticBlock in javascript 2023-03-14 08:08:24 +08:00
Boshen
297ce2743f
Revert "feat(linter): check await in class static block"
This reverts commit 7add71c9dd.
2023-03-14 07:56:04 +08:00
Boshen
7add71c9dd
feat(linter): check await in class static block 2023-03-14 07:46:11 +08:00
Boshen
78bd76e8d0
feat(parser): check function name for await and yield 2023-03-14 07:39:07 +08:00
Boshen
c706d1825d
feat(semantic): turn on strict mode in semantic builder 2023-03-14 00:30:22 +08:00
Boshen
76118e4901
feat(linter): check NewTarget in javascript 2023-03-14 00:05:37 +08:00
Boshen
39795dbb1b
feat(linter): check ArrayPattern in javascript 2023-03-13 23:52:36 +08:00
Boshen
76f7e58036
feat(linter): check FormalParameter in javascript 2023-03-13 23:43:31 +08:00
Boshen
f4c8cb2cde
feat(linter): check FunctionDeclaration in javascript 2023-03-13 23:35:42 +08:00
Boshen
2fe8fba5b6
refactor(lexer): make TokenValue 8 bytes smaller by changing RegExp.pattern to &'a str (#175) 2023-03-13 23:20:52 +08:00
Boshen
5381fd0cf8
feat(linter): check Directive in javascript 2023-03-13 23:19:35 +08:00
Boshen
7269d32346
feat(linter): check FormalParameters in javascript 2023-03-13 23:12:42 +08:00
Boshen
040e41240b
feat(linter): check AwaitExpression and YieldExpression in javascript 2023-03-13 13:45:49 +08:00
Boshen
f36e3301fd
refactor(lexer): change TokenValue::String(Atom) to TokenValue::String(&str) (#174) 2023-03-13 09:33:44 +08:00
Boshen
fce6e1ec73
feat(parser): check YieldExpression 2023-03-12 23:41:27 +08:00
Boshen
88fd0a05ec
feat(parser): check AwaitExpression 2023-03-12 23:37:21 +08:00
Boshen
d6e8c6fb2f
feat(parser): check ReturnStatement in return context 2023-03-12 23:30:32 +08:00
Boshen
84eaa0b7e3
feat(linter): check eval and arguments in JavaScript 2023-03-12 23:25:57 +08:00
Boshen
93b06e948a
feat(ast_parser): check await and yield identifier error 2023-03-12 23:22:10 +08:00
Boshen
605684f4c0
fix: fix clippy warnings 2023-03-12 21:53:08 +08:00
Boshen
66207e74a4
refactor(lexer): remove LexerContext::JsxChild (#172) 2023-03-12 20:19:51 +08:00
Boshen
b3fcb3a4e8
fix(cli): lint_path should panic with proper error message 2023-03-12 13:16:20 +08:00
Boshen
449856e875
feat(cli): print number of cpus cores 2023-03-12 13:13:09 +08:00
Boshen
7c6e1e0df9
feat(cli): do not print errors on files that looks like a minified file 2023-03-12 12:59:37 +08:00
Boshen
d8ff7ab022
fix(cli): exit 1 when number_of_diagnostics > 0 2023-03-12 12:45:05 +08:00
Shannon Rothe
901f4948c1
refactor(parser): move import specifier parsing to list.rs (#167) 2023-03-12 10:45:02 +08:00
Boshen
1b93d83ff7
chore(oxc_parser): setup fuzzer
closes #155
2023-03-12 00:44:42 +08:00
Boshen
d2f42c20cd
feat(cli): print all parser / semantic / linter diagnostics 2023-03-12 00:04:01 +08:00
Boshen
c2f760f1ed
chore: run `types -w" to fix all typos 2023-03-11 23:37:19 +08:00
Boshen
d490ca7b31
chore(rust): bump deps 2023-03-11 23:26:45 +08:00
Boshen
7caaa04903
feat(cli): ignore files with min suffix 2023-03-11 23:02:38 +08:00
Boshen
99dbf8e946
feat(linter): use only correctness rules for now 2023-03-11 22:36:58 +08:00
Boshen
4585f11da3
chore(linter): enable the correctness rules that I want for alpha release 2023-03-11 22:18:11 +08:00
Boshen
00f4962669
chore(linter): enable no_constant_binary_expression
is_reference_to_global_variable should just return true for builtin types.
2023-03-11 21:40:40 +08:00
Boshen
b1e01d0774
feat(linter): check top level ModuleDeclaration 2023-03-11 21:09:03 +08:00
Boshen
5c2fea7702
feat(linter): check SwitchStatement in javascript 2023-03-11 20:26:50 +08:00
Boshen
021345173f
feat(linter): check expressions in javascript 2023-03-11 20:18:20 +08:00
Boshen
403682960f
feat(linter): check ForStatementLeft in javascript 2023-03-11 19:12:29 +08:00
Boshen
f22539e93f
feat(linter): check property 2023-03-11 19:12:28 +08:00
Boshen
82ef1f2944
feat(linter): check Super in javascript 2023-03-11 18:48:34 +08:00
Boshen
6c28948faf
feat(linter): check duplicate constructor in javascript 2023-03-11 18:34:05 +08:00
Xuan
9f3952cca3
feat(linter): add no_self_compare (#152) 2023-03-11 18:15:44 +08:00
Boshen
d5075a95e9
fix(linter): diagnostics should not print quotes 2023-03-11 17:44:27 +08:00
Boshen
a5f00e8e1c
refactor(oxc_ast): remove unnecessary SourceTypeBuilder 2023-03-11 16:21:14 +08:00
Boshen
f6bb7e90e7 fix(semantic): fix symbol_size test 2023-03-10 23:28:51 -08:00
Boshen
58e2741ec9 feat(semantic): bind Function name 2023-03-10 23:28:51 -08:00
Boshen
995e7c1767 feat(linter): bind CatchVariable 2023-03-10 23:28:51 -08:00
Boshen
34c0599db8 feat(semantic): bind FormalParameters 2023-03-10 23:28:51 -08:00
Boshen
323bb9a2b6 feat(semantic): bind VariableDeclarator 2023-03-10 23:28:51 -08:00
Boshen
b1e802cecc feat(semantic): bind Class 2023-03-10 23:28:51 -08:00
Boshen
5c8670d1c8 feat(semantic): declare symbol and reference Identifier 2023-03-10 23:28:51 -08:00
Boshen
1c24875067 feat(semantic): add basic symbol table 2023-03-10 23:28:51 -08:00
Boshen
2ee0b40656 chore: fix clippy warnings 2023-03-10 11:09:44 -08:00
Boshen
722a1c4df2
fix(ast): fix Serialization on ImportOrExportKind 2023-03-11 01:16:27 +08:00
yangchenye
1530b2695f
feat(oxc_linter): implement eslint(use-isnan) (#161) 2023-03-10 08:32:00 +08:00
Boshen
29c1ab9e59 chore: temporary ignore test for no_constant_binary_expression (unfinished) 2023-03-09 04:42:09 -08:00
Boshen
6acb08f054 feat(linter): implement no_constant_binary_expression 2023-03-09 04:42:09 -08:00
Boshen
5b8bdaabab
feat(linter): check IdentifierReference in javascript 2023-03-09 20:20:58 +08:00
Boshen
185acc49bd feat(linter): check BindingIdentifier in javascript 2023-03-09 01:27:14 -08:00
Boshen
4ea7ac373d feat(linter): check Identifier in javascript 2023-03-09 01:27:14 -08:00
Boshen
4a582f0487 feat(linter): check WithStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
0fb8887d3c feat(linter): check LabeledStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
26387c0660 feat(linter): check ContinueStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
3e842667b1 feat(linter): check BreakStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
735b1241c4 feat(linter): check StringLiteral in javascript 2023-03-09 01:27:14 -08:00
Boshen
ed161cc38e feat(linter): check PrivateIdentifier in javascript 2023-03-09 01:27:14 -08:00
Boshen
44675e8cd8 feat(coverage): add always_strict mode for test262 2023-03-09 01:27:14 -08:00
Boshen
f13640e1c2 feat(linter): check NumberLiteral in javascript 2023-03-09 01:27:14 -08:00
Boshen
4e0d785b25 feat(linter): add infrastructure for handling early errors 2023-03-09 01:27:14 -08:00
Yoni Feng
8f26b9932a
perf(semantic): use faster indextree building (#122) 2023-03-09 17:20:41 +08:00
yangchenye
1ea463e0bb
feat(oxc_linter): implement eslint(no-mixed-operators) (#145) 2023-03-09 00:05:44 +08:00
Boshen
e1971577cb
fix(oxc_macros): fix clippy warnings 2023-03-08 23:35:34 +08:00
Boshen
94fdd54368
perf(lexer): fine tune identifier checking with less redundant branches (#154)
perf(lexer): fine tune checking of identifiers with less redundant branches
2023-03-08 22:00:15 +08:00
Domon
be2231b689
fix: fix wasm-pack build crash (#156) 2023-03-08 19:00:40 +08:00
Xuan
158a79eba5
refactor(fixer): add span to message (#146)
* refactor(fixer): add span to message

* refactor(fixer): use error.labels() to sort

* fix(fixer): make clippy happy

* refactor(fixer): use sort_by_cached_key
2023-03-08 15:36:05 +08:00
Amit Dahan
2687d7868f
refactor(linter): add declare_all_lint_rules proc macro (#121) 2023-03-07 07:39:38 -08:00
Boshen
4d32bfb55e
refactor: remove all declarations of const fn, which is useless for us 2023-03-07 21:29:47 +08:00
Shannon Rothe
11237f3cbd
feat(linter): implement eslint(constructor-super) (#126) 2023-03-07 18:22:58 +08:00
Boshen
6b9bbaa091
perf(lexer): try &static Atom for match_keyword (#143)
* perf(lexer): try phf_map for `match_keyword`

* wip
2023-03-07 13:14:22 +08:00
Shannon Rothe
2423257573
feat(linter): implement eslint(eqeqeq) rule (#124)
* feat(linter): implement `eslint(eqeqeq)` rule

* chore: improve comment

* better errors

* regenerate snapshots

* add nursery lint category
2023-03-07 06:26:41 +08:00
Shannon Rothe
b3dfb0ab51
chore(linter): remove extra spacing (#141) 2023-03-07 06:25:14 +08:00
Boshen
d4a10e3fac fix(linter): fix clippy warning 2023-03-06 06:29:18 -08:00
Boshen
c8e968f35d perf(ast): shrink some struct sizes
relates #138
2023-03-06 06:29:18 -08:00
Xuan
d833672023
test(fixer): remove BOM testing (#137) 2023-03-06 18:50:21 +08:00
Boshen
c5dea20e1d
fix(oxc_wasm): remove wee_alloc dependency; fix profile warning 2023-03-06 14:50:02 +08:00
Domon
24d327c40d
feat(wasm): add wasm to oxc (#130) 2023-03-06 14:13:06 +08:00
yangchenye
500f42b134
feat(oxc_linter): implement eslint(for-direction) (#136)
feat(oxc_linter): implement eslint(for-direction)
2023-03-06 13:49:18 +08:00
Boshen
683778dfe2
feat(semantic): implement scopes (#135)
closes #119
2023-03-05 07:43:32 -08:00
Shannon Rothe
d6b52167d3
feat(linter): implement rule categories (#131) 2023-03-05 04:14:24 -08:00
Fnll
81760da7cc
feat(parser): better diagnostic for missing semicolon in for loop statement (#133)
feat(parser): better diagnostic

Co-authored-by: kerui.lian <kerui.lian@bytedance.com>
2023-03-05 04:13:23 -08:00
Boshen
0a9ab3ed4c
feat(cli): print miette diagnostics with 4 spaces indentation 2023-03-05 15:19:59 +08:00
Boshen
94fddffc70
chore: use fancy-no-backtrace from miette
See https://github.com/zkat/miette/issues/132
2023-03-05 15:16:26 +08:00
Boshen
7d3ce8b125
feat(benchmark): add semantic builder to benchmark (#129) 2023-03-04 23:09:19 -08:00
Shannon Rothe
b9be065c8c
feat(cli): introduce pretty errors (#111) 2023-03-04 20:40:07 -08:00
Boshen
35cb007b76
chore(ast): fix clippy warnings 2023-03-05 11:12:59 +08:00
Boshen
0a2cd5b1f5
chore(ast): document the Span type
closes #109
2023-03-05 11:11:41 +08:00
Boshen
5106d2d63d
fix(cli): fix clippy warning 2023-03-05 11:04:43 +08:00
Xuan
ee569ae684
feat(oxc_linter): implement rule fixing logic (#114)
* refactor(oxc_linter): add FixResult

* refactor(oxc_linter): pass closure instead of an struct

* test(oxc_linter): uncomment tests
2023-03-04 18:57:50 -08:00
Boshen
e71de0bff6 perf(cli): lint files while walking directories 2023-03-04 04:38:58 -08:00
Boshen
88735e2a94 perf(cli): turn on simd-accel for ignore because globs are being used 2023-03-04 04:38:58 -08:00
Boshen
e73f0b3ebe chore(cli): turn off unused default_features of git2 2023-03-04 04:38:58 -08:00
Boshen
aa773f0aa8 perf(cli): do not follow symlinks in ignore because it is a slow syscall 2023-03-04 04:38:58 -08:00
Boshen
331a258182
feat(linter): implement uninvoked-array-callback (#112)
* feat(linter): implement uninvoked-array-callback

closes #98

Co-authored-by: Shannon Rothe <shannon.michael.rothe@gmail.com>
2023-03-04 00:04:04 -08:00
Shannon Rothe
f8b8f045a9
feat(cli): filter out uncommitted files (#110) 2023-03-03 22:42:22 -08:00
Yoni Feng
dcfdce5bb7
refactor(lexer): avoid copying of self in SIMD functions (#104) 2023-03-03 21:46:55 -08:00
Xuan
91c01633d6
test(oxc_linter): add testing for code fixer (#101)
---------

Co-authored-by: Shannon Rothe <shannon.michael.rothe@gmail.com>
2023-03-03 21:37:25 -08:00
Amit Dahan
50f133f9a6
feat(cli): Print lint duration (#105) 2023-03-03 18:34:30 -08:00
Boshen
47c1e7ef51
feat(cli): print diagnostics with file name (#103)
This also speeds up printing when a file has lots diagnostics.
This is done by allocating only once compared to multiple times from before.
2023-03-03 08:43:13 -08:00
magic-akari
b4ee8c0dc3
feat(linter): no-empty-pattern (fix) 2023-03-03 17:53:51 +08:00
magic-akari
85de06eae7
feat(linter): no-empty-pattern (#74)
* feat(linter): no-empty-pattern

* chore(linter/no-empty-pattern): update docs and examples

* chore: fix typo
2023-03-03 17:53:00 +08:00
Shannon Rothe
92b232372f
feat(linter): implement autofix (#94)
* feat(linter): implement autofix

* remove `fs::write`
2023-03-03 17:12:47 +08:00
Shannon Rothe
77d6edbe72 feat(cli): use BufWriter for diagnostic printing 2023-03-02 21:59:42 -08:00
Ye Yangchen
b06ab627bf fix(oxc_parser) correct span for decorators 2023-03-02 21:34:24 -08:00
Boshen
6a191ddce2
chore(cli): fix clippy warnings 2023-03-03 10:41:34 +08:00
Pascal Schilp
679cd0bf32
feat(cli): parallelize diagnostics (#93)
feat(cli): parallelize printing of diagnostics
2023-03-02 07:28:45 -08:00
Shannon Rothe
27b82bda36
feat(cli): implement --max-warnings CLI option (#77)
* implement `--max-warnings` CLI option

* implement `--max-warnings` CLI option

* review comments

* remove `.vscode/`

* revert loop + add tests
2023-03-02 16:16:03 +08:00
Xuan
51d0ced5a0 feat(oxc_cli): support no-ignore 2023-03-01 23:54:11 -08:00
Shannon Rothe
6647752e03
refactor(ast): change Option<Vec> to Vec for decorators (#84)
* remove `Option<Vec>` from `FormalParameter`

* `unwrap` -> `unwrap_or_else`

* prefer `AstBuilder` helper

* implement `consume_decorators`
2023-03-02 15:52:46 +08:00
Ye Yangchen
d8c6caf57f feat(oxc_parser): Parse modifiers before declaration 2023-03-01 22:50:23 -08:00
Shannon Rothe
143edeb62f prepend TS error code 2023-03-01 20:47:52 -08:00
Shannon Rothe
df78044c87 lint 2023-03-01 20:47:52 -08:00
Shannon Rothe
bc6a6d50ea remove TODO 2023-03-01 20:47:52 -08:00
Shannon Rothe
4d894e7db1 parser: prevent JSX expressions using comma operator 2023-03-01 20:47:52 -08:00
Yoni Feigelson
9b5c170c19 refactor(linter) Generate rule name with declare_oxc_lint 2023-03-01 06:50:36 -08:00
Xuan
298e956d0d feat(oxc_cli): support ignore-path 2023-03-01 04:39:18 -08:00
Shannon Rothe
0992a4930c printer: support JSXElement/JSXFragment 2023-03-01 02:34:23 -08:00
Yoni Feigelson
f859ee0e38 feat(linter): declare_oxc_lint proc_macro 2023-02-28 18:05:45 -08:00
Xuan
c2fb3613bd feat(oxc_cli): support ignore-pattern 2023-02-28 08:38:33 -08:00
Amit Dahan
3b53e0ba4e feat(linter): no-array-constructor 2023-02-27 08:12:28 -08:00
Boshen
3b887dbeaf feat(parser): print json in parser example 2023-02-28 00:05:54 +08:00
Boshen
665e8723c0 refactor(ast): remove acorn feature
This is a left over from where I tried to be compatible with estree,
but the implementation deviated from estree.
2023-02-27 23:44:13 +08:00
thepassle
33e5f8dd8d feat(cli): support --quiet flag for lint command 2023-02-27 07:43:00 -08:00
Boshen
9d4367c2cd refactor(linter): s/from_json/from_configuration 2023-02-27 12:31:57 +08:00
Boshen
8b9ebcd6e5 feat(linter): read rule configuration from json 2023-02-27 12:31:57 +08:00
Boshen
b4a5f13fb6 feat(linter): make no-empty configure from json 2023-02-27 12:31:57 +08:00
Boshen
5c64b4874c feat(linter): configure rules from json 2023-02-27 12:31:57 +08:00
Boshen
a342a01c4a feat(linter): add rule name and make the Tester test via rule names 2023-02-27 12:31:57 +08:00
Boshen
73ea3d6361 feat(ast,lexer,linter): save and check comments 2023-02-27 12:31:57 +08:00
Boshen
f3ca02f596 feat(linter): access parent of ast nodes 2023-02-27 12:31:57 +08:00
Boshen
f72c96270e feat(linter): no-empty 2023-02-27 12:31:57 +08:00
Ye Yangchen
0bf8f817f5 feat(oxc_parser): Port isStartOfDeclaration form tsc 2023-02-27 12:27:44 +08:00
Xuan
6b43cbbe71 fix(oxc_parser): support export type with star symbol 2023-02-27 12:26:23 +08:00
Xuan
b6d09643e5 fix(oxc_parser): check access correctly 2023-02-27 03:10:02 +08:00
Amit Dahan
e2207b9b15 feat(cli): support linting glob patterns 2023-02-26 22:25:16 +08:00
Boshen
78de22a3af refactor(cli): clean up and report total number of diagnostics 2023-02-26 02:02:05 +08:00
Boshen
915518b614 refactor(oxc_diagnostics): s/PError/Error 2023-02-26 02:02:05 +08:00
thepassle
eaeafa0a82 feat(cli): exit codes
chore: remove foo.js

chore: review comments

chore: shut clippy up

chore: ran cargo fmt

chore: unnecessary return
2023-02-26 01:32:17 +08:00
Boshen
4f36f7d2ef
ci: attempt to fix miri with "-Zmiri-disable-isolation" 2023-02-26 00:49:19 +08:00
Boshen
4c2e57224b
ci: ignore miri for insta 2023-02-26 00:00:04 +08:00
Boshen
28916f96af feat(linter): setup tests 2023-02-25 23:45:03 +08:00
Boshen
f17bd87f65
fix: try disable miri with custom allocators 2023-02-25 21:04:52 +08:00
Boshen
bf76f6d8b6
chore: ignore miri on global allocators
error: unsupported operation: can't call foreign function `_rjem_malloc` on OS `linux`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13
    |
104 |             ffi::malloc(layout.size())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `_rjem_malloc` on OS `linux`
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
    = note: BACKTRACE:
    = note: inside `<jemallocator::Jemalloc as std::alloc::GlobalAlloc>::alloc` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13: 104:39
note: inside `_::__rg_alloc`
   --> tasks/benchmark/src/main.rs:13:16
    |
12  | #[global_allocator]
    | ------------------- in this procedural macro expansion
13  | static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
    |                ^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
2023-02-25 20:45:38 +08:00
Boshen
636a974686
feat(benchmark): setup hyperfine benchmark
closes #25
2023-02-25 18:58:31 +08:00
Boshen
c86cca37a8 feat(linter): linter prototype 2023-02-25 16:56:10 +08:00
Boshen
abb2f8c949 feat(rust): use mimalloc on windows 2023-02-25 11:58:57 +08:00
Boshen
5f7a756229 feat(semantic): add semantic builder with untyped ast tree creation 2023-02-25 10:32:48 +08:00
Boshen
0de5020d07
fix(ast): s/span/node in visit 2023-02-25 10:21:23 +08:00
Boshen
9f3a8c12a9 feat(cli): initialize cli and directory traversal 2023-02-24 22:46:56 +08:00
Xuan
457e85b4a0 fix(oxc_parser): check ambiguous for await 2023-02-24 12:46:59 +08:00
Boshen
4684118c9e
fix: change example names so their binary names don't collide with each other 2023-02-23 21:46:39 +08:00
Xuan
65e81ce12c fix(oxc_parser): eat decorator for export 2023-02-23 12:28:34 +08:00
Boshen
4f4a9802b7 refactor(diagnostics,parser): move diagnostics to parser 2023-02-22 19:23:01 +08:00
Boshen
7a44a657e1 feat: add miette fancy report to examples 2023-02-22 19:23:01 +08:00
Boshen
5390d3e6b4 refactor(diagnostic): change Err type to miette::Error
This is the prerequisite for breaking up the large Diagnostic enum.
2023-02-22 11:08:21 +08:00
Boshen
4c6407b152 refactor(ast): s/node/span
This corrects the jargon for span. The term `node` came from `estree`,
which is a bit misleading here in Rust.

closes #9
2023-02-21 19:17:49 +08:00
Boshen
f3a7d5a026 feat(ast): add RegExpFlags bitflag for storing regex flags
This reduces `TokenValue` from 56 to 40 bytes, `Token` from 72 to 56 bytes.
2023-02-21 18:22:15 +08:00
Boshen
a733856536 refactor(ast,parser): use u32 for node spans
The next PR will fix the jargon where Node = Span.

relates to #9
2023-02-21 16:02:23 +08:00
Boshen
39a05030d7 refactor(ast,parser): box FormalParameters 2023-02-21 13:11:58 +08:00
Boshen
d57ab2f088 refactor(ast,parser): remove Node::ctx
This is adding too many bytes to the AST
2023-02-21 13:11:58 +08:00
Boshen
c640b4fb08 perf(ast): box PropertyKey enum 2023-02-21 13:11:58 +08:00
Boshen
cf278a2760 perf(parser): a few micro optimizations 2023-02-21 13:11:58 +08:00
Boshen
0bbbc7768f perf(oxc_parser): use u8 for offset 2023-02-21 13:11:58 +08:00
Boshen
73663f274c perf(parser): inline all methods on Context 2023-02-21 13:11:58 +08:00
Boshen
83c3f34af2 feat(lexer): use portable-SIMD to speed up multiline comment scanning 2023-02-20 21:58:08 +08:00
Boshen
4fc112f7dc feat(ast): add visitor 2023-02-20 20:45:14 +08:00
Boshen
ab68cea0b7 perf(lexer): use portable-SIMD to speed up whitespace scanning
closes #13
2023-02-20 19:03:15 +08:00
Boshen
457aa7d1be feat(printer): add printer example 2023-02-20 18:23:36 +08:00
Boshen
e4b07b7db9 feat(printer): Initialize printer
closes #21
2023-02-20 18:23:36 +08:00
Xuan
362c02f8e1 docs(oxc_parser): add header symbol for parser.unexpected 2023-02-18 09:06:56 +08:00
Boshen
a347e3993e
Revert "perf(lexer): use portable-SIMD to speed up multiline comment scanning"
This reverts commit a51c7f9ba2.
2023-02-17 14:50:42 +08:00
Boshen
a51c7f9ba2 perf(lexer): use portable-SIMD to speed up multiline comment scanning 2023-02-15 19:51:13 -08:00
Boshen
85955d7147
refactor(parser): clean up some lexer code 2023-02-12 21:34:19 +08:00
Boshen
d8fd23524a
feat(oxc_parser): allow filename as option in examples/simple.rs 2023-02-12 15:57:40 +08:00
Boshen
3daf5bcea9
chore(example): add an example for testing purposes 2023-02-12 11:11:35 +08:00
Boshen
a339ba3f92 feat(coverage): print parsing conformance for test262 (currently 100%) 2023-02-11 08:02:42 -08:00
Boshen
1fdc635638 feat(parser): add parser 2023-02-11 05:26:49 -08:00
Boshen
62a4f2b551 feat(ast): add ast 2023-02-11 04:27:34 -08:00
Boshen
4ae70b9592 feat(parser): add lexer 2023-02-11 02:29:54 -08:00
Boshen
664c37631e feat(allocator): add allocator 2023-02-11 01:05:07 -08:00
Boshen
d026e33343 chore: add rust-toolchain.toml and Cargo.toml 2023-02-11 13:03:40 +08:00