Skip to content

[ESLint] enable unicorn/prefer-at rule#3046

Merged
dimaMachina merged 2 commits intographql:mainfrom
dimaMachina:prefer-at
Mar 4, 2023
Merged

[ESLint] enable unicorn/prefer-at rule#3046
dimaMachina merged 2 commits intographql:mainfrom
dimaMachina:prefer-at

Conversation

@dimaMachina
Copy link
Copy Markdown
Collaborator

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 25, 2023

🦋 Changeset detected

Latest commit: 6f4e6d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
codemirror-graphql Patch
@graphiql/react Patch
@graphiql/toolkit Patch
graphql-language-service Patch
graphql-language-service-cli Patch
graphql-language-service-server Patch
@graphiql/plugin-explorer Patch
graphiql Patch
monaco-graphql Patch
vscode-graphql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines -47 to -64
function indent(
this: CodeMirror.Mode<any> & {
electricInput?: RegExp;
config?: CodeMirror.EditorConfiguration;
},
state: State,
textAfter: string,
) {
const { levels, indentLevel } = state;
// If there is no stack of levels, use the current level.
// Otherwise, use the top level, preemptively dedenting for close braces.
const level =
!levels || levels.length === 0
? indentLevel
: levels[levels.length - 1] -
(this.electricInput?.test(textAfter) ? 1 : 0);
return (level || 0) * (this.config?.indentUnit || 0);
}
Copy link
Copy Markdown
Collaborator Author

@dimaMachina dimaMachina Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw this same function copied in 2 other files, removed and just imported

!params.contentChanges ||
!params.textDocument.uri
) {
if (!params?.textDocument?.uri || !params.contentChanges) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified it

@dimaMachina dimaMachina merged commit b9c1332 into graphql:main Mar 4, 2023
@dimaMachina dimaMachina deleted the prefer-at branch March 4, 2023 11:52
@acao acao mentioned this pull request Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants