Skip to content

Commit 0b1f9bc

Browse files
committed
fix: remove autofixer
1 parent ac4cfa8 commit 0b1f9bc

4 files changed

Lines changed: 1 addition & 22 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ For [Shareable Configs](https://eslint.org/docs/latest/developer-guide/shareable
146146
| [prefer-global/timers](docs/rules/prefer-global/timers.md) | enforce either global timer functions or `require("timers")` | | | |
147147
| [prefer-global/url](docs/rules/prefer-global/url.md) | enforce either `URL` or `require("url").URL` | | | |
148148
| [prefer-global/url-search-params](docs/rules/prefer-global/url-search-params.md) | enforce either `URLSearchParams` or `require("url").URLSearchParams` | | | |
149-
| [prefer-import/assert-strict](docs/rules/prefer-import/assert-strict.md) | enforce using `node:assert/strict` instead of `node:assert`. | | 🔧 | |
149+
| [prefer-import/assert-strict](docs/rules/prefer-import/assert-strict.md) | enforce using `node:assert/strict` instead of `node:assert`. | | | |
150150
| [prefer-node-protocol](docs/rules/prefer-node-protocol.md) | enforce using the `node:` protocol when importing Node.js builtin modules. | | 🔧 | |
151151
| [prefer-promises/dns](docs/rules/prefer-promises/dns.md) | enforce `require("dns").promises` | | | |
152152
| [prefer-promises/fs](docs/rules/prefer-promises/fs.md) | enforce `require("fs").promises` | | | |

docs/rules/prefer-import/assert-strict.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
📝 Enforce using `node:assert/strict` instead of `node:assert`.
44

5-
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6-
75
<!-- end auto-generated rule header -->
86

97
## 📖 Rule Details

lib/rules/prefer-import/assert-strict.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ function checkSource(node, context) {
108108
context.report({
109109
node,
110110
messageId,
111-
fix(fixer) {
112-
const raw = context.sourceCode.getText(node)
113-
const quote = raw[0]
114-
return fixer.replaceText(node, `${quote}node:assert/strict${quote}`)
115-
},
116111
})
117112
}
118113

@@ -125,7 +120,6 @@ export default {
125120
recommended: false,
126121
url: "https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-import/assert-strict.md",
127122
},
128-
fixable: "code",
129123
messages: {
130124
[messageId]: "Prefer `node:assert/strict` over `node:assert`.",
131125
},

tests/lib/rules/prefer-import/assert-strict.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,67 +38,54 @@ new RuleTester({
3838
invalid: [
3939
{
4040
code: 'import assert from "node:assert";',
41-
output: 'import assert from "node:assert/strict";',
4241
errors: [{ messageId: "preferAssertStrict" }],
4342
},
4443
{
4544
code: "import * as assert from 'node:assert';",
46-
output: "import * as assert from 'node:assert/strict';",
4745
errors: [{ messageId: "preferAssertStrict" }],
4846
},
4947
{
5048
code: 'import "node:assert";',
51-
output: 'import "node:assert/strict";',
5249
errors: [{ messageId: "preferAssertStrict" }],
5350
},
5451
{
5552
code: 'import assert, { strict } from "node:assert";',
56-
output: 'import assert, { strict } from "node:assert/strict";',
5753
errors: [{ messageId: "preferAssertStrict" }],
5854
},
5955
{
6056
code: 'import { strict, equal } from "node:assert";',
61-
output: 'import { strict, equal } from "node:assert/strict";',
6257
errors: [{ messageId: "preferAssertStrict" }],
6358
},
6459
{
6560
code: 'export { default as assert } from "node:assert";',
66-
output: 'export { default as assert } from "node:assert/strict";',
6761
errors: [{ messageId: "preferAssertStrict" }],
6862
},
6963
{
7064
code: 'export { strict, equal } from "node:assert";',
71-
output: 'export { strict, equal } from "node:assert/strict";',
7265
errors: [{ messageId: "preferAssertStrict" }],
7366
},
7467
{
7568
code: 'export * from "node:assert";',
76-
output: 'export * from "node:assert/strict";',
7769
errors: [{ messageId: "preferAssertStrict" }],
7870
},
7971
{
8072
code: 'import("node:assert");',
81-
output: 'import("node:assert/strict");',
8273
errors: [{ messageId: "preferAssertStrict" }],
8374
},
8475
{
8576
code: 'require("node:assert");',
86-
output: 'require("node:assert/strict");',
8777
errors: [{ messageId: "preferAssertStrict" }],
8878
},
8979
{
9080
code: 'require("node:assert", extra);',
91-
output: 'require("node:assert/strict", extra);',
9281
errors: [{ messageId: "preferAssertStrict" }],
9382
},
9483
{
9584
code: 'const { strict, equal } = require("node:assert");',
96-
output: 'const { strict, equal } = require("node:assert/strict");',
9785
errors: [{ messageId: "preferAssertStrict" }],
9886
},
9987
{
10088
code: 'require("node:\\u0061ssert");',
101-
output: 'require("node:assert/strict");',
10289
errors: [{ messageId: "preferAssertStrict" }],
10390
},
10491
],

0 commit comments

Comments
 (0)