Skip to content

Commit

Permalink
[ESLint] enable logical-assignment-operators rule (#3036)
Browse files Browse the repository at this point in the history
* enable `logical-assignment-operators` rule

* Update GraphQLCache.ts

* format
  • Loading branch information
dimaMachina authored Feb 24, 2023
1 parent 708c428 commit 7a89c7d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ module.exports = {
'promise/no-multiple-resolved': 'error',
'sonarjs/no-redundant-jump': 'error',
'unicorn/prefer-logical-operator-over-ternary': 'error',
'logical-assignment-operators': [
'error',
'always',
{ enforceForIfStatements: true },
],
'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }],
'unicorn/throw-new-error': 'error',
'unicorn/prefer-includes': 'error',
Expand Down
14 changes: 6 additions & 8 deletions examples/monaco-graphql-webpack/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ async function render() {

return;
}
if (!monacoGraphQLAPI) {
monacoGraphQLAPI = initializeMode({
formattingOptions: {
prettierConfig: {
printWidth: 120,
},
monacoGraphQLAPI ||= initializeMode({
formattingOptions: {
prettierConfig: {
printWidth: 120,
},
});
}
},
});

document.getElementById('github-login-wrapper')?.remove();
document
Expand Down
5 changes: 1 addition & 4 deletions packages/graphql-language-service-server/src/GraphQLCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ export async function getGraphQLCache({
loadConfigOptions: LoadConfigOptions;
config?: GraphQLConfig;
}): Promise<GraphQLCache> {
let graphQLConfig = config;
if (!graphQLConfig) {
graphQLConfig = await loadConfig(loadConfigOptions);
}
const graphQLConfig = config || (await loadConfig(loadConfigOptions));
return new GraphQLCache({
configDir: loadConfigOptions.rootDir as string,
config: graphQLConfig as GraphQLConfig,
Expand Down

0 comments on commit 7a89c7d

Please sign in to comment.