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
20 changes: 10 additions & 10 deletions crates/oxc_linter/src/rules/eslint/eqeqeq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ declare_oxc_lint!(
///
/// Examples of **incorrect** code for this rule:
/// ```js
/// /* eslint eqeqeq: "error" */
/// /* eqeqeq: "error" */
///
/// if (x == 42) {}
/// if ("" == text) {}
Expand All @@ -75,7 +75,7 @@ declare_oxc_lint!(
///
/// Examples of **correct** code for this rule:
/// ```js
/// /* eslint eqeqeq: "error" */
/// /* eqeqeq: "error" */
///
/// if (x === 42) {}
/// if ("" === text) {}
Expand All @@ -86,15 +86,15 @@ declare_oxc_lint!(
///
/// Examples of **incorrect** code for this rule with the `"smart"` option:
/// ```js
/// /* eslint eqeqeq: ["error", "smart"] */
/// /* eqeqeq: ["error", "smart"] */
///
/// if (x == 42) {}
/// if ("" == text) {}
/// ```
///
/// Examples of **correct** code for this rule with the `"smart"` option:
/// ```js
/// /* eslint eqeqeq: ["error", "smart"] */
/// /* eqeqeq: ["error", "smart"] */
///
/// if (typeof foo == "undefined") {}
/// if (foo == null) {}
Expand All @@ -105,14 +105,14 @@ declare_oxc_lint!(
///
/// Examples of **incorrect** code for this rule with the `{ "null": "ignore" }` option:
/// ```js
/// /* eslint eqeqeq: ["error", "always", { "null": "ignore" }] */
/// /* eqeqeq: ["error", "always", { "null": "ignore" }] */
/// if (x == 42) {}
/// if ("" == text) {}
/// ```
///
/// Examples of **correct** code for this rule with the `{ "null": "ignore" }` option:
/// ```js
/// /* eslint eqeqeq: ["error", "always", { "null": "ignore" }] */
/// /* eqeqeq: ["error", "always", { "null": "ignore" }] */
/// if (foo == null) {}
/// if (foo != null) {}
/// ```
Expand All @@ -121,15 +121,15 @@ declare_oxc_lint!(
///
/// Examples of **incorrect** code for this rule with the `{ "null": "always" }` option:
/// ```js
/// /* eslint eqeqeq: ["error", "always", { "null": "always" }] */
/// /* eqeqeq: ["error", "always", { "null": "always" }] */
///
/// if (foo == null) {}
/// if (foo != null) {}
/// ```
///
/// Examples of **correct** code for this rule with the `{ "null": "always" }` option:
/// ```js
/// /* eslint eqeqeq: ["error", "always", { "null": "always" }] */
/// /* eqeqeq: ["error", "always", { "null": "always" }] */
///
/// if (foo === null) {}
/// if (foo !== null) {}
Expand All @@ -139,7 +139,7 @@ declare_oxc_lint!(
///
/// Examples of **incorrect** code for this rule with the `{ "null": "never" }` option:
/// ```js
/// /* eslint eqeqeq: ["error", "always", { "null": "never" }] */
/// /* eqeqeq: ["error", "always", { "null": "never" }] */
///
/// if (x == 42) {}
/// if ("" == text) {}
Expand All @@ -149,7 +149,7 @@ declare_oxc_lint!(
///
/// Examples of **correct** code for this rule with the `{ "null": "never" }` option:
/// ```js
/// /* eslint eqeqeq: ["error", "always", { "null": "never" }] */
/// /* eqeqeq: ["error", "always", { "null": "never" }] */
///
/// if (x === 42) {}
/// if ("" === text) {}
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/eslint/id_length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ declare_oxc_lint!(
///
/// Examples of **incorrect** code for this rule:
/// ```js
/// /*eslint id-length: "error"*/ // default is minimum 2-chars ({ "min": 2 })
/// /* id-length: "error" */ // default is minimum 2-chars ({ "min": 2 })
///
/// const x = 5;
/// obj.e = document.body;
Expand Down Expand Up @@ -127,7 +127,7 @@ declare_oxc_lint!(
///
/// Examples of **correct** code for this rule:
/// ```js
/// /*eslint id-length: "error"*/ // default is minimum 2-chars ({ "min": 2 })
/// /* id-length: "error" */ // default is minimum 2-chars ({ "min": 2 })
///
/// const num = 5;
/// function _f() { return 42; }
Expand Down
27 changes: 15 additions & 12 deletions crates/oxc_linter/src/rules/eslint/init_declarations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,42 @@ declare_oxc_lint!(
/// ### Why is this bad?
///
/// In JavaScript, variables can be assigned during declaration, or at any point afterwards using an assignment statement.
/// For example, in the following code, foo is initialized during declaration, while bar is initialized later.
/// For example, in the following code, `foo` is initialized during declaration, while `bar` is initialized later.
///
/// ### Examples
/// ```js
/// var foo = 1;
/// var bar;
/// if (foo) {
/// bar = 1;
/// } else {
/// bar = 2;
/// }
/// ```
///
/// ### Examples
///
/// Examples of incorrect code for the default "always" option:
/// Examples of incorrect code for the default `"always"` option:
/// ```js
/// /*eslint init-declarations: ["error", "always"]*/
/// /* init-declarations: ["error", "always"] */
/// function foo() {
/// var bar;
/// let baz;
/// }
/// ```
///
/// Examples of incorrect code for the "never" option:
/// Examples of incorrect code for the `"never"` option:
/// ```js
/// /*eslint init-declarations: ["error", "never"]*/
/// /* init-declarations: ["error", "never"] */
/// function foo() {
/// var bar = 1;
/// let baz = 2;
/// for (var i = 0; i < 1; i++) {}
/// }
/// ```
///
/// Examples of correct code for the default "always" option:
/// Examples of correct code for the default `"always"` option:
/// ```js
/// /*eslint init-declarations: ["error", "always"]*/
/// /* init-declarations: ["error", "always"] */
///
/// function foo() {
/// var bar = 1;
Expand All @@ -98,9 +101,9 @@ declare_oxc_lint!(
/// }
/// ```
///
/// Examples of correct code for the "never" option:
/// Examples of correct code for the `"never"` option:
/// ```js
/// /*eslint init-declarations: ["error", "never"]*/
/// /* init-declarations: ["error", "never"] */
///
/// function foo() {
/// var bar;
Expand All @@ -109,9 +112,9 @@ declare_oxc_lint!(
/// }
/// ```
///
/// Examples of correct code for the "never", { "ignoreForLoopInit": true } options:
/// Examples of correct code for the `"never", { "ignoreForLoopInit": true }` options:
/// ```js
/// /*eslint init-declarations: ["error", "never", { "ignoreForLoopInit": true }]*/
/// /* init-declarations: ["error", "never", { "ignoreForLoopInit": true }] */
/// for (var i = 0; i < 1; i++) {}
/// ```
InitDeclarations,
Expand Down
Loading
Loading