From 2a2240a4efab6b63bc006b98a950d63e6ca1182e Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 21 Dec 2023 02:53:14 +0100 Subject: [PATCH] Tweaks --- docs/rules/import-style.md | 10 +++++----- docs/rules/no-array-push-push.md | 2 +- docs/rules/no-process-exit.md | 2 +- package.json | 1 + rules/shared/abbreviations.js | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/rules/import-style.md b/docs/rules/import-style.md index c5a01ac221..d60d310ef4 100644 --- a/docs/rules/import-style.md +++ b/docs/rules/import-style.md @@ -17,19 +17,19 @@ This rule defines 4 import styles: ## Fail ```js -const util = require('util'); +const util = require('node:util'); -import util from 'util'; +import util from 'node:util'; -import * as util from 'util'; +import * as util from 'node:util'; ``` ## Pass ```js -const {promisify} = require('util'); +const {promisify} = require('node:util'); -import {promisify} from 'util'; +import {promisify} from 'node:util'; ``` ## Options diff --git a/docs/rules/no-array-push-push.md b/docs/rules/no-array-push-push.md index 035f805517..d3b924b609 100644 --- a/docs/rules/no-array-push-push.md +++ b/docs/rules/no-array-push-push.md @@ -61,7 +61,7 @@ Example: ```js // eslint unicorn/no-array-push-push: ["error", {"ignore": ["readable"]}] -const {Readable} = require('stream'); +import {Readable} from 'node:stream'; const readable = new Readable(); readable.push('one'); diff --git a/docs/rules/no-process-exit.md b/docs/rules/no-process-exit.md index 1cdcb4271d..60e6a14598 100644 --- a/docs/rules/no-process-exit.md +++ b/docs/rules/no-process-exit.md @@ -28,7 +28,7 @@ process.on('SIGINT', () => { ``` ```js -import workerThreads from 'worker_threads'; +import workerThreads from 'node:worker_threads'; try { // Do something… diff --git a/package.json b/package.json index 11bd5e1acf..3a8b053982 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "url": "https://sindresorhus.com" }, "main": "index.js", + "sideEffects": false, "engines": { "node": ">=16" }, diff --git a/rules/shared/abbreviations.js b/rules/shared/abbreviations.js index 4e0e6d6a75..60b57bd238 100644 --- a/rules/shared/abbreviations.js +++ b/rules/shared/abbreviations.js @@ -182,6 +182,7 @@ module.exports.defaultReplacements = { res: { response: true, result: true, + resource: true, }, ret: { returnValue: true,