Skip to content

Commit

Permalink
Merge pull request #35 from OriginProtocol/chore--eslint-fix-generated
Browse files Browse the repository at this point in the history
chore: fix eslint for generated queries, remove ignore
  • Loading branch information
toniocodo authored Sep 13, 2023
2 parents 4c99c0d + b00b205 commit ae56911
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
dist
generated
14 changes: 13 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"extends": ["plugin:react/recommended", "plugin:prettier/recommended"],
"rules": {
// Nx rules
"@nx/enforce-module-boundaries": [
"error",
{
Expand All @@ -27,9 +28,13 @@
]
}
],
"@typescript-eslint/no-explicit-any": false,

// React rules
"react/react-in-jsx-scope": "off",

// General rules
"no-empty": ["error", { "allowEmptyCatch": true }],

// Unused imports rules
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
Expand Down Expand Up @@ -75,6 +80,13 @@
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.generated.ts", "*.generated.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
Expand Down
7 changes: 4 additions & 3 deletions libs/oeth/history/src/queries.generated.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as Types from '@origin/oeth/shared';

import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { graphqlClient } from '@origin/oeth/shared';
import { useQuery } from '@tanstack/react-query';

import type * as Types from '@origin/oeth/shared';
import type { UseQueryOptions } from '@tanstack/react-query';
export type HistoryTableQueryVariables = Types.Exact<{
addressId: Types.Scalars['String']['input'];
offset: Types.Scalars['Int']['input'];
Expand Down
1 change: 1 addition & 0 deletions libs/oeth/shared/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const config: CodegenConfig = {
schema: process.env.VITE_SUBSQUID_URL,
documents: ['**/src/**/*.graphql'],
plugins: ['typescript'],
hooks: { afterOneFileWrite: ['prettier --write', 'eslint --fix'] },
},
'libs/oeth/': {
schema: process.env.VITE_SUBSQUID_URL,
Expand Down

0 comments on commit ae56911

Please sign in to comment.