Dunqing
a743d06207
perf(semantic): just need to find the AstKind::FormalParameter in is_in_formal_parameters ( #1852 )
...
A bit of performance improvement
<img width="894" alt="image"
src="https://github.com/oxc-project/oxc/assets/29533304/ed687532-df83-4bd8-a893-059e41c8adf3 ">
2023-12-29 12:18:59 +08:00
Dunqing
0e0f25872f
perf(semantic): reduce calls to span() ( #1851 )
2023-12-29 03:40:53 +00:00
overlookmotel
19577709db
Remove redundant code from lexer ( #1850 )
...
Just removes a couple of lines of redundant code from the lexer.
A note on the 2nd one:
```rs
let mut builder = AutoCow::new(lexer);
let c = lexer.consume_char();
builder.push_matching(c);
```
`push_matching()` is a no-op unless
`force_allocation_without_current_ascii_char()` has already been called.
Here the `AutoCow` has just been freshly created, so we know it hasn't.
2023-12-29 10:07:21 +08:00
Cameron
1f3f21d722
feat(linter) eslint plugin unicorn: prefer modern math apis ( #1620 )
2023-12-28 22:04:47 +08:00
Cameron
dda3c69d7a
feat(linter) deepscan: bad object literal comparison ( #1844 )
2023-12-28 21:54:36 +08:00
Cameron
00ba96ae1a
feat(linter) oxc: erasing op ( #1834 )
2023-12-28 09:26:12 +00:00
msdlisper
040278aa50
refactor(linter): extract common code ( #1848 )
...
extract common code
2023-12-28 14:43:47 +08:00
Dunqing
497a0b8462
refactor(semantic): rename add_node_id to add_current_node_id_to_current_scope ( #1847 )
...
https://github.com/oxc-project/oxc/pull/1826#discussion_r1437074750
2023-12-28 13:05:25 +08:00
Dunqing
9c9d882d93
fix(semantic): remove duplicate errors in ModuleDeclaration::ImportDeclaration ( #1846 )
...
<img width="653" alt="image"
src="https://github.com/oxc-project/oxc/assets/29533304/7a3ca98e-6c6e-4170-8b79-e9c63b6b9153 ">
2023-12-28 10:44:53 +08:00
msdlisper
4c1673c2ca
feat(linter): use settings for eslint-plugin-jsx-a11y/html_has_lang ( #1843 )
...
Use eslint configuration settings e.g. defining a custom component `components` for eslint-plugin-jsx-a11y/html_has_lang rule
2023-12-27 19:30:25 +00:00
Dunqing
b9bdf361e6
feat(semantic): improve check super implementation, reduce access nodes ( #1827 )
...
This improves the performance at which we can check that super is in a non-class.
2023-12-27 22:36:28 +08:00
Cameron
736803173b
feat(linter) oxc: only used in recursion ( #1833 )
...
Inspired by https://rust-lang.github.io/rust-clippy/master/#/only_used_in_recursion
Examples from VSCode Repo
<img width="1495" alt="Screenshot 2023-12-26 at 20 29 23" src="https://github.com/oxc-project/oxc/assets/18101008/77c14f22-112e-4423-8025-3729118a2632 ">
2023-12-27 22:32:26 +08:00
Dunqing
f7b7f0a512
feat(semantic): support get node id by scope id ( #1826 )
...
This is useful when we want to get the ast node that corresponds to the current scope.
2023-12-27 22:30:28 +08:00
Cameron
ea8a59b6bc
feat(linter) oxc: misrefactored assign op ( #1832 )
...
based on c9a43b18f1/clippy_lints/src/operators/misrefactored_assign_op.rs
2023-12-27 22:27:31 +08:00
Dunqing
f45a3cc2fa
feat(linter): support eslint/no-unused-private-class-members rule ( #1820 )
2023-12-27 22:24:12 +08:00
IWANABETHATGUY
de2f834774
chore: rename crate oxc_vscode to oxc_language_server ( #1825 )
...
1. Closed https://github.com/oxc-project/oxc/issues/1821
2023-12-26 23:01:12 +08:00
poteboy
0db2b84e24
refactor(linter): Simplify Parent Node Access in MediaHasCaption Rule ( #1829 )
...
This PR refactors the `MediaHasCaption` rule implementation, following
the suggestion in [#1822
(comment)](https://github.com/oxc-project/oxc/pull/1822#discussion_r1436430441 ).
The primary change involves simplifying the way the parent node is
accessed within the rule.
2023-12-26 14:25:03 +00:00
Dunqing
d63c50a5ca
refactor(semantic): improve check private identifier implementation ( #1794 )
...
The regression case in typescript is as expected since we don't
currently store `AccessorProperty` in `ClassTable`.
The following code is one of those cases
```ts
class C1 {
accessor #a: any;
accessor #b = 1;
static accessor #c: any;
static accessor #d = 2;
constructor() {
this.#a = 3;
this.#b = 4;
}
static {
this.#c = 5;
this.#d = 6;
}
}
```
But there was an error
```shell
Expect to Parse: "conformance/classes/propertyMemberDeclarations/autoAccessor2.ts"
× Private field 'a' must be declared in an enclosing class
╭─[conformance/classes/propertyMemberDeclarations/autoAccessor2.ts:9:1]
9 │ constructor() {
10 │ this.#a = 3;
· ──
11 │ this.#b = 4;
╰────
```
Let's leave it alone for now. Because of the `AccessorProperty` I
haven't seen it in any repo.
2023-12-26 20:39:22 +08:00
poteboy
98895cad60
feat(linter): eslint-plugin-jsx-a11y media-has-caption ( #1822 )
...
Implemented
[eslint-plugin-jsx-a11y/media-has-caption](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md )
as part of #1141
- Ensures that every `<audio>` and `<video>` element in JSX has a
corresponding `<track kind="captions" />` element.
- If an `<audio>` or `<video>` element is muted (muted attribute
present), the rule does not require a `<track>` child element.
- When configuration or root settings map components to HTML elements,
the function `get_mapped_element_name` is utilized to determine the
correct element name.
2023-12-26 12:19:08 +00:00
Tapan Prakash
0280e06f59
feat(linter): Refine test for no-distracting-elements ( #1824 )
...
Added support for component settings for eslint-plugin-jsx-a11y
no-distracting-elements rule based on
https://github.com/oxc-project/oxc/pull/1668 PR.
Updated the test cases.
2023-12-26 12:15:37 +00:00
IWANABETHATGUY
c1bac34c76
fix(lsp): make the server available in nvim-lspconfig ( #1823 )
...
1. It seems that nvim-lspconfig diagnostics handler require **version**
of **document**, now we can use
`oxc_vscode` language server in neomvin with
[nvim-lspconfig](https://github.com/neovim/nvim-lspconfig )

2023-12-26 16:37:25 +08:00
Cameron
7be3b1eec6
feat(linter) eslint plugin react: button has type ( #1785 )
2023-12-26 15:57:53 +08:00
msdlisper
f0ad356108
feat(linter): refine jsx-a11y settings ( #1816 )
...
refine jsx-a11y settings for #1141
2023-12-26 15:55:52 +08:00
Cameron
7d9d920148
feat(linter) oxc: approx constant ( #1818 )
...
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2023-12-26 12:19:44 +08:00
Cameron
ce851bb9a5
feat(linter) handle more cases for const-comparisons ( #1817 )
...
closes #1711
2023-12-26 10:25:26 +08:00
Dunqing
ca04312130
feat(semantic): add ClassTable ( #1793 )
2023-12-25 23:59:35 +08:00
IWANABETHATGUY
bd11b02cac
chore: better diagnostic when config is not a json file ( #1813 )
...
1. Closed https://github.com/oxc-project/oxc/pull/1804
2023-12-25 22:50:13 +08:00
msdlisper
d984d59e68
feat(linter): eslint-plugin-jsx-a11y lang ( #1812 )
...
lang linter for #1141
2023-12-25 18:36:55 +08:00
Boshen
601153fe8f
refactor(benchmark): use more complicated files ( #1811 )
...
closes #1806
---------
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2023-12-25 17:27:02 +08:00
Boshen
c59508675d
chore(linter): remove the implementation from constructor_super
...
This should be implemented by a CFG
2023-12-25 15:37:49 +08:00
dependabot[bot]
868c35451d
chore(deps): bump the dependencies group with 5 updates ( #1808 )
2023-12-25 15:17:47 +08:00
秦宇航
ae27a8d1e6
feat(transformer): add partial support for babel-plugin-transform-instanceof ( #1802 )
2023-12-25 15:06:41 +08:00
Boshen
a1accdca7f
Release oxlint and vscode extension v0.0.22
2023-12-25 13:12:07 +08:00
Boshen
b4138aa657
feat(linter): change double-comparisons to correctness
2023-12-25 13:06:40 +08:00
Dunqing
d41e3fd268
feat(ast): enter/leave ClassBody and PrivateInExpression ( #1792 )
2023-12-25 10:52:21 +08:00
overlookmotel
1feec95a94
fix(parser) fix typo in expecting_directives variable name ( #1801 )
...
Renamves `expecting_diretives ` to `expecting_directives` to fix spelling
2023-12-24 16:51:02 +00:00
poteboy
32413f58ad
feat(linter): eslint-plugin-jsx-a11y aria-props ( #1797 )
...
Implemented eslint-plugin-jsx-a11y aria_props as part of #1141
This PR introduces the aria-props rule, implemented based on the
[WAI-ARIA 1.1
specifications](https://www.w3.org/TR/wai-aria/#state_prop_def ).
2023-12-24 16:47:18 +00:00
poteboy
bf527f4fc1
feat(linter): eslint-plugin-jsx-a11y no-aria-hidden-on-focusable ( #1795 )
...
Implemented eslint-plugin-jsx-a11y no-aria-hidden-on-focusable as part
of #1141
### Key Points
- Implements `no-aria-hidden-on-focusable` as per the
[eslint-plugin-jsx-a11y
documentation](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md ).
- Incorporates HTML's `focus()` API criteria based on the [W3C's DOM
Level 2 HTML
specification](https://www.w3.org/TR/DOM-Level-2-HTML/html.html ) to
accurately identify focusable elements.
2023-12-24 09:29:40 +00:00
Cameron
3102b22c32
fix(linter) fix incorrect report in prefer-string-replace-all ( #1796 )
2023-12-24 09:37:32 +08:00
magic-akari
5b2696b711
refactor(parser): report this parameter error ( #1788 )
...
- follow up: #1728
2023-12-23 22:09:14 +08:00
Milo
b25f014e84
fix(linter): fix a typo in no_redeclare message ( #1789 )
2023-12-23 12:48:50 +00:00
Cameron
29a4a35fd8
fix(prettier) add missing closing brace for dock debug ( #1786 )
2023-12-23 10:59:13 +08:00
Boshen
51a243b989
perf(linter): reduce the RuleEnum enum size from 168 to 16 bytes ( #1783 )
...
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2023-12-22 22:54:41 +08:00
Dunqing
521aa2cf9d
feat(linter/eslint/no-useless-escape): support auto fix ( #1743 )
...
There are many errors in the vitest repo related to this rule.
2023-12-22 22:23:34 +08:00
Tapan Prakash
b8a90c1b9b
feat(linter): eslint-plugin-jsx-a11y no-distracting-elements rule ( #1767 )
...
Implemented eslint-plugin-jsx-a11y no-distracting-elements as part of
https://github.com/oxc-project/oxc/issues/1141 porting recommended
rules.
Doc:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md
Test:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/no-distracting-elements-test.js
2023-12-22 13:04:29 +08:00
Wenzhe Wang
18f0e20c56
docs(linter): update comments ( #1779 )
2023-12-22 12:20:22 +08:00
Wenzhe Wang
0bf7596949
fix(linter): support read the third item in config file ( #1771 )
...
closes : #1757
2023-12-21 22:51:57 +08:00
Boshen
2286181223
fix(linter): update snapshots
2023-12-21 22:07:53 +08:00
Boshen
5d7ea9d7a1
fix(linter): change non-error lints to warning
2023-12-21 21:55:22 +08:00
IWANABETHATGUY
fc7c857f80
fix(vscode): don't lint files in .gitignore and .eslintignore ( #1765 )
...
Closed https://github.com/oxc-project/oxc/issues/1752
2023-12-21 21:45:32 +08:00