Commit Graph

77 Commits

Author SHA1 Message Date
magic-akari
daaa8b5c4a
fix(es/lints): Ignore TS module declare blocks (#5363) 2022-08-02 06:16:30 +00:00
Donny/강동윤
037a53d5d1
perf(es/ast): Use Atom in some places (#5271) 2022-07-22 20:09:25 +09:00
Austaras
c68d484305
fix(es/lints): Disallow duplicate export functions (#5234) 2022-07-17 10:09:29 +00:00
magic-akari
04de455a9a
fix(es/lints: Handle ts export import equals (#5225) 2022-07-17 05:04:37 +00:00
Artur
d0356489cb
feat(es/lints): Support ignoreReadBeforeAssign for prefer-const (#4933) 2022-07-17 04:07:05 +00:00
magic-akari
a0ec3705a4
fix(es/lints): Handle import-require duplicate bindings (#5131) 2022-07-07 04:06:37 +00:00
magic-akari
f952a6161c
feat(es/typescript): Follow TypeScript error report (#5114) 2022-07-05 22:08:55 +00:00
Austaras
bef8aebdea
fix(es/lints): Allow overload in typescript (#5116) 2022-07-06 01:33:58 +09:00
Austaras
9519e801ea
fix(es/resolver): Fix handling of block scoped functions (#5092) 2022-07-05 05:04:49 +00:00
magic-akari
f7d857c6b6
fix(es/lints): Cover more const-assign cases (#5098) 2022-07-03 17:13:55 +00:00
magic-akari
376c4e11af
feat(es/lints): Report an error for reassignment to import binding (#5033) 2022-06-28 05:06:57 +00:00
Austaras
4a422a09a4
fix(es/lints): Allow duplicate function in non-top level (#5011) 2022-06-21 13:22:23 +00:00
LongYinan
db9f7a5ad4
chore(ci): Fix publish build on Windows (#4970) 2022-06-14 15:58:10 +00:00
Artur
6daeeb0652
feat(es/lints): Add constructor-super rule (#4912) 2022-06-13 19:24:38 +00:00
Artur
286f265632
refactor(es/lints): Simplify no-empty-pattern rule (#4928) 2022-06-11 06:22:26 +00:00
Artur
b041f2911f
feat(es/lints): Add no-await-in-loop rule (#4936) 2022-06-11 05:00:32 +00:00
Artur
4fb932dd08
feat(es/lints): Add default-case-last rule (#4913) 2022-06-10 05:23:15 +00:00
Artur
9b226a7026
feat(es/lints): Implement no-sparse-arrays rule (#4652) 2022-05-14 06:10:49 +00:00
Artur
f45dd72033
feat(es/lints): Implement no-compare-neg-zero rule (#4643) 2022-05-12 20:19:18 +00:00
Donny/강동윤
6a97c7bef8
fix(es/utils): Fix wrong apis (#4604)
# API Changes

## `swc_ecma_utils`

### Renames

 - `find_ids` => `find_pat_ids`
 - `prepend` => `prepend_stmt`
 - `as_bool` => `cast_to_bool`
 - `as_number` => `as_pure_number`
 - `as_string` => `cast_to_string`
 - (`as_pure_bool`, `cast_to_number` is not renamed)
 - `UsageFinder` => `IdentUsageFinder`.
 - `IdentFinder` => `IdentRefFinder`.

## Changes

 - Re-export of `HANDLER` from `swc_common::errors` is removed. Use `swc_common::error::HANDLER` instead.
 - Re-export of `Id` from `swc_ecma_ast` is removed. Use `swc_ecma_ast::Id` instead.
 - `ExprCtx` is used for apis related to `Expr`.
 - `preserve_effects` is now a method of `ExprCtx`. It was a top-level function.
 - `extract_side_effects_to` is now a method of `ExprCtx`. It was a top-level function.
 - `IdentUsageFinder` (previously `UsageFinder`) now takes `Id` instead of `Ident`.
 - `IdentRefFinder` (previously `IdentFinder`) now takes `Id` instead of `Ident`.
 - `ExprExt::is_ident_ref_to` is removed.
 - `Expr::is_global_ref_to` is added.
 - `:🆔:id` is removed. Use `Ident::to_id()` instead.
2022-05-11 04:36:22 +00:00
Donny/강동윤
2c861bd9e5
feat(es/ast): Improve Id APIs (#4614)
# API Changes

 - `Ident` now has `to_id()`. This method is added to allow removing an import.
2022-05-11 12:02:14 +09:00
Artur
e65bf3d025
feat(es/lints): Implement prefer-const rule without options (#4584) 2022-05-10 10:40:46 +00:00
Donny/강동윤
7fc9bbccd9
feat(config): Make all configuration overridable (#4575) 2022-05-09 05:38:27 +00:00
Artur
17f237d3ba
feat(es/lints): Implement no-var (#4485) 2022-04-30 07:25:35 +00:00
Artur
3a8cade209
feat(es/lints): Implement no-throw-literal (#4477) 2022-04-29 07:46:17 +00:00
Donny/강동윤
53610fdafc
feat(es/resolver): Use different syntax context for unresolved refs (#4436)
- We don't need a list of bindings to check if an identifier is unresolved.
 - Checking if an identifier is unresolved is now one CPU instruction.
   - Previously it was one hashmap operation.
 - This PR also improves performance, by removing the hashmaps mentioned above.
2022-04-26 07:38:50 +00:00
那里好脏不可以
37a8c90750
chore(*): Typo + fomatting (#4304) 2022-04-11 18:45:58 +00:00
Austaras
e4a565c2d4
fix(es/lints): Check parameters in the duplicate binding rule (#4288) 2022-04-09 08:14:01 +00:00
Artur
a88d56ee08
feat(es/lints): Implement no-obj-calls rule (#4168) 2022-03-28 08:50:32 +00:00
Artur
2a9cb2d12a
refactor(es/lints): Use util for parens (#4167) 2022-03-28 08:20:46 +00:00
Artur
10851ece98
feat(es/lints): Implement symbol-description rule (#4161) 2022-03-26 06:49:57 +00:00
magic-akari
fce554cfb0
fix(es/lints): Ignore type-only imports while checking duplicates (#4163) 2022-03-26 15:25:17 +09:00
Artur
7a06c5b3d8
feat(es/lints): Remove source map accesses (#4147) 2022-03-24 17:07:18 +00:00
Artur
47712de0da
feat(es/lints): Implement no-param-reassign rule (#4134) 2022-03-24 10:27:26 +00:00
Donny/강동윤
0f92eda0c7
feat(es/lints): Improve error messages (#4142) 2022-03-24 02:15:03 +00:00
Artur
d8a988ef3d
feat(es/lints): Use Str.raw instead of source map (#4139) 2022-03-23 22:07:16 +00:00
Artur
dd862ba9f8
feat(es/lints): Implement use-isnan rule (#4080) 2022-03-21 11:35:10 +00:00
Artur
9ceefa734f
feat(es/lints): Implement valid-typeof rule (#4095) 2022-03-20 06:46:41 +00:00
Artur
b39e345d8e
feat(es/lints): Implement no-new-symbol rule (#4076) 2022-03-18 23:19:02 +09:00
Artur
833958bd74
feat(es/lints): Implement yoda rule (#3886) 2022-03-17 06:05:39 +00:00
Donny/강동윤
ba1c854fb1
fix(es/lints): Fix false-positive of duplicate-exports (#4041) 2022-03-16 04:20:45 +00:00
Donny/강동윤
f28134fe77
feat(es/lints): Mark catch params as binding patterns while checking duplicates (#3981) 2022-03-12 03:02:22 +00:00
Donny/강동윤
c6b5371c51
fix(es/lints): Don't visit types while collecting const (#3967) 2022-03-11 17:41:28 +09:00
magic-akari
579aeb7cfa
feat(es/lints): Refine error message (#3952) 2022-03-11 04:55:37 +00:00
magic-akari
0181fbe63b
feat(es/lints): Support module/script mode in duplicate_bindings (#3880)
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
2022-03-07 05:49:39 +00:00
Artur
3e8efacf3a
perf(es/lints): Extract top level bindings only if the rule is enabled (#3889) 2022-03-07 04:18:37 +00:00
magic-akari
d10e66285b
fix(es/lints): Ignore identifiers used as types while checking for duplicate bindings (#3869) 2022-03-06 02:29:21 +09:00
Artur
f6b4bbe47b
feat(es/lints): Implement radix rule (#3651) 2022-03-03 14:03:13 +09:00
Pig Fang
e252265a3f
feat(es/lints): Implement default-param-last rule (#3681) 2022-02-23 06:35:04 +00:00
Artur
319d501f17
feat(es/lints): Implement no-empty-function rule (#3565) 2022-02-22 12:13:13 +00:00