Skip to content

Commit ac778ce

Browse files
committed
Fix ESLint
1 parent 1ab5a19 commit ac778ce

File tree

4 files changed

+63
-23
lines changed

4 files changed

+63
-23
lines changed

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
"watch-build": "npx tsc-watch --project tsconfig.json --onSuccess \"bob build\"",
1616
"rebuild": "bob build --incremental",
1717
"test": "jest --forceExit --no-watchman",
18-
"lint": "eslint --cache --ignore-path .gitignore .",
18+
"lint": "cross-env \"ESLINT_USE_FLAT_CONFIG=false\" eslint --cache --ignore-path .gitignore .",
1919
"prettier": "prettier --cache --write --list-different .",
2020
"prettier:check": "prettier --cache --check .",
2121
"types:check": "tsc --noEmit",
2222
"test-and-build": "yarn build && yarn test",
23-
"ci:lint": "eslint --cache --ignore-path .gitignore --output-file eslint_report.json --format json .",
23+
"ci:lint": "cross-env \"ESLINT_USE_FLAT_CONFIG=false\" eslint --cache --ignore-path .gitignore --output-file eslint_report.json --format json .",
2424
"prerelease": "yarn build",
2525
"release": "changeset publish",
2626
"generate:examples:esm": "node packages/graphql-codegen-cli/dist/esm/bin.js --require dotenv/config --config ./dev-test/codegen.ts dotenv_config_path=dev-test/.env",
@@ -53,6 +53,7 @@
5353
"@types/jest": "28.1.8",
5454
"babel-jest": "29.6.4",
5555
"bob-the-bundler": "6.0.0",
56+
"cross-env": "7.0.3",
5657
"eslint": "9.6.0",
5758
"graphql": "16.8.0",
5859
"husky": "8.0.3",
@@ -72,7 +73,7 @@
7273
},
7374
"lint-staged": {
7475
"packages/**/src/**/*.{ts,tsx}": [
75-
"eslint --fix"
76+
"cross-env \"ESLINT_USE_FLAT_CONFIG=false\" eslint --fix"
7677
],
7778
"**/*.{js,jsx,cjs,mjs,ts,tsx,graphql,gql,yml,yaml,json,md}": [
7879
"prettier --write"
@@ -91,6 +92,7 @@
9192
"**/@types/graphql-upload/graphql": "^16.0.0",
9293
"ts-node": "10.9.1",
9394
"typescript": "5.2.2",
94-
"cosmiconfig": "8.1.3"
95+
"cosmiconfig": "8.1.3",
96+
"eslint-plugin-promise": "6.6.0"
9597
}
9698
}

packages/presets/client/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const preset: Types.OutputPreset<ClientPresetConfig> = {
114114
);
115115
}
116116

117+
// eslint-disable-next-line no-constant-binary-expression
117118
const isPersistedOperations = !!options.presetConfig?.persistedDocuments ?? false;
118119

