Skip to content

Commit 12ecde9

Browse files
authored
manually update various tooling-related dependencies (#12286)
1 parent eeb5f3c commit 12ecde9

31 files changed

+903
-832
lines changed

.api-reports/api-report-link_persisted-queries.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ interface BaseOptions {
6363
// Warning: (ae-forgotten-export) The symbol "ApolloLink" needs to be exported by the entry point index.d.ts
6464
//
6565
// @public (undocumented)
66-
export const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink & {
66+
export const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink & ({
6767
resetHashCache: () => void;
6868
} & ({
6969
getMemoryInternals(): {
@@ -73,7 +73,7 @@ export const createPersistedQueryLink: (options: PersistedQueryLink.Options) =>
7373
};
7474
} | {
7575
getMemoryInternals?: undefined;
76-
});
76+
}));
7777

7878
// @public (undocumented)
7979
interface DefaultContext extends Record<string, any> {

.eslintrc

-105
This file was deleted.

.size-limits.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"dist/apollo-client.min.cjs": 41639,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 34381
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 34382
44
}

eslint-local-rules/testSetup.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { RuleTester } from "@typescript-eslint/rule-tester";
2+
import tsParser from "@typescript-eslint/parser";
23
import nodeTest from "node:test";
34

45
RuleTester.it = nodeTest.it;
@@ -7,9 +8,11 @@ RuleTester.describe = nodeTest.describe;
78
RuleTester.afterAll = nodeTest.after;
89

910
export const ruleTester = new RuleTester({
10-
parser: "@typescript-eslint/parser",
11-
parserOptions: {
12-
project: "./tsconfig.json",
13-
tsconfigRootDir: __dirname + "/fixtures",
11+
languageOptions: {
12+
parser: tsParser,
13+
parserOptions: {
14+
project: "./tsconfig.json",
15+
tsconfigRootDir: __dirname + "/fixtures",
16+
},
1417
},
1518
});

eslint.config.mjs

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
2+
import _import from "eslint-plugin-import";
3+
import localRules from "eslint-plugin-local-rules";
4+
import { fixupPluginRules, fixupConfigRules } from "@eslint/compat";
5+
import globals from "globals";
6+
import tsParser from "@typescript-eslint/parser";
7+
import reactCompiler from "eslint-plugin-react-compiler";
8+
import path from "node:path";
9+
import { fileURLToPath } from "node:url";
10+
import js from "@eslint/js";
11+
import { FlatCompat } from "@eslint/eslintrc";
12+
13+
const __filename = fileURLToPath(import.meta.url);
14+
const __dirname = path.dirname(__filename);
15+
const compat = new FlatCompat({
16+
baseDirectory: __dirname,
17+
recommendedConfig: js.configs.recommended,
18+
allConfig: js.configs.all,
19+
});
20+
21+
export default [
22+
{
23+
plugins: {
24+
"@typescript-eslint": typescriptEslint,
25+
import: fixupPluginRules(_import),
26+
"local-rules": localRules,
27+
},
28+
29+
languageOptions: {
30+
globals: {
31+
...globals.browser,
32+
...globals.node,
33+
},
34+
35+
parser: tsParser,
36+
ecmaVersion: "latest",
37+
sourceType: "commonjs",
38+
},
39+
40+
settings: {
41+
"import/parsers": {
42+
"@typescript-eslint/parser": [".ts", ".tsx"],
43+
},
44+
45+
"import/resolver": {
46+
typescript: {
47+
alwaysTryTypes: true,
48+
},
49+
},
50+
},
51+
52+
rules: {
53+
"import/no-unresolved": "error",
54+
},
55+
},
56+
...fixupConfigRules(compat.extends("plugin:react-hooks/recommended")).map(
57+
(config) => ({
58+
...config,
59+
files: ["**/*.ts", "**/*.tsx"],
60+
ignores: ["**/__tests__/**/*.*", "**/*.d.ts"],
61+
})
62+
),
63+
{
64+
files: ["**/*.ts", "**/*.tsx"],
65+
ignores: ["**/__tests__/**/*.*", "**/*.d.ts"],
66+
67+
plugins: {
68+
"react-compiler": reactCompiler,
69+
},
70+
71+
languageOptions: {
72+
ecmaVersion: 5,
73+
sourceType: "script",
74+
75+
parserOptions: {
76+
project: [
77+
"./tsconfig.json",
78+
"./scripts/codemods/data-masking/tsconfig.json",
79+
],
80+
},
81+
},
82+
83+
rules: {
84+
"react-compiler/react-compiler": "error",
85+
86+
"@typescript-eslint/consistent-type-imports": [
87+
"error",
88+
{
89+
prefer: "type-imports",
90+
disallowTypeAnnotations: false,
91+
fixStyle: "separate-type-imports",
92+
},
93+
],
94+
95+
"@typescript-eslint/consistent-type-exports": ["error"],
96+
"@typescript-eslint/no-import-type-side-effects": "error",
97+
98+
"@typescript-eslint/no-restricted-types": [
99+
"error",
100+
{
101+
types: {
102+
GraphQLError: {
103+
message: "Use GraphQLFormattedError instead",
104+
fixWith: "GraphQLFormattedError",
105+
},
106+
107+
ExecutionResult: {
108+
message: "Use FormattedExecutionResult instead",
109+
fixWith: "FormattedExecutionResult",
110+
},
111+
},
112+
},
113+
],
114+
115+
"no-restricted-syntax": [
116+
"error",
117+
{
118+
selector:
119+
"ImportDeclaration[source.value='react'][importKind!='type'] :matches(ImportSpecifier, ImportDefaultSpecifier)",
120+
message:
121+
"Please only use the namespace import syntax (`import * as React from 'react'`) for React imports!",
122+
},
123+
],
124+
125+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
126+
127+
"import/extensions": [
128+
"error",
129+
"always",
130+
{
131+
ignorePackages: true,
132+
checkTypeImports: true,
133+
},
134+
],
135+
136+
"local-rules/require-using-disposable": "error",
137+
},
138+
},
139+
...compat.extends("plugin:testing-library/react").map((config) => ({
140+
...config,
141+
142+
files: [
143+
"**/__tests__/**/*.[jt]s",
144+
"**/__tests__/**/*.[jt]sx",
145+
"**/?(*.)+(test).[jt]s",
146+
"**/?(*.)+(test).[jt]sx",
147+
],
148+
})),
149+
{
150+
files: [
151+
"**/__tests__/**/*.[jt]s",
152+
"**/__tests__/**/*.[jt]sx",
153+
"**/?(*.)+(test).[jt]s",
154+
"**/?(*.)+(test).[jt]sx",
155+
],
156+
157+
languageOptions: {
158+
ecmaVersion: 5,
159+
sourceType: "script",
160+
161+
parserOptions: {
162+
project: "./tsconfig.tests.json",
163+
},
164+
},
165+
166+
rules: {
167+
"testing-library/prefer-user-event": "error",
168+
"testing-library/no-wait-for-multiple-assertions": "off",
169+
"local-rules/require-using-disposable": "error",
170+
"local-rules/require-disable-act-environment": "error",
171+
"local-rules/forbid-act-in-disabled-act-environment": "error",
172+
"@typescript-eslint/no-floating-promises": "warn",
173+
},
174+
},
175+
];

0 commit comments

Comments
 (0)