Skip to content

Commit

Permalink
Fix linting issue (temporary solution) (#9928)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddeee888 authored Apr 22, 2024
1 parent 1ac08cc commit 227bb42
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 134 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ module.exports = {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['packages/**/*.{,c,m}ts{,x}'],
parserOptions: {
project: ['./tsconfig.json'],
},
},
],
ignorePatterns: [
'dev-test',
'website',
'examples/**/gql/**',
'examples/**',
'**/tests/test-files/**',
'**/tests/test-documents/**',
'**/react-app-env.d.ts',
'packages/presets/swc-plugin/tests/fixtures/simple-uppercase-operation-name.js',
'packages/presets/swc-plugin/tests/fixtures/simple-uppercase-operation-name.other-dir.js',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@babel/preset-typescript": "7.23.3",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@theguild/eslint-config": "0.11.3",
"@theguild/eslint-config": "0.11.7-rc-20240421131015-c5ed58486f6dd3c9cfc2745f03dc5e8f0adcd587",
"@theguild/prettier-config": "0.1.1",
"@types/jest": "28.1.8",
"babel-jest": "29.6.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,7 @@ export class BaseTypesVisitor<
let enumValue: string | number =
typeof schemaEnumValue === 'undefined' ? (enumOption.name as any) : schemaEnumValue;

if (
this.config.enumValues[typeName]?.mappedValues &&
typeof this.config.enumValues[typeName].mappedValues[enumValue] !== 'undefined'
) {
if (typeof this.config.enumValues[typeName]?.mappedValues?.[enumValue] !== 'undefined') {
enumValue = this.config.enumValues[typeName].mappedValues[enumValue];
}

Expand Down
5 changes: 1 addition & 4 deletions packages/plugins/typescript/typescript/src/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,7 @@ export class TsVisitor<
}

const getValueFromConfig = (enumValue: string | number) => {
if (
this.config.enumValues[enumName]?.mappedValues &&
typeof this.config.enumValues[enumName].mappedValues[enumValue] !== 'undefined'
) {
if (typeof this.config.enumValues[enumName]?.mappedValues?.[enumValue] !== 'undefined') {
return this.config.enumValues[enumName].mappedValues[enumValue];
}
return null;
Expand Down
Loading

0 comments on commit 227bb42

Please sign in to comment.