Skip to content

Commit

Permalink
Disabling of expensive rules
Browse files Browse the repository at this point in the history
  • Loading branch information
darrellwarde committed Oct 6, 2022
1 parent a62fe64 commit e584444
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/docs
**/examples
packages/graphql-toolbox/playwright.config.ts
**/coverage/lcov-report
12 changes: 9 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
module.exports = {
extends: ["eslint:recommended", "plugin:import/recommended", "prettier"],
extends: ["eslint:recommended", "plugin:eslint-comments/recommended", "plugin:import/recommended", "prettier"],
root: true,
env: {
node: true,
es2021: true,
},
rules: {
"eslint-comments/no-unused-disable": "error",
// Expensive rules disabled below
"import/default": "off",
"import/namespace": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
},
overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:eslint-comments/recommended",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
Expand All @@ -29,7 +36,6 @@ module.exports = {
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"eslint-comments/no-unused-disable": "error",
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion jest.config.base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
// eslint-disable-next-line import/no-extraneous-dependencies
require("dotenv").config({ path: path.join(__dirname, ".env") });

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion jest.global-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const setTZ = require("set-tz");

const TZ = "Etc/UTC";
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql/jest.global-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const setTZ = require("set-tz");
const neo4j = require("neo4j-driver");

Expand Down Expand Up @@ -33,9 +33,9 @@ module.exports = async function globalSetup() {
error.message.includes("Unsupported administration command") ||
error.message.includes("Unable to route write operation to leader for database 'system'")
) {
console.log(`\nJest /packages/graphql setup: Will NOT create a separate integration test database as the command is not supported in the current environment.`); // eslint-disable-line no-console
console.log(`\nJest /packages/graphql setup: Will NOT create a separate integration test database as the command is not supported in the current environment.`);
} else {
console.log(`\nJest /packages/graphql setup: Setup failure on neo4j @ ${NEO_URL}, cypher: "${cypherCreateDb}", Error: ${error.message}`); // eslint-disable-line no-console
console.log(`\nJest /packages/graphql setup: Setup failure on neo4j @ ${NEO_URL}, cypher: "${cypherCreateDb}", Error: ${error.message}`);
}
} finally {
if (session) await session.close();
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/jest.global-teardown.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module.exports = async function globalTeardown() {
error.message.includes("Unsupported administration command") ||
error.message.includes("Unable to route write operation to leader for database 'system'")
) {
console.log(`\nJest /packages/graphql teardown: Expected action - NO drop of database as not supported in the current environment.`); // eslint-disable-line no-console
console.log(`\nJest /packages/graphql teardown: Expected action - NO drop of database as not supported in the current environment.`);
} else {
console.log(`\nJest /packages/graphql teardown: Teardown failure on neo4j @ ${NEO_URL}, cypher: "${cypherDropDb}", Error: ${error.message}`); // eslint-disable-line no-console
console.log(`\nJest /packages/graphql teardown: Teardown failure on neo4j @ ${NEO_URL}, cypher: "${cypherDropDb}", Error: ${error.message}`);
}
} finally {
if (session) await session.close();
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/jest.minimal.global-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const setTZ = require("set-tz");

const TZ = "Etc/UTC";
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/jest.test-setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const jestExtended = require("jest-extended");

expect.extend(jestExtended);
2 changes: 1 addition & 1 deletion packages/package-tests/apollo/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function start(typeDefs = defaultTypeDefs, driver = {}) {
context: ({ req }) => ({ driver, req }),
});
const { url } = await server.listen();
// eslint-disable-next-line no-console
console.log(`🚀 Server ready at ${url}`);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/package-tests/apollo/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ async function main() {
if (!generatedTypeDefsMatch.test(printed)) {
throw new Error(`${generatedTypeDefsMatch} was not found in generated typeDefs`);
}
// eslint-disable-next-line no-console
console.log("Passed");

server.stop();
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
process.exit(1);
}
Expand Down

0 comments on commit e584444

Please sign in to comment.