Dunqing
bfd5cd92a6
refactor(semantic): improve check function declaration implementation ( #1854 )
2023-12-31 22:17:56 +08:00
Wenzhe Wang
8f27a98468
feat(cli): support walk vue and astro ( #1745 )
2023-12-31 22:15:11 +08:00
Qix
adfe24e965
fix(ast): implement GetSpan for JSXElement ( #1861 )
2023-12-31 22:08:11 +08:00
Valerii Smirnov
ba0a4a890a
feat(linter): eslint-plugin-react: jsx-no-undef ( #1862 )
...
Part of #1022
Based on:
- doc: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
- code: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-no-undef.js
- test: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/tests/lib/rules/jsx-no-undef.js
2023-12-31 11:57:44 +00:00
msdlisper
b2a62ddaa2
fix(linter): error rule config in media_has_caption ( #1864 )
...
fix error rule config
```
serde_json::json!({
"audio": [ "Audio" ],
"video": [ "Video" ],
"track": [ "Track" ],
})
```
to
```
serde_json::json!([{
"audio": [ "Audio" ],
"video": [ "Video" ],
"track": [ "Track" ],
}])
```
based on the eslint docs, if a rule configuration is passed, it has to
look like `<RULE NAME>: [<SEVERITY>, config]`
2023-12-31 10:55:25 +00:00
msdlisper
1ddbe8f12d
fix(linter): unexpected unwrap panic ( #1856 )
...
While reviewing the code, I noticed that a panic will occur if the
object does not have the 'ignoreNonDOM' key, which is unexpected. And I
have moved out the code `no_focus.set_option(true);` to make the
function cleaner.
2023-12-31 12:09:58 +08:00
Deivid Almeida
c1cfd1759e
feat(linter): no-irregular-whitespace rule ( #1835 )
...
Parser, trivias and trivias_builder were edited to get all whitespaces.
Now Trivias struct store comments and whitespaces Vec. After that, i
will implement the no-irregular-whitespace rule.
P.S.: There isn't a way to implement this feature without lose a little
bit of performance, comparing with my last PR #1819 to minimax this
trouble instead of store the irregular whitespace as Span it was stored
as u32, i removed a map iterator and removed too a unused function. If
you have a suggestion about it pls give me a feedback.
2023-12-31 12:05:38 +08:00
Rintaro Itokawa
36cb7c53c5
feat(linter): eslint-plugin-jsx-a11y: aria-unsupported-elements
...
Based on:
- docs:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md
- code:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/aria-unsupported-elements.js
- test:
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/__tests__/src/rules/aria-unsupported-elements-test.js
2023-12-30 11:18:44 +00:00
msdlisper
1c695aee3a
refactor(linter) remove duplicated code in media-has-caption ( #1859 )
2023-12-30 11:17:19 +00:00
Maurice Nicholson
d803a3ab5e
fix(linter): ignore false positives in eslint-plugin-react(jsx-key) ( #1858 )
...
Closes #1857
Fixes false positives where an arrow function exists within an array
2023-12-30 11:14:45 +00:00
msdlisper
af618946e5
feat(linter): eslint plugin jsx a11y: aria-role ( #1849 )
...
eslint-plugin-jsx-a11y aria-role for #1141
2023-12-29 10:29:00 +00:00
IWANABETHATGUY
4bbc977971
chore: upgrade rustc toolchain to stable 1.75.0 ( #1853 )
...
ref:
https://blog.rust-lang.org/2023/12/28/Rust-1.75.0.html
2023-12-29 12:20:51 +08:00
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