Skip to content

Commit 4f43592

Browse files
committed
chore: remove usage of the prefer-global rules
1 parent 02fc101 commit 4f43592

File tree

84 files changed

+27
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+27
-133
lines changed

eslint.config.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ const commonFiles = '{js,mjs,cjs,ts,mts,cts,jsx,tsx}';
1717

1818
const commonRuleset = merge(...common, { files: [`**/*${commonFiles}`] });
1919

20-
const nodeRuleset = merge(...node, { files: [`**/*${commonFiles}`] });
20+
const nodeRuleset = merge(...node, {
21+
files: [`**/*${commonFiles}`],
22+
rules: {
23+
'no-restricted-globals': 0,
24+
'n/prefer-global/buffer': [2, 'always'],
25+
'n/prefer-global/process': [2, 'always'],
26+
'n/prefer-global/text-decoder': [2, 'always'],
27+
'n/prefer-global/text-encoder': [2, 'always'],
28+
'n/prefer-global/url': [2, 'always'],
29+
'n/prefer-global/url-search-params': [2, 'always'],
30+
},
31+
});
2132

2233
const typeScriptRuleset = merge(...typescript, {
2334
files: [`**/*${commonFiles}`],
@@ -123,7 +134,6 @@ export default defineConfig(
123134
{
124135
files: [`packages/{api-extractor,api-extractor-model,api-extractor-utils}/**/*${commonFiles}`],
125136
rules: {
126-
'n/prefer-global/process': 0,
127137
'@typescript-eslint/naming-convention': 0,
128138
'@typescript-eslint/no-empty-interface': 0,
129139
'@typescript-eslint/no-empty-object-type': 0,
@@ -236,11 +246,6 @@ export default defineConfig(
236246
{
237247
files: [`packages/rest/**/*${commonFiles}`],
238248
rules: {
239-
'n/prefer-global/url': 0,
240-
'n/prefer-global/url-search-params': 0,
241-
'n/prefer-global/buffer': 0,
242-
'n/prefer-global/process': 0,
243-
'no-restricted-globals': 0,
244249
'unicorn/prefer-node-protocol': 0,
245250
},
246251
},
@@ -255,8 +260,6 @@ export default defineConfig(
255260
{
256261
files: [`packages/voice/**/*${commonFiles}`],
257262
rules: {
258-
'no-restricted-globals': 0,
259-
'n/prefer-global/buffer': 0,
260263
'@typescript-eslint/no-unsafe-declaration-merging': 0,
261264
},
262265
},

packages/actions/src/releasePackages/releasePackage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import process from 'node:process';
21
import { setInterval, clearInterval } from 'node:timers';
32
import { info, warning } from '@actions/core';
43
import { getOctokit, context } from '@actions/github';

packages/actions/src/uploadDocumentation/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { readFile } from 'node:fs/promises';
2-
import process from 'node:process';
32
import { getInput, setFailed } from '@actions/core';
43
import { create } from '@actions/glob';
54
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';

packages/actions/src/uploadSearchIndices/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import process from 'node:process';
21
import { setFailed } from '@actions/core';
32
import { generateAllIndices } from '@discordjs/scripts';
43
import Cloudflare from 'cloudflare';

packages/actions/src/uploadSplitDocumentation/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { readFile } from 'node:fs/promises';
22
import { basename, dirname, relative, sep } from 'node:path';
3-
import process from 'node:process';
43
import { setTimeout as sleep } from 'node:timers/promises';
54
import { setFailed, getInput } from '@actions/core';
65
import { create } from '@actions/glob';

packages/api-extractor-model/src/model/ApiPackage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import { Buffer } from 'node:buffer';
54
import path from 'node:path';
65
import util from 'node:util';
76
import { TSDocConfiguration } from '@microsoft/tsdoc';

packages/api-extractor-model/src/model/SourceLocation.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
import { URL } from 'node:url';
5-
64
/**
75
* Constructor options for `SourceLocation`.
86
*

packages/api-extractor/src/cli/ApiExtractorCommandLine.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// See LICENSE in the project root for license information.
33

44
import * as os from 'node:os';
5-
import process from 'node:process';
65
import { InternalError } from '@rushstack/node-core-library';
76
import { CommandLineParser, type CommandLineFlagParameter } from '@rushstack/ts-command-line';
87
import colors from 'colors';

packages/api-extractor/src/start.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// See LICENSE in the project root for license information.
33

44
import * as os from 'node:os';
5-
import * as process from 'node:process';
65
import colors from 'colors';
76
import { Extractor } from './api/Extractor.js';
87
import { ApiExtractorCommandLine } from './cli/ApiExtractorCommandLine.js';

packages/brokers/src/brokers/Broker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Buffer } from 'node:buffer';
21
import { encode, decode } from '@msgpack/msgpack';
32
import type { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
43

0 commit comments

Comments
 (0)