Skip to content

Commit

Permalink
setup @shopify/prefer-early-return and `sonarjs/no-inverted-boolean…
Browse files Browse the repository at this point in the history
…-check`
  • Loading branch information
dimaMachina committed Jun 24, 2023
1 parent 771aff5 commit 782e032
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ module.exports = {
Set: true,
},
rules: {
'@shopify/prefer-early-return':[ 'error', { maximumStatements: 2 }],
'@shopify/prefer-early-return': ['error', { maximumStatements: 2 }],
'sonarjs/no-inverted-boolean-check': 'error',
'@arthurgeron/react-usememo/require-usememo': [
'error',
{ checkHookCalls: false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export function findGraphQLTags(
};

const visitors = {
CallExpression(node: Expression) {
CallExpression(node: Expression) {
if (!('callee' in node)) {
return;

Check warning on line 205 in packages/graphql-language-service-server/src/findGraphQLTags.ts

View check run for this annotation

Codecov / codecov/patch

packages/graphql-language-service-server/src/findGraphQLTags.ts#L205

Added line #L205 was not covered by tests
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -970,14 +970,15 @@ export function getTokenAtPosition(
let stringAtCursor = null;
const token = runOnlineParser(queryText, (stream, state, style, index) => {
if (
index === cursor.line &&
stream.getCurrentPosition() + offset >= cursor.character + 1
index !== cursor.line ||
stream.getCurrentPosition() + offset < cursor.character + 1
) {
styleAtCursor = style;
stateAtCursor = { ...state };
stringAtCursor = stream.current();
return 'BREAK';
return;
}
styleAtCursor = style;
stateAtCursor = { ...state };
stringAtCursor = stream.current();
return 'BREAK';
});

// Return the state/style of parsed token in case those at cursor aren't
Expand Down

0 comments on commit 782e032

Please sign in to comment.