Skip to content

Commit

Permalink
Fix lint after eslint update
Browse files Browse the repository at this point in the history
  • Loading branch information
otahontas committed Jun 27, 2024
1 parent a290728 commit e6becb1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
41 changes: 23 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,46 @@ import { fileURLToPath } from "node:url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
allConfig: js.configs.all,
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended
allConfig: js.configs.all,
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

export default [{
export default [
{
ignores: ["**/dist/", "**/node_modules/", "**/.git/", "**/pnpm-lock.yaml"],
}, ...compat.extends(
},
...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:unicorn/recommended",
"plugin:perfectionist/recommended-natural",
), {
),
{
languageOptions: {
parser: tsParser,
parser: tsParser,
},

plugins: {
"@typescript-eslint": typescriptEslint,
"@typescript-eslint": typescriptEslint,
},

rules: {
"no-console": "error",
"no-console": "error",
},
}, {
},
{
files: ["**/test/**/*.ts", "**/test/**/*.tsx"],

rules: {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/no-null": "off",
"unicorn/no-useless-undefined": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/no-null": "off",
"unicorn/no-useless-undefined": "off",
},
}];
},
];
6 changes: 3 additions & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ export const enhanceApi = <
TagTypes
>,
>(
options: TRPCClientOptions<TRouter> & {
options: {
api: ExistingApi;
} & {
endpointOptions?: {
[K in keyof NewDefinitions]?: Omit<NewDefinitions[K], DisabledEndpointOptions>;
};
},
} & TRPCClientOptions<TRouter>,
) =>
wrapApiToProxy({
api: options.api as Api<
BaseQuery,
Endpoints & CreateEndpointDefinitions<TRouter, BaseQuery, ReducerPath, TagTypes>,
CreateEndpointDefinitions<TRouter, BaseQuery, ReducerPath, TagTypes> & Endpoints,
ReducerPath,
TagTypes,
SupportedModule
Expand Down
1 change: 0 additions & 1 deletion src/wrap-api-to-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const injectEndpointToApi = <Api extends Injectable, TRouter extends AnyRouter>(
// TODO: https://github.com/otahontas/trpc-rtk-query/issues/41
// eslint-disable-next-line @typescript-eslint/no-explicit-any
queryFn: (procedureArguments: unknown, api: any, extraOptions: any) =>
// eslint-disable-next-line unicorn/consistent-destructuring
createTRPCBaseQuery(options.tRPCClientOptions)(
{
procedureArguments,
Expand Down
3 changes: 0 additions & 3 deletions test/create-trpc-api.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ describe("create-trpc-api", () => {
.exclude<typeof skipToken>()
.toMatchTypeOf<{ deepInput: string }>();
expectTypeOf(
// eslint-disable-next-line unicorn/consistent-destructuring
api.endpoints.nested_Deep_GetVeryNestedMessage.useQuery,
).toBeFunction();

Expand Down Expand Up @@ -117,7 +116,6 @@ describe("create-trpc-api", () => {
});

it("allows injecting trpc api to existing api infering types from getclient", () => {
// eslint-disable-next-line unicorn/consistent-function-scoping
const getClient = async () => createTRPCProxyClient<AppRouter>(testClientOptions);

const api = enhanceApi({
Expand Down Expand Up @@ -176,7 +174,6 @@ describe("create-trpc-api", () => {
.exclude<typeof skipToken>()
.toMatchTypeOf<{ deepInput: string }>();
expectTypeOf(
// eslint-disable-next-line unicorn/consistent-destructuring
api.endpoints.nested_Deep_GetVeryNestedMessage.useQuery,
).toBeFunction();

Expand Down

0 comments on commit e6becb1

Please sign in to comment.