119120
const reexports: Array<string> = [];
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/node_modules/@rushstack/eslint-patch/lib/_patch-base.js b/node_modules/@rushstack/eslint-patch/lib/_patch-base.js
2+
index df0b347..a4568b4 100644
3+
--- a/node_modules/@rushstack/eslint-patch/lib/_patch-base.js
4+
+++ b/node_modules/@rushstack/eslint-patch/lib/_patch-base.js
5+
@@ -181,10 +181,11 @@ if (isNaN(ESLINT_MAJOR_VERSION)) {
6+
throw new Error(`Unable to parse ESLint version "${exports.eslintPackageVersion}" in file "${eslintPackageJsonPath}"`);
7+
}
8+
if (!(ESLINT_MAJOR_VERSION >= 6 && ESLINT_MAJOR_VERSION <= 8)) {
9+
- throw new Error('The ESLint patch script has only been tested with ESLint version 6.x, 7.x, and 8.x.' +
10+
+ console.warn('The ESLint patch script has only been tested with ESLint version 6.x, 7.x, and 8.x.' +
11+
` (Your version: ${exports.eslintPackageVersion})\n` +
12+
'Consider reporting a GitHub issue:\n' +
13+
'https://github.com/microsoft/rushstack/issues');
14+
+ return;
15+
}
16+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
17+
let configArrayFactory;
18+
diff --git a/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js b/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js
19+
index 417a748..6abef9a 100644
20+
--- a/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js
21+
+++ b/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js
22+
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23+
const _patch_base_1 = require("./_patch-base");
24+
// error: "The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''"
25+
const isInvalidImporterPath = (ex) => (ex === null || ex === void 0 ? void 0 : ex.code) === 'ERR_INVALID_ARG_VALUE';
26+
-if (!_patch_base_1.configArrayFactory.__loadPluginPatched) {
27+
+if (_patch_base_1.configArrayFactory && !_patch_base_1.configArrayFactory.__loadPluginPatched) {
28+
_patch_base_1.configArrayFactory.__loadPluginPatched = true;
29+
// eslint-disable-next-line @typescript-eslint/typedef
30+
const originalLoadPlugin = _patch_base_1.configArrayFactory.prototype._loadPlugin;

yarn.lock

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,7 +4413,14 @@
44134413
dependencies:
44144414
"@types/unist" "^2"
44154415

4416-
"@types/node@*", "@types/[email protected]", "@types/node@^18.11.18":
4416+
"@types/node@*", "@types/node@^20.0.0":
4417+
version "20.11.19"
4418+
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.19.tgz#b466de054e9cb5b3831bee38938de64ac7f81195"
4419+
integrity sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==
4420+
dependencies:
4421+
undici-types "~5.26.4"
4422+
4423+
"@types/[email protected]", "@types/node@^18.11.18":
44174424
version "18.19.39"
44184425
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.39.tgz#c316340a5b4adca3aee9dcbf05de385978590593"
44194426
integrity sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==
@@ -4430,13 +4437,6 @@
44304437
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.45.tgz#a2b845b94faf76de3160c630ce8b07f957390ca5"
44314438
integrity sha512-Eu7U6/0P086nyPzeS41o2NvPVr16vWJMS5RdTzPF8XQaCPtq07E5GbR4fbcv5AYjy+zd0FYSV4p0WBdDXfPZzw==
44324439

4433-
"@types/node@^20.0.0":
4434-
version "20.11.19"
4435-
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.19.tgz#b466de054e9cb5b3831bee38938de64ac7f81195"
4436-
integrity sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==
4437-
dependencies:
4438-
undici-types "~5.26.4"
4439-
44404440
"@types/normalize-package-data@^2.4.0":
44414441
version "2.4.1"
44424442
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301"
@@ -4521,16 +4521,16 @@
45214521
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
45224522
integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==
45234523

4524-
"@types/unist@*", "@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2":
4525-
version "2.0.10"
4526-
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc"
4527-
integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==
4528-
4529-
"@types/unist@^3.0.0":
4524+
"@types/unist@*", "@types/unist@^3.0.0":
45304525
version "3.0.0"
45314526
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.0.tgz#988ae8af1e5239e89f9fbb1ade4c935f4eeedf9a"
45324527
integrity sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==
45334528

4529+
"@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2":
4530+
version "2.0.10"
4531+
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc"
4532+
integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==
4533+
45344534
"@types/ws@^8.0.0":
45354535
version "8.5.4"
45364536
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5"
@@ -6313,6 +6313,13 @@ create-require@^1.1.0:
63136313
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
63146314
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
63156315

6316+
6317+
version "7.0.3"
6318+
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
6319+
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
6320+
dependencies:
6321+
cross-spawn "^7.0.1"
6322+
63166323
cross-fetch@^3.1.5:
63176324
version "3.1.5"
63186325
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
@@ -6336,7 +6343,7 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
63366343
shebang-command "^1.2.0"
63376344
which "^1.2.9"
63386345

6339-
cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
6346+
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
63406347
version "7.0.3"
63416348
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
63426349
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
@@ -7618,10 +7625,10 @@ eslint-plugin-n@^17.0.0:
76187625
minimatch "^9.0.0"
76197626
semver "^7.5.3"
76207627

7621-
eslint-plugin-promise@^6.1.1:
7622-
version "6.1.1"
7623-
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz#269a3e2772f62875661220631bd4dafcb4083816"
7624-
integrity sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==
7628+
eslint-plugin-promise@6.6.0, eslint-plugin-promise@^6.1.1:
7629+
version "6.6.0"
7630+
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-6.6.0.tgz#acd3fd7d55cead7a10f92cf698f36c0aafcd717a"
7631+
integrity sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==
76257632

76267633
"eslint-plugin-react-hooks@^4.5.0 || 5.0.0-canary-7118f5dd7-20230705", eslint-plugin-react-hooks@^4.6.0:
76277634
version "4.6.0"

0 commit comments

Comments
 (0)