Skip to content

Commit

Permalink
manually update various tooling-related dependencies (apollographql#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas authored and Cellule committed Jan 22, 2025
1 parent 11c845d commit afdf22c
Show file tree
Hide file tree
Showing 31 changed files with 903 additions and 832 deletions.
4 changes: 2 additions & 2 deletions .api-reports/api-report-link_persisted-queries.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface BaseOptions {
// Warning: (ae-forgotten-export) The symbol "ApolloLink" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink & {
export const createPersistedQueryLink: (options: PersistedQueryLink.Options) => ApolloLink & ({
resetHashCache: () => void;
} & ({
getMemoryInternals(): {
Expand All @@ -73,7 +73,7 @@ export const createPersistedQueryLink: (options: PersistedQueryLink.Options) =>
};
} | {
getMemoryInternals?: undefined;
});
}));

// @public (undocumented)
interface DefaultContext extends Record<string, any> {
Expand Down
105 changes: 0 additions & 105 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .size-limits.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"dist/apollo-client.min.cjs": 41639,
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 34381
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 34382
}
11 changes: 7 additions & 4 deletions eslint-local-rules/testSetup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RuleTester } from "@typescript-eslint/rule-tester";
import tsParser from "@typescript-eslint/parser";
import nodeTest from "node:test";

RuleTester.it = nodeTest.it;
Expand All @@ -7,9 +8,11 @@ RuleTester.describe = nodeTest.describe;
RuleTester.afterAll = nodeTest.after;

export const ruleTester = new RuleTester({
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname + "/fixtures",
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname + "/fixtures",
},
},
});
175 changes: 175 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import _import from "eslint-plugin-import";
import localRules from "eslint-plugin-local-rules";
import { fixupPluginRules, fixupConfigRules } from "@eslint/compat";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import reactCompiler from "eslint-plugin-react-compiler";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
plugins: {
"@typescript-eslint": typescriptEslint,
import: fixupPluginRules(_import),
"local-rules": localRules,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: tsParser,
ecmaVersion: "latest",
sourceType: "commonjs",
},

settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},

"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
},
},

rules: {
"import/no-unresolved": "error",
},
},
...fixupConfigRules(compat.extends("plugin:react-hooks/recommended")).map(
(config) => ({
...config,
files: ["**/*.ts", "**/*.tsx"],
ignores: ["**/__tests__/**/*.*", "**/*.d.ts"],
})
),
{
files: ["**/*.ts", "**/*.tsx"],
ignores: ["**/__tests__/**/*.*", "**/*.d.ts"],

plugins: {
"react-compiler": reactCompiler,
},

languageOptions: {
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
project: [
"./tsconfig.json",
"./scripts/codemods/data-masking/tsconfig.json",
],
},
},

rules: {
"react-compiler/react-compiler": "error",

"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
disallowTypeAnnotations: false,
fixStyle: "separate-type-imports",
},
],

"@typescript-eslint/consistent-type-exports": ["error"],
"@typescript-eslint/no-import-type-side-effects": "error",

"@typescript-eslint/no-restricted-types": [
"error",
{
types: {
GraphQLError: {
message: "Use GraphQLFormattedError instead",
fixWith: "GraphQLFormattedError",
},

ExecutionResult: {
message: "Use FormattedExecutionResult instead",
fixWith: "FormattedExecutionResult",
},
},
},
],

"no-restricted-syntax": [
"error",
{
selector:
"ImportDeclaration[source.value='react'][importKind!='type'] :matches(ImportSpecifier, ImportDefaultSpecifier)",
message:
"Please only use the namespace import syntax (`import * as React from 'react'`) for React imports!",
},
],

"import/consistent-type-specifier-style": ["error", "prefer-top-level"],

"import/extensions": [
"error",
"always",
{
ignorePackages: true,
checkTypeImports: true,
},
],

"local-rules/require-using-disposable": "error",
},
},
...compat.extends("plugin:testing-library/react").map((config) => ({
...config,

files: [
"**/__tests__/**/*.[jt]s",
"**/__tests__/**/*.[jt]sx",
"**/?(*.)+(test).[jt]s",
"**/?(*.)+(test).[jt]sx",
],
})),
{
files: [
"**/__tests__/**/*.[jt]s",
"**/__tests__/**/*.[jt]sx",
"**/?(*.)+(test).[jt]s",
"**/?(*.)+(test).[jt]sx",
],

languageOptions: {
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
project: "./tsconfig.tests.json",
},
},

rules: {
"testing-library/prefer-user-event": "error",
"testing-library/no-wait-for-multiple-assertions": "off",
"local-rules/require-using-disposable": "error",
"local-rules/require-disable-act-environment": "error",
"local-rules/forbid-act-in-disabled-act-environment": "error",
"@typescript-eslint/no-floating-promises": "warn",
},
},
];
Loading

0 comments on commit afdf22c

Please sign in to comment.