Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled naming-convention eslint rule #1869

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions __tests__/backend/listFolders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import { SafeDriveService_ } from "../../src/backend/utils/SafeDriveService";
import { mockedSession } from "../test-utils/gas-stubs";
import { mockedSafeDriveService } from "../test-utils/SafeDriveService-stub";

/* eslint-disable @typescript-eslint/naming-convention -- Properties are mock classes */
jest.mock<{ SafeDriveService_: jest.Mock }>(
"../../src/backend/utils/SafeDriveService",
() => ({
SafeDriveService_: jest.fn(),
}),
);
/* eslint-enable */

test("listFolders works correctly", () => {
interface ListFilesOptions {
Expand Down
2 changes: 0 additions & 2 deletions __tests__/backend/listSharedDrives.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import { listSharedDrives } from "../../src/backend/listSharedDrives";
import { SafeDriveService_ } from "../../src/backend/utils/SafeDriveService";
import { mockedSafeDriveService } from "../test-utils/SafeDriveService-stub";

/* eslint-disable @typescript-eslint/naming-convention -- Properties are mock classes */
jest.mock<{ SafeDriveService_: jest.Mock }>(
"../../src/backend/utils/SafeDriveService",
() => ({
SafeDriveService_: jest.fn(),
}),
);
/* eslint-enable */

test("listSharedDrives works correctly", () => {
interface ListDrivesOptions {
Expand Down
2 changes: 0 additions & 2 deletions __tests__/backend/move.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { mockedMoveState } from "../test-utils/MoveState-stub";

jest.mock("../../src/backend/move/folderManagement");
jest.mock("../../src/backend/move/moveFolder");
/* eslint-disable @typescript-eslint/naming-convention -- Properties are mock classes */
jest.mock<{ SafeDriveService_: jest.Mock }>(
"../../src/backend/utils/SafeDriveService",
() => ({
Expand All @@ -23,7 +22,6 @@ jest.mock<{ MoveState_: jest.Mock }>(
MoveState_: jest.fn(),
}),
);
/* eslint-enable */

test("move works correctly", () => {
mocked(folderManagement).isFolderEmpty_.mockReturnValueOnce(true);
Expand Down
2 changes: 0 additions & 2 deletions __tests__/backend/utils/MoveState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import { MoveState_ } from "../../../src/backend/utils/MoveState";
import { mockedDriveBackedValue } from "../../test-utils/DriveBackedValue-stub";
import { mockedSafeDriveService } from "../../test-utils/SafeDriveService-stub";

// eslint-disable-next-line @typescript-eslint/naming-convention -- property is class name
jest.mock<{ DriveBackedValue_: jest.Mock }>(
"../../../src/backend/utils/DriveBackedValue",
() => ({
// eslint-disable-next-line @typescript-eslint/naming-convention -- Mocking a class
DriveBackedValue_: jest.fn(),
}),
);
Expand Down
4 changes: 0 additions & 4 deletions __tests__/test-utils/gas-stubs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { jest } from "@jest/globals";

/* eslint-disable @typescript-eslint/naming-convention -- These are stubs for external functions */

export function mockedCommentsCollection(): GoogleAppsScript.Drive.Collection.CommentsCollection {
return {
get: jest.fn<
Expand Down Expand Up @@ -470,5 +468,3 @@ export function mockedUtilities(): GoogleAppsScript.Utilities.Utilities {
>(),
};
}

/* eslint-enable */
35 changes: 0 additions & 35 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import svelte from "eslint-plugin-svelte";
import svelteParser from "svelte-eslint-parser";
import tseslint from "typescript-eslint";

/* eslint-disable @typescript-eslint/naming-convention -- Not applicable to this file */

export default tseslint.config(
js.configs.recommended,
prettierRecommended,
Expand Down Expand Up @@ -47,37 +45,6 @@ export default tseslint.config(
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/init-declarations": "error",
"@typescript-eslint/method-signature-style": ["error", "method"],
"@typescript-eslint/naming-convention": [
"error",
{
filter: {
match: false,
regex: "^(Comments|Drives|Files|Replies)$",
},
format: ["camelCase"],
leadingUnderscore: "allow",
selector: "default",
trailingUnderscore: "allow",
},
{
format: ["camelCase", "PascalCase"],
selector: "import",
},
{
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
selector: "variable",
trailingUnderscore: "allow",
},
{
custom: {
match: true,
regex: "^(?:[A-Z][A-Za-z]*_?)?$",
},
format: null,
selector: "typeLike",
},
],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unnecessary-parameter-property-assignment":
Expand Down Expand Up @@ -328,5 +295,3 @@ export default tseslint.config(
},
},
);

/* eslint-enable @typescript-eslint/naming-convention */
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default {
resetMocks: true,
testMatch: ["<rootDir>/__tests__/backend/**/*.test.ts"],
transform: {
// eslint-disable-next-line @typescript-eslint/naming-convention -- The key is a glob.
"^.+\\.ts$": [
"ts-jest",
{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/Drive-shim.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// eslint-disable-next-line no-var, @typescript-eslint/naming-convention -- GAS global, needs var
// eslint-disable-next-line no-var -- GAS global, needs var
declare var Drive: GoogleAppsScript.Drive_v2;
Loading