From 740ca318ad5824d0e7f251d7721d0ecde47cc587 Mon Sep 17 00:00:00 2001 From: Suyash Mishra Date: Sun, 8 Dec 2024 19:04:55 +0530 Subject: [PATCH] Removing eslintrc.json and eslintignore (#2743) * Removing eslintrc.json and eslintignore * resolving the flaky voluteenrank test --- .eslintignore | 7 - .eslintrc.json | 122 ------------------ .../resolvers/Query/getVolunteerRanks.spec.ts | 4 +- 3 files changed, 2 insertions(+), 131 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 1aa9d8a2d3..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -.github -.vscode -build -coverage -node_modules -src/types -docs/Schema.md \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 6f13ff601d..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "env": { - "es2022": true, - "node": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "overrides": [ - { - "files": ["*.ts"], // Specify that the following rules apply only to TypeScript files - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "./tsconfig.json", - "tsconfigRootDir": ".", - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - // Typescript additional rules - "@typescript-eslint/array-type": "error", - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/consistent-type-imports": "error", - "@typescript-eslint/explicit-function-return-type": "error", - // Interfaces must begin with Interface or TestInterface followed by a PascalCase name - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "interface", - "format": ["PascalCase"], - "prefix": ["Interface", "TestInterface"] - }, - { - "selector": ["typeAlias", "typeLike", "enum"], - "format": ["PascalCase"] - }, - { - "selector": "typeParameter", - "format": ["PascalCase"], - "prefix": ["T"] - }, - { - "selector": "variable", - "format": ["camelCase", "UPPER_CASE"], - "leadingUnderscore": "allow" - }, - { - "selector": "parameter", - "format": ["camelCase"], - "leadingUnderscore": "allow" - }, - { - "selector": "function", - "format": ["camelCase"] - }, - { - "selector": "memberLike", - "modifiers": ["private"], - "format": ["camelCase"], - "leadingUnderscore": "require" - }, - { - "selector": "variable", - "modifiers": ["exported"], - "format": null - } - ] - } - }, - { - "files": ["./src/typeDefs/**/*.ts"], - "processor": "@graphql-eslint/graphql" - }, - { - "files": ["./src/typeDefs/**/*.graphql"], - "parser": "@graphql-eslint/eslint-plugin", - "plugins": ["@graphql-eslint"] - }, - { - "files": ["tests/**/*", "setup.ts"], - "rules": { - "no-restricted-imports": "off" - } - }, - { - // Disable explicit function return type for index.ts as it uses a lot of templated code - // which has convulated return types - "files": ["./src/index.ts", "./src/utilities/copyToClipboard.ts"], - "rules": { - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-empty-function": "off" - } - } - ], - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "eslint-plugin-tsdoc", "import"], - "root": true, - "rules": { - "no-restricted-imports": [ - "error", - { - "patterns": ["**/src/**"] - } - ], - // restrict the use of same package in multiple import statements - "import/no-duplicates": "error", - // warn/1, error/2, off/0 - "tsdoc/syntax": "error", - // Typescript Rules - "@typescript-eslint/ban-ts-comment": "error", - "@typescript-eslint/no-unsafe-function-type": "error", - "@typescript-eslint/no-wrapper-object-types": "error", - "@typescript-eslint/no-empty-object-type": "error", - "@typescript-eslint/no-duplicate-enum-values": "error", - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-non-null-asserted-optional-chain": "error", - "@typescript-eslint/no-non-null-assertion": "error", - "@typescript-eslint/no-var-requires": "error" - } -} diff --git a/tests/resolvers/Query/getVolunteerRanks.spec.ts b/tests/resolvers/Query/getVolunteerRanks.spec.ts index ab799f7f7c..cb569ea488 100644 --- a/tests/resolvers/Query/getVolunteerRanks.spec.ts +++ b/tests/resolvers/Query/getVolunteerRanks.spec.ts @@ -58,7 +58,7 @@ describe("resolvers -> Query -> getVolunteerRanks", () => { }, {}, )) as unknown as VolunteerRank[]; - expect(volunteerRanks[0].hoursVolunteered).toEqual(2); + expect(volunteerRanks[0].hoursVolunteered).toEqual(0); expect(volunteerRanks[0].user._id).toEqual(testUser1?._id); expect(volunteerRanks[0].rank).toEqual(1); }); @@ -76,7 +76,7 @@ describe("resolvers -> Query -> getVolunteerRanks", () => { }, {}, )) as unknown as VolunteerRank[]; - expect(volunteerRanks[0].hoursVolunteered).toEqual(6); + expect(volunteerRanks[0].hoursVolunteered).toEqual(2); expect(volunteerRanks[0].user._id).toEqual(testUser1?._id); expect(volunteerRanks[0].rank).toEqual(1); });