Skip to content

Commit 4709ffe

Browse files
committed
Suppress no-console rule violations.
1 parent 366ff93 commit 4709ffe

File tree

138 files changed

+492
-18
lines changed

Some content is hidden

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

138 files changed

+492
-18
lines changed

Diff for: apps/api-documenter/.eslintrc.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ require('eslint-config-local/patch/modern-module-resolution');
33

44
module.exports = {
55
extends: ['eslint-config-local/profile/node-trusted-tool', 'eslint-config-local/mixins/friendly-locals'],
6-
parserOptions: { tsconfigRootDir: __dirname }
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
8+
overrides: [
9+
{
10+
files: ['*.ts', '*.tsx'],
11+
rules: {
12+
'no-console': 'off'
13+
}
14+
}
15+
]
716
};

Diff for: apps/api-extractor/.eslintrc.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ require('eslint-config-local/patch/modern-module-resolution');
33

44
module.exports = {
55
extends: ['eslint-config-local/profile/node-trusted-tool', 'eslint-config-local/mixins/friendly-locals'],
6-
parserOptions: { tsconfigRootDir: __dirname }
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
8+
overrides: [
9+
{
10+
files: ['*.ts', '*.tsx'],
11+
rules: {
12+
'no-console': 'off'
13+
}
14+
}
15+
]
716
};

Diff for: apps/heft/src/startWithVersionSelector.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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+
/* eslint-disable no-console */
5+
46
// NOTE: Since startWithVersionSelector.ts is loaded in the same process as start.ts, any dependencies that
57
// we import here may become side-by-side versions. We want to minimize any dependencies.
68
import * as path from 'path';

Diff for: apps/lockfile-explorer-web/src/App.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const App = (): JSX.Element => {
2626
dispatch(loadEntries(lockfile));
2727
}
2828
loadLockfileAsync().catch((e) => {
29+
// eslint-disable-next-line no-console
2930
console.log(`Failed to read lockfile: ${e}`);
3031
});
3132
}, []);

Diff for: apps/lockfile-explorer-web/src/components/ConnectionModal/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const ConnectionModal = (): JSX.Element | ReactNull => {
3131
setManualChecked(true);
3232
keepAliveAsync().catch((e) => {
3333
// Keep alive cannot fail
34+
// eslint-disable-next-line no-console
3435
console.error(`Unexpected exception: ${e}`);
3536
});
3637
}, []);

Diff for: apps/lockfile-explorer-web/src/containers/LockfileEntryDetailsView/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
5757
}
5858

