Skip to content

Commit 980e3f8

Browse files
AllanZhengYPashika112stocaaro
authored
chore: add eslint rule no-console (#14306)
Co-authored-by: ashika112 <[email protected]> Co-authored-by: Aaron S. <[email protected]>
1 parent 90e2118 commit 980e3f8

File tree

8 files changed

+7
-2
lines changed

8 files changed

+7
-2
lines changed

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export default [
166166
'n/no-callback-literal': 'off',
167167
'object-shorthand': 'error',
168168
'prefer-destructuring': 'off',
169+
'no-console': 'error',
169170

170171
'promise/catch-or-return': [
171172
'error',

packages/adapter-nextjs/src/auth/utils/origin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const isValidOrigin = (origin: string | undefined): boolean => {
1717
url.hostname !== 'localhost' &&
1818
url.hostname !== '127.0.0.1'
1919
) {
20+
// eslint-disable-next-line no-console
2021
console.warn(
2122
'HTTP origin detected. This is insecure and should only be used for local development.',
2223
);

packages/core/__tests__/ConsoleLogger.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import { ConsoleLogger } from '../src';
23
import { LogType, LoggingProvider } from '../src/Logger/types';
34

packages/core/__tests__/storage/CookieStorage.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ describe('CookieStorage', () => {
5858
const testKey = encodeURIComponent('[email protected]');
5959
const testValue = '123';
6060
await cookieStore.setItem(testKey, testValue);
61-
console.log(document.cookie);
6261
expect(await cookieStore.getItem(testKey)).toEqual(testValue);
6362
});
6463

packages/core/src/BackgroundProcessManager/BackgroundProcessManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ export class BackgroundProcessManager {
373373
// Due to potential races with a job's natural completion, it's
374374
// reasonable to expect the termination call to fail. Hence,
375375
// not logging as an error.
376+
// eslint-disable-next-line no-console
376377
console.warn(
377378
`Failed to send termination signal to job. Error: ${
378379
(error as Error).message

packages/core/src/Logger/ConsoleLogger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
// SPDX-License-Identifier: Apache-2.0
34

packages/datastore/src/datastore/datastore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
// SPDX-License-Identifier: Apache-2.0
34
import { InternalAPI } from '@aws-amplify/api/internals';

packages/storage/__tests__/providers/s3/utils/client/s3Data/createMultipartUpload.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('createMultipartUploadSerializer', () => {
6767
Bucket: 'bucket',
6868
Key: 'key',
6969
});
70-
console.log(output);
70+
7171
expect(output).toEqual({
7272
$metadata: expect.objectContaining(expectedMetadata),
7373
});

0 commit comments

Comments
 (0)