Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 148 additions & 4 deletions .vitepress/data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,15 @@
"default": true,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html"
},
{
"scope": "eslint",
"value": "no-use-before-define",
"category": "restriction",
"type_aware": false,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-use-before-define.html"
},
{
"scope": "eslint",
"value": "no-useless-backreference",
Expand Down Expand Up @@ -2159,6 +2168,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/jest/prefer-mock-promise-shorthand.html"
},
{
"scope": "jest",
"value": "prefer-mock-return-shorthand",
"category": "style",
"type_aware": false,
"fix": "fixable_fix",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/jest/prefer-mock-return-shorthand.html"
},
{
"scope": "jest",
"value": "prefer-spy-on",
Expand Down Expand Up @@ -2942,6 +2960,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/node/no-new-require.html"
},
{
"scope": "node",
"value": "no-path-concat",
"category": "restriction",
"type_aware": false,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/node/no-path-concat.html"
},
{
"scope": "node",
"value": "no-process-env",
Expand Down Expand Up @@ -3923,6 +3950,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-indexed-object-style.html"
},
{
"scope": "typescript",
"value": "consistent-return",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-return.html"
},
{
"scope": "typescript",
"value": "consistent-type-assertions",
Expand All @@ -3941,6 +3977,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-type-definitions.html"
},
{
"scope": "typescript",
"value": "consistent-type-exports",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-type-exports.html"
},
{
"scope": "typescript",
"value": "consistent-type-imports",
Expand All @@ -3950,6 +3995,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-type-imports.html"
},
{
"scope": "typescript",
"value": "dot-notation",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/dot-notation.html"
},
{
"scope": "typescript",
"value": "explicit-function-return-type",
Expand Down Expand Up @@ -4283,6 +4337,15 @@
"default": true,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-parameter-property-assignment.html"
},
{
"scope": "typescript",
"value": "no-unnecessary-qualifier",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-qualifier.html"
},
{
"scope": "typescript",
"value": "no-unnecessary-template-expression",
Expand Down Expand Up @@ -4319,6 +4382,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-constraint.html"
},
{
"scope": "typescript",
"value": "no-unnecessary-type-parameters",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-parameters.html"
},
{
"scope": "typescript",
"value": "no-unsafe-argument",
Expand Down Expand Up @@ -4411,12 +4483,12 @@
},
{
"scope": "typescript",
"value": "no-use-before-define",
"category": "restriction",
"type_aware": false,
"value": "no-useless-default-assignment",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-use-before-define.html"
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-useless-default-assignment.html"
},
{
"scope": "typescript",
Expand Down Expand Up @@ -4490,6 +4562,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-enum-initializers.html"
},
{
"scope": "typescript",
"value": "prefer-find",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-find.html"
},
{
"scope": "typescript",
"value": "prefer-for-of",
Expand Down Expand Up @@ -4562,6 +4643,24 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-promise-reject-errors.html"
},
{
"scope": "typescript",
"value": "prefer-readonly",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-readonly.html"
},
{
"scope": "typescript",
"value": "prefer-readonly-parameter-types",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-readonly-parameter-types.html"
},
{
"scope": "typescript",
"value": "prefer-reduce-type-parameter",
Expand All @@ -4571,6 +4670,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-reduce-type-parameter.html"
},
{
"scope": "typescript",
"value": "prefer-regexp-exec",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-regexp-exec.html"
},
{
"scope": "typescript",
"value": "prefer-return-this-type",
Expand All @@ -4580,6 +4688,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-return-this-type.html"
},
{
"scope": "typescript",
"value": "prefer-string-starts-ends-with",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": true,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-string-starts-ends-with.html"
},
{
"scope": "typescript",
"value": "prefer-ts-expect-error",
Expand Down Expand Up @@ -4661,6 +4778,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/strict-boolean-expressions.html"
},
{
"scope": "typescript",
"value": "strict-void-return",
"category": "nursery",
"type_aware": true,
"fix": "none",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/typescript/strict-void-return.html"
},
{
"scope": "typescript",
"value": "switch-exhaustiveness-check",
Expand Down Expand Up @@ -5858,6 +5984,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/vitest/no-import-node-test.html"
},
{
"scope": "vitest",
"value": "no-importing-vitest-globals",
"category": "style",
"type_aware": false,
"fix": "fixable_fix",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/vitest/no-importing-vitest-globals.html"
},
{
"scope": "vitest",
"value": "prefer-called-once",
Expand Down Expand Up @@ -5894,6 +6029,15 @@
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-expect-type-of.html"
},
{
"scope": "vitest",
"value": "prefer-import-in-mock",
"category": "style",
"type_aware": false,
"fix": "fixable_fix",
"default": false,
"docs_url": "https://oxc.rs/docs/guide/usage/linter/rules/vitest/prefer-import-in-mock.html"
},
{
"scope": "vitest",
"value": "prefer-to-be-falsy",
Expand Down
26 changes: 8 additions & 18 deletions src/docs/guide/usage/formatter/generated-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,12 @@ The list of modifiers is sorted from most to least important:
- Default: See below

```json
[
"type-import",
["value-builtin", "value-external"],
"type-internal",
"value-internal",
["type-parent", "type-sibling", "type-index"],
["value-parent", "value-sibling", "value-index"],
"unknown"
]
["builtin", "external", ["internal", "subpath"], ["parent", "sibling", "index"], "style", "unknown"]
```

Also, you can override the global `newlinesBetween` setting for specific group boundaries
by including a `{ "newlinesBetween": boolean }` marker object in the `groups` list at the desired position.

#### experimentalSortImports.groups[n]

type: `array | string`
Expand Down Expand Up @@ -582,17 +577,12 @@ The list of modifiers is sorted from most to least important:
- Default: See below

```json
[
"type-import",
["value-builtin", "value-external"],
"type-internal",
"value-internal",
["type-parent", "type-sibling", "type-index"],
["value-parent", "value-sibling", "value-index"],
"unknown"
]
["builtin", "external", ["internal", "subpath"], ["parent", "sibling", "index"], "style", "unknown"]
```

Also, you can override the global `newlinesBetween` setting for specific group boundaries
by including a `{ "newlinesBetween": boolean }` marker object in the `groups` list at the desired position.

####### overrides[n].options.experimentalSortImports.groups[n]

type: `array | string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ default: `false`
When set to true, allows callbacks of methods that require a return value to
implicitly return undefined with a return statement containing no expression.

### allowVoid

type: `boolean`

default: `false`

When set to true, rule will not report the return value with a void operator.
Works only if `checkForEach` option is set to true.

### checkForEach

type: `boolean`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "typescript/no-use-before-define"
title: "eslint/no-use-before-define"
category: "Restriction"
default: false
type_aware: false
Expand All @@ -10,7 +10,7 @@ fix: "none"

<script setup>
import { data } from '../version.data.js';
const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/typescript/no_use_before_define.rs`;
const source = `https://github.com/oxc-project/oxc/blob/${ data }/crates/oxc_linter/src/rules/eslint/no_use_before_define.rs`;
</script>

<RuleHeader />
Expand Down Expand Up @@ -109,13 +109,13 @@ To **enable** this rule using the config file or in the CLI, you can use:
```json [Config (.oxlintrc.json)]
{
"rules": {
"typescript/no-use-before-define": "error"
"no-use-before-define": "error"
}
}
```

```bash [CLI]
oxlint --deny typescript/no-use-before-define
oxlint --deny no-use-before-define
```

:::
Expand Down
12 changes: 0 additions & 12 deletions src/docs/guide/usage/linter/rules/eslint/radix.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ Examples of **correct** code for this rule:
var num = parseInt("071", 10); // 71
```

## Configuration

This rule accepts one of the following string values:

### `"always"`

Always require the radix parameter when using `parseInt()`.

### `"as-needed"`

Only require the radix parameter when necessary.

## How to use

To **enable** this rule using the config file or in the CLI, you can use:
Expand Down
Loading