5959
loadPackageJson(selectedEntry?.referrers || []).catch((e) => {
60+
// eslint-disable-next-line no-console
6061
console.error(`Failed to load referrers package.json: ${e}`);
6162
});
6263
if (selectedEntry) {
@@ -73,6 +74,7 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
7374
logDiagnosticInfo('No resolved entry for dependency:', dependencyToTrace);
7475
}
7576
} else if (selectedEntry) {
77+
// eslint-disable-next-line no-console
7678
console.log('dependency to trace: ', dependencyToTrace);
7779
setInspectDependency(dependencyToTrace);
7880

@@ -110,6 +112,7 @@ export const LockfileEntryDetailsView = (): JSX.Element | ReactNull => {
110112
// YAML file. If not, either something is wrong with our algorithm, or else
111113
// something has changed about how PNPM manages its "transitivePeerDependencies"
112114
// field.
115+
// eslint-disable-next-line no-console
113116
console.error(
114117
'Error analyzing influencers: A referrer appears to be missing its "transitivePeerDependencies" field in the YAML file: ',
115118
dependencyToTrace,

Diff for: apps/lockfile-explorer-web/src/containers/PackageJsonViewer/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const PackageJsonViewer = (): JSX.Element => {
4141
setPnpmfile(pnpmfile);
4242
}
4343
loadPnpmFileAsync().catch((e) => {
44+
// eslint-disable-next-line no-console
4445
console.error(`Failed to load project's pnpm file: ${e}`);
4546
});
4647
}, []);
@@ -60,10 +61,12 @@ export const PackageJsonViewer = (): JSX.Element => {
6061
if (selectedEntry) {
6162
if (selectedEntry.entryPackageName) {
6263
loadPackageDetailsAsync(selectedEntry.packageJsonFolderPath).catch((e) => {
64+
// eslint-disable-next-line no-console
6365
console.error(`Failed to load project information: ${e}`);
6466
});
6567
} else {
6668
// This is used to develop the lockfile explorer application in case there is a mistake in our logic
69+
// eslint-disable-next-line no-console
6770
console.log('The selected entry has no entry name: ', selectedEntry.entryPackageName);
6871
}
6972
}

Diff for: apps/lockfile-explorer-web/src/helpers/logDiagnosticInfo.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// problems with the algorithm.
66
export const logDiagnosticInfo = (...args: string[]): void => {
77
if (window.appContext.debugMode) {
8+
// eslint-disable-next-line no-console
89
console.log('Diagnostic: ', ...args);
910
}
1011
};

Diff for: apps/lockfile-explorer-web/src/parsing/LockfileDependency.ts

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export class LockfileDependency {
7171
new Path(containingEntry.packageJsonFolderPath).concat(relativePath)
7272
);
7373
if (!rootRelativePath) {
74+
// eslint-disable-next-line no-console
7475
console.error('No root relative path for dependency!', name);
7576
return;
7677
}
@@ -89,6 +90,7 @@ export class LockfileDependency {
8990
};
9091
this.entryId = 'Peer: ' + this.name;
9192
} else {
93+
// eslint-disable-next-line no-console
9294
console.error('Peer dependencies info missing!', node);
9395
}
9496
} else {

Diff for: apps/lockfile-explorer-web/src/parsing/LockfileEntry.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export class LockfileEntry {
7979
const packageName = new Path(rawEntryId).basename();
8080

8181
if (!packageJsonFolderPath || !packageName) {
82+
// eslint-disable-next-line no-console
8283
console.error('Could not construct path for entry: ', rawEntryId);
8384
return;
8485
}

Diff for: apps/lockfile-explorer-web/src/parsing/getPackageFiles.ts

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function readPnpmfileAsync(): Promise<string> {
2424
const response = await fetch(`${apiPath}/pnpmfile`);
2525
return await response.text();
2626
} catch (e) {
27+
// eslint-disable-next-line no-console
2728
console.error('Could not load cjs file: ', e);
2829
return 'Missing CJS';
2930
}
@@ -42,6 +43,7 @@ export async function readPackageJsonAsync(projectPath: string): Promise<IPackag
4243
});
4344
return await response.json();
4445
} catch (e) {
46+
// eslint-disable-next-line no-console
4547
console.error('Could not load package json file: ', e);
4648
return undefined;
4749
}
@@ -60,6 +62,7 @@ export async function readPackageSpecAsync(projectPath: string): Promise<IPackag
6062
});
6163
return await response.json();
6264
} catch (e) {
65+
// eslint-disable-next-line no-console
6366
console.error('Could not load cjs file: ', e);
6467
return undefined;
6568
}

Diff for: apps/lockfile-explorer-web/src/parsing/readLockfile.ts

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export function generateLockfileGraph(lockfile: ILockfilePackageType): LockfileE
182182
matchedEntry.referrers.push(entry);
183183
} else {
184184
// Local package
185+
// eslint-disable-next-line no-console
185186
console.error('Could not resolve dependency entryId: ', dependency.entryId, dependency);
186187
}
187188
}

Diff for: apps/lockfile-explorer-web/src/stub/initappcontext.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// from Webpack dev server. In a production release, a generated script is served by the
66
// Node.js service with the live context object.
77

8+
// eslint-disable-next-line no-console
89
console.log('Loaded stub/initappcontext.js');
910

