File tree Expand file tree Collapse file tree 4 files changed +92
-3
lines changed
src/docs/guide/usage/linter Expand file tree Collapse file tree 4 files changed +92
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
The progress of all rule implementations is tracked [ here] ( https://github.com/oxc-project/oxc/issues/481 ) .
4
4
5
- - Total number of rules: 519
5
+ - Total number of rules: 520
6
6
- Rules turned on by default: 123
7
7
8
8
** Legend for 'Fixable?' column:**
@@ -286,14 +286,15 @@ Lints which prevent the use of language and library features. Must not be enable
286
286
| [ prefer-node-protocol] ( /docs/guide/usage/linter/rules/unicorn/prefer-node-protocol.html ) | unicorn | | 🛠️ |
287
287
| [ prefer-number-properties] ( /docs/guide/usage/linter/rules/unicorn/prefer-number-properties.html ) | unicorn | | ⚠️🛠️️ |
288
288
289
- ## Suspicious (33 ):
289
+ ## Suspicious (34 ):
290
290
291
291
code that is most likely wrong or useless.
292
292
293
293
| Rule name | Source | Default | Fixable? |
294
294
| -------------------------------------------------------------------------------------------------------------------- | ---------- | ------- | -------- |
295
295
| [ block-scoped-var] ( /docs/guide/usage/linter/rules/eslint/block-scoped-var.html ) | eslint | | |
296
296
| [ no-extend-native] ( /docs/guide/usage/linter/rules/eslint/no-extend-native.html ) | eslint | | |
297
+ | [ no-extra-bind] ( /docs/guide/usage/linter/rules/eslint/no-extra-bind.html ) | eslint | | 🚧 |
297
298
| [ no-new] ( /docs/guide/usage/linter/rules/eslint/no-new.html ) | eslint | | |
298
299
| [ no-unexpected-multiline] ( /docs/guide/usage/linter/rules/eslint/no-unexpected-multiline.html ) | eslint | | ⚠️🛠️️ |
299
300
| [ no-unneeded-ternary] ( /docs/guide/usage/linter/rules/eslint/no-unneeded-ternary.html ) | eslint | | ⚠️🛠️️ |
Original file line number Diff line number Diff line change
1
+ <!-- This file is auto-generated by tasks/website/src/linter/rules/doc_page.rs. Do not edit it manually. -->
2
+
3
+ <script setup >
4
+ import { data } from ' ../version.data.js' ;
5
+ const source = ` https://github.com/oxc-project/oxc/blob/${ data } /crates/oxc_linter/src/rules/eslint/no_extra_bind.rs` ;
6
+ </script >
7
+
8
+ # eslint/no-extra-bind <Badge type =" info " text =" Suspicious " />
9
+
10
+ <div class =" rule-meta " >
11
+ <Alert class =" fix " type =" info " >
12
+ <span class =" emoji " >🚧</span > An auto-fix is still under development.
13
+ </Alert >
14
+ </div >
15
+
16
+ ### What it does
17
+
18
+ Disallow unnecessary calls to .bind()
19
+
20
+ ### Why is this bad?
21
+
22
+ This rule is aimed at avoiding the unnecessary use of bind()
23
+ and as such will warn whenever an immediately-invoked function expression (IIFE) is using bind()
24
+ and doesn’t have an appropriate this value.
25
+ This rule won’t flag usage of bind() that includes function argument binding.
26
+
27
+ ### Examples
28
+
29
+ Examples of ** incorrect** code for this rule:
30
+
31
+ ``` js
32
+ const x = function () {
33
+ foo ();
34
+ }.bind (bar);
35
+
36
+ const z = (() => {
37
+ this .foo ();
38
+ }).bind (this );
39
+ ```
40
+
41
+ Examples of ** correct** code for this rule:
42
+
43
+ ``` js
44
+ const x = function () {
45
+ this .foo ();
46
+ }.bind (bar);
47
+ const y = function (a ) {
48
+ return a + 1 ;
49
+ }.bind (foo, bar);
50
+ ```
51
+
52
+ ## How to use
53
+
54
+ To ** enable** this rule in the CLI or using the config file, you can use:
55
+
56
+ ::: code-group
57
+
58
+ ``` bash [CLI]
59
+ oxlint --deny no-extra-bind
60
+ ```
61
+
62
+ ``` json [Config (.oxlintrc.json)]
63
+ {
64
+ "rules" : {
65
+ "no-extra-bind" : " error"
66
+ }
67
+ }
68
+ ```
69
+
70
+ :::
71
+
72
+ ## References
73
+
74
+ - <a v-bind:href =" source " target =" _blank " rel =" noreferrer " >Rule Source</a >
Original file line number Diff line number Diff line change @@ -46,6 +46,20 @@ function MyComponent(props) {
46
46
}
47
47
```
48
48
49
+ ### Options
50
+
51
+ #### additionalHooks
52
+
53
+ ` { type: string } `
54
+
55
+ Optionally provide a regex of additional hooks to check.
56
+
57
+ Example:
58
+
59
+ ``` json
60
+ { "react/exhaustive-deps" : [" error" , { "additionalHooks" : " useSpecialEffect" }] }
61
+ ```
62
+
49
63
## How to use
50
64
51
65
To ** enable** this rule in the CLI or using the config file, you can use:
Original file line number Diff line number Diff line change 1
1
export default {
2
2
load ( ) {
3
- return "df7dc74cc90fa27efccf9a988c0f82e883a42302 " ;
3
+ return "40ca1ef8d4b2e923caf723ebd190a9d52efeaef5 " ;
4
4
} ,
5
5
} ;
You can’t perform that action at this time.
0 commit comments