Commit graph

1632 commits

Author SHA1 Message Date
cin
85651af841
feat(linter): jest/prefer-todo rule (#1065) 2023-11-06 12:32:06 +08:00
Boshen
a6ef574985
Release oxc_resolver v0.5.0 2023-11-06 11:40:39 +08:00
IWANABETHATGUY
cedd2e904c
chore: 🤖 remove generic in FileSystem trait (#1163)
generic will make the Trait non-object safe, so use a specific type
instead a generic instead.
```rs
// Examples of non-object safe traits.
trait NotObjectSafe {
    const CONST: i32 = 1;  // ERROR: cannot have associated const

    fn foo() {}  // ERROR: associated function without Sized
    fn returns(&self) -> Self; // ERROR: Self in return type
    fn typed<T>(&self, x: T) {} // ERROR: has generic type parameters
    fn nested(self: Rc<Box<Self>>) {} // ERROR: nested receiver not yet supported
}

struct S;
impl NotObjectSafe for S {
    fn returns(&self) -> Self { S }
}
let obj: Box<dyn NotObjectSafe> = Box::new(S); // ERROR

```
2023-11-06 11:19:48 +08:00
Boshen
58f8225e08
Release oxc_resolver v0.4.0 2023-11-06 10:50:08 +08:00
Cameron
0635d7b740
feat(linter) eslint plugin unicorn: no new array (#1160) 2023-11-06 09:57:48 +08:00
Cameron
013cfe9c44
feat(linter) eslint plugin unicorn: new-for-builtins (#1159) 2023-11-06 09:55:28 +08:00
Wenzhe Wang
c7598b22ff
chore(cli): move import_plugin into enable_plugins (#1158) 2023-11-06 09:00:36 +08:00
IWANABETHATGUY
7c8342d6be
chore: 🤖 make FileSystem trait object safe (#1157) 2023-11-05 23:40:08 +08:00
Wenzhe Wang
3b88f748fd
refactor: change jest rule's category (#1155) 2023-11-05 14:00:12 +00:00
Wenzhe Wang
4e9260ec03
feat: basic enable plugin (#1154) 2023-11-05 21:46:30 +08:00
Boshen
e2e74caab3
Update README.md 2023-11-05 21:41:28 +08:00
Boshen
9b913301e8
chore(editor/vscode): remove unused dependencies and also webpack.config.js (#1153) 2023-11-05 21:09:34 +08:00
Wenzhe Wang
e9b88e0b45
refactor: split parse_jest_fn_call (#1152) 2023-11-05 20:47:09 +08:00
Boshen
f7c4abe84c
Release vscode extension v0.0.3 2023-11-05 15:05:32 +08:00
Boshen
5aa7cc1718
publish vscode (#1144) 2023-11-05 15:03:22 +08:00
Boshen
bf3d907dc2
Update README.md 2023-11-05 09:03:58 +08:00
Cameron
b81d79b64b
refactor(eqeqeq) rename eq_eq_eq to eqeqeq (#1151)
From #1146

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-05 00:25:04 +00:00
Cameron
28a9574190
feat(linter) eslint plugin unicorn Prefer TypeError (#1149)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-05 00:02:12 +00:00
Cameron
b8cc460c5c
feat(linter) eslint plugin unicorn: prefer date now (#1150) 2023-11-05 07:47:47 +08:00
Cameron
f8be0b4cf2
feat(linter) eslint plugin unicorn prefer string trim start end (#1148) 2023-11-05 07:43:41 +08:00
Cameron
3bf374eda8
feat(linter) eslint plugin unicorn: no invalid remove evt listner (#1147) 2023-11-05 07:42:37 +08:00
Cameron
3eb4b9b1c4
feat(linter) parse configuration for unicorn/filename-case (#1145) 2023-11-05 07:41:16 +08:00
Boshen
38c90db0fe
ci: check unused dependencies via cargo machete (#1143) 2023-11-04 14:45:44 +00:00
Boshen
30297bb8c0
chore: remove unused workflows (#1142) 2023-11-04 22:23:09 +08:00
ubugeeei
f75485b41f
add icon file for vscode extension (#1134) (#1135)
Closes #1134 

I'm not sure if it's the correct solution, but I solved it this way, so
I'll submit a PR. As for the icon, I took it from the marketplace.

https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode
2023-11-04 08:42:18 +08:00
Wenzhe Wang
f71cb9f1da
feat(transform): support TemplateLiteral of babel/plugin-transform-template-literals (#1132)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-03 22:19:44 +08:00
Wei Zhu
278a1d6fee
fix(linter/jsx_key): ignore ObjectProterty nodes (#1139)
Elements inside `ObjectProperty` should be ignored in this case.

Reproducible link
https://web-infra-dev.github.io/oxc/playground/?code=3YCAAIBkgICAgICAgICxG0qZRraXT4%2BHfMNjiJBtGiljae%2FxPDG%2BJO0RwxenJsd5%2BlR3yNLJ5vlfyo6dyWxkTY9Mm3O0cA9BM891YAt9c0xItb72Q7pTMe3YerC2J%2FisL1OUPS%2FtM4wqycc0tXOSR6ljCgWmr5gaAISHdIxbyoQxaSumV472wrVF2NwbxJnOjXh3fgSlgA%3D%3D
2023-11-03 21:56:51 +08:00
ubugeeei
fa31a52b02
fix typo (turing -> tuning) (#1137)
I'm not sure if it was intentional, but something that seemed to be
"Tuning" was written as "Turing", so I've corrected it.
If it's unnecessary, please close it 🙏🏻
2023-11-03 21:56:13 +08:00
Boshen
203cf37695
feat(transformer/react): read comment pragma @jsxRuntime classic / automatic (#1133)
closes #1120
2023-11-03 11:10:11 +08:00
ubugeeei
c7fcb31812
tweak the build instructions for vsxi (#1136)
When building the vsix file, it was necessary to execute the build
command before the package command.

As a result, the documentation has been updated!
2023-11-03 11:04:18 +08:00
Trevor Manz
1aa4b4e024
feat(linter): Add rule eslint-plugin-jsx-a11y(alt-text) (#1126)
Adds first `eslint-plugin-jsx-a11y` rule.

Had to comment out a couple of tests with TODOs related to evaluating
logical expressions and polymorphic components, but I think these are
largely edge cases for detecting validity of alt text. The most
important cases are covered.
2023-11-03 11:02:33 +08:00
Boshen
69150d812c
refactor(transformer): move Semantic into Transformer (#1130) 2023-11-02 13:10:15 +08:00
Hao Cheng
fa4e0cae81
fix(linter): fix covered span of eslint-disable-next-line comments (#1128)
This PR fixes the covered span (specifically the stop position) of
`eslint-disable-next-line` comments.

Note that the covered span is not very accurate in the case of
multi-line comments. For example, the start and stop positions of the
`eslint-disable-next-line` comment in the example below are marked in
comments.

```js
            /* eslint-disable-next-line no-debugger --
             * Here's a very long description about why this configuration is necessary
             * along with some additional information
            **/
//           ^start
            debugger;
//                  ^stop
            debugger;
```

The stop position has an offset of one or two depending on the line
ending (\r\n or \n). I am not sure if this would be a problem.
2023-11-02 09:28:39 +08:00
Boshen
223877b6fd
feat(vscode): prepare for publish (#1123) 2023-11-01 09:49:29 +08:00
Boshen
a9b85b60b1
chore(vscode): disable the "run all" as it is disruptive (#1122) 2023-11-01 09:41:56 +08:00
Boshen
5a44c0918a
chore(vscode): update development guide (#1121) 2023-10-31 07:32:15 +00:00
Trevor Manz
8f5e9831df
feat(rulegen): Add jsx-a11y rulegen (#1119)
Adds the `just new-jsx-a11y-rule` for bootstrapping
`eslint-plugin-jsx-a11y` linting rules.

One tricky thing about the tests in that repo is that the aren't
provided as array expressions
(e.g., `[case0, case1, case2, ...]`) but rather separate arguments to
`[].concat()`
(e.g., `[].concat(case0, case1, case2, ...)`). There is probably a more
elegant way to match
these expressions, but this is what I came up with.

The other thing I introduced in this PR is prefer Rust's raw strings
(`r#`) when generating the
test cases. Sometimes running `just new-*` spit out unescaped back
quotes, which caused issues.
2023-10-31 13:18:48 +08:00
Boshen
e71d57ac2d
chore(README): update broken LICENSE links (#1118) 2023-10-31 11:45:05 +08:00
Boshen
ddd5314202
Release oxlint v0.0.15 (#1116) 2023-10-31 00:10:39 +08:00
Wenzhe Wang
8105ee5872
feat(tasks): skip cases start with dot (#1114)
0effd92d88/packages/babel-helper-fixtures/src/index.ts (L223)
2023-10-30 23:34:43 +08:00
Boshen
103268be98
chore(linter): move all import plugin rules to nursery (#1113) 2023-10-30 21:04:57 +08:00
Boshen
407e406f86
feat(linter): change some rules pedantic and improve help message (#1112) 2023-10-30 17:42:15 +08:00
Dunqing
144c881be5
fix(linter/no-render-return-value): remove duplicate test case (#1111)
Added in #1109
2023-10-30 09:37:14 +00:00
Boshen
cf1265453b
chore(linter/no_unescaped_entities): demote to pedantic (#1110)
The code is not wrong
2023-10-30 17:30:32 +08:00
Boshen
4975440e1b
fix(linter/no_render_return_value): fix false positive when nested inside an arrow expression (#1109) 2023-10-30 17:23:11 +08:00
Boshen
8b11592a1f
feat(linter): demote prefer_array_flat_map to style (#1108) 2023-10-30 17:04:51 +08:00
Dunqing
d4c05ff7b3
feat(linter): support unicorn/prefer-query-selector (#1068)
Refer to
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md

link: #684
2023-10-30 17:04:35 +08:00
Boshen
6da5a3f216
feat(cli): print execution time in seconds when greater than 1 second (#1107) 2023-10-30 16:35:40 +08:00
Boshen
b703c0c5b5
feat(linter/no_children_prop): point the span to "children" (#1106) 2023-10-30 16:19:30 +08:00
Boshen
22c31cef3f
fix(linter/no_empty_file): point to start of file instead of the entire file (#1105)
Since it may contain lots of comments, which gives us a screenful of comments
2023-10-30 16:11:37 +08:00