1011
window.appContext = {

Diff for: apps/lockfile-explorer/.eslintrc.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ require('eslint-config-local/patch/modern-module-resolution');
33

44
module.exports = {
55
extends: ['eslint-config-local/profile/node'],
6-
parserOptions: { tsconfigRootDir: __dirname }
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
8+
overrides: [
9+
{
10+
files: ['*.ts', '*.tsx'],
11+
rules: {
12+
'no-console': 'off'
13+
}
14+
}
15+
]
716
};

Diff for: apps/rundown/.eslintrc.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ require('eslint-config-local/patch/modern-module-resolution');
33

44
module.exports = {
55
extends: ['eslint-config-local/profile/node-trusted-tool', 'eslint-config-local/mixins/friendly-locals'],
6-
parserOptions: { tsconfigRootDir: __dirname }
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
8+
overrides: [
9+
{
10+
files: ['*.ts', '*.tsx'],
11+
rules: {
12+
'no-console': 'off'
13+
}
14+
}
15+
]
716
};

Diff for: apps/rush/.eslintrc.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ require('eslint-config-local/patch/modern-module-resolution');
33

44
module.exports = {
55
extends: ['eslint-config-local/profile/node-trusted-tool', 'eslint-config-local/mixins/friendly-locals'],
6-
parserOptions: { tsconfigRootDir: __dirname }
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
8+
overrides: [
9+
{
10+
files: ['*.ts', '*.tsx'],
11+
rules: {
12+
'no-console': 'off'
13+
}
14+
}
15+
]
716
};

Diff for: apps/trace-import/.eslintrc.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@ require('eslint-config-local/patch/modern-module-resolution');
33

44
module.exports = {
55
extends: ['eslint-config-local/profile/node-trusted-tool', 'eslint-config-local/mixins/friendly-locals'],
6-
parserOptions: { tsconfigRootDir: __dirname }
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
8+
overrides: [
9+
{
10+
files: ['*.ts', '*.tsx'],
11+
rules: {
12+
'no-console': 'off'
13+
}
14+
}
15+
]
716
};

Diff for: build-tests-samples/heft-node-jest-tutorial/src/guide/02-manual-mock/SoundPlayer.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export class SoundPlayer {
1212
}
1313

1414
public playSoundFile(fileName: string): void {
15+
// eslint-disable-next-line no-console
1516
console.log('Playing sound file ' + fileName);
17+
// eslint-disable-next-line no-console
1618
console.log('Foo=' + this._foo);
1719
}
1820
}

Diff for: build-tests-samples/heft-node-jest-tutorial/src/guide/SoundPlayer.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export class SoundPlayer {
1212
}
1313

1414
public playSoundFile(fileName: string): void {
15+
// eslint-disable-next-line no-console
1516
console.log('Playing sound file ' + fileName);
17+
// eslint-disable-next-line no-console
1618
console.log('Foo=' + this._foo);
1719
}
1820
}

Diff for: build-tests-samples/heft-storybook-react-tutorial/src/ExampleApp.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class ExampleApp extends React.Component {
3131
// is bound correctly. This form does not work with virtual/override inheritance, so use regular methods
3232
// everywhere else.
3333
private _onToggle = (sender: ToggleSwitch, args: IToggleEventArgs): void => {
34+
// eslint-disable-next-line no-console
3435
console.log('Toggle switch changed: ' + args.sliderPosition);
3536
};
3637
}

Diff for: build-tests-samples/heft-web-rig-app-tutorial/src/ExampleApp.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class ExampleApp extends React.Component {
3333
// is bound correctly. This form does not work with virtual/override inheritance, so use regular methods
3434
// everywhere else.
3535
private _onToggle = (sender: ToggleSwitch, args: IToggleEventArgs): void => {
36+
// eslint-disable-next-line no-console
3637
console.log('Toggle switch changed: ' + args.sliderPosition);
3738
};
3839
}

Diff for: build-tests-samples/heft-webpack-basic-tutorial/src/ExampleApp.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class ExampleApp extends React.Component {
3131
// is bound correctly. This form does not work with virtual/override inheritance, so use regular methods
3232
// everywhere else.
3333
private _onToggle = (sender: ToggleSwitch, args: IToggleEventArgs): void => {
34+
// eslint-disable-next-line no-console
3435
console.log('Toggle switch changed: ' + args.sliderPosition);
3536
};
3637
}

Diff for: build-tests/heft-fastify-test/src/start.ts

+9
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@
33

44
import { fastify, type FastifyInstance } from 'fastify';
55

6+
// eslint-disable-next-line no-console
67
console.error('CHILD STARTING');
78
process.on('beforeExit', () => {
9+
// eslint-disable-next-line no-console
810
console.error('CHILD BEFOREEXIT');
911
});
1012
process.on('exit', () => {
13+
// eslint-disable-next-line no-console
1114
console.error('CHILD EXITED');
1215
});
1316
process.on('SIGINT', function () {
17+
// eslint-disable-next-line no-console
1418
console.error('CHILD SIGINT');
1519
});
1620
process.on('SIGTERM', function () {
21+
// eslint-disable-next-line no-console
1722
console.error('CHILD SIGTERM');
1823
});
1924

@@ -31,6 +36,7 @@ class MyApp {
3136
return { hello: 'world' };
3237
});
3338

39+
// eslint-disable-next-line no-console
3440
console.log('Listening on http://localhost:3000');
3541
await this.server.listen(3000);
3642
}
@@ -41,9 +47,12 @@ class MyApp {
4147
this.server.log.error(error);
4248

4349
if (error.stack) {
50+
// eslint-disable-next-line no-console
4451
console.error(error.stack);
52+
// eslint-disable-next-line no-console
4553
console.error();
4654
}
55+
// eslint-disable-next-line no-console
4756
console.error('ERROR: ' + error.toString());
4857
});
4958
}

Diff for: build-tests/heft-jest-reporters-test/src/test/customJestReporter.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,28 @@ module.exports = class CustomJestReporter implements Reporter {
1515
public constructor(globalConfig: Config.GlobalConfig, options: unknown) {}
1616

1717
public onRunStart(results: AggregatedResult, options: ReporterOnStartOptions): void | Promise<void> {
18+
// eslint-disable-next-line no-console
1819
console.log();
20+
// eslint-disable-next-line no-console
1921
console.log(`################# Custom Jest reporter: Starting test run #################`);
2022
}
2123

2224
public onTestStart(test: Test): void | Promise<void> {}
2325

2426
public onTestResult(test: Test, testResult: TestResult, results: AggregatedResult): void | Promise<void> {
27+
// eslint-disable-next-line no-console
2528
console.log('Custom Jest reporter: Reporting test result');
2629

2730
for (const result of testResult.testResults) {
31+
// eslint-disable-next-line no-console
2832
console.log(`${result.title}: ${result.status}`);
2933
}
3034
}
3135

3236
public onRunComplete(contexts: Set<TestContext>, results: AggregatedResult): void | Promise<void> {
37+
// eslint-disable-next-line no-console
3338
console.log('################# Completing test run #################');
39+
// eslint-disable-next-line no-console
3440
console.log();
3541
}
3642

Diff for: build-tests/heft-typescript-composite-test/src/chunks/ChunkClass.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
export class ChunkClass {
55
public doStuff(): void {
6+
// eslint-disable-next-line no-console
67
console.log('CHUNK');
78
}
89

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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+
// eslint-disable-next-line no-console
45
console.log('dostuff');
56

67
export {};

Diff for: build-tests/heft-webpack4-everything-test/src/chunks/ChunkClass.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
export class ChunkClass {
55
public doStuff(): void {
6+
// eslint-disable-next-line no-console
67
console.log('CHUNK');
78
}
89

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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+
// eslint-disable-next-line no-console
45
console.log('dostuff');
56

67
export {};

Diff for: build-tests/heft-webpack5-everything-test/src/chunks/ChunkClass.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
export class ChunkClass {
55
public doStuff(): void {
6+
// eslint-disable-next-line no-console
67
console.log('CHUNK');
78
}
89

0 commit comments

Comments
 (0)