Skip to content

Commit

Permalink
[ESLint] enable unicorn/prefer-dom-node-remove (#3122)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina authored Apr 14, 2023
1 parent 5100700 commit e55be41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ module.exports = {
'sort-vars': 0,
'spaced-comment': ['error', 'always', { markers: ['/'] }],
'wrap-regex': 0,

'unicorn/prefer-dom-node-remove': 'error',
// ECMAScript 6 (http://eslint.org/docs/rules/#ecmascript-6)
'arrow-body-style': 0,
'no-duplicate-imports': 0,
Expand Down
4 changes: 2 additions & 2 deletions packages/codemirror-graphql/src/utils/info-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ function showPopup(cm: CodeMirror.Editor, box: DOMRect, info: HTMLDivElement) {
popup.style.opacity = '0';
setTimeout(() => {
if (popup.parentNode) {
popup.parentNode.removeChild(popup);
popup.remove();
}
}, 600);
} else if (popup.parentNode) {
popup.parentNode.removeChild(popup);
popup.remove();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('TypeDocumentation', () => {
const title = container.querySelector(
'.graphiql-doc-explorer-section-title',
);
title?.removeChild(title?.childNodes[0]);
title?.childNodes[0].remove();
expect(title).toHaveTextContent('Possible Types');
});

Expand All @@ -96,7 +96,7 @@ describe('TypeDocumentation', () => {
const title = container.querySelector(
'.graphiql-doc-explorer-section-title',
);
title?.removeChild(title?.childNodes[0]);
title?.childNodes[0].remove();
expect(title).toHaveTextContent('Enum Values');
const enums = container.querySelectorAll(
'.graphiql-doc-explorer-enum-value',
Expand All @@ -115,7 +115,7 @@ describe('TypeDocumentation', () => {
const title = container.querySelector(
'.graphiql-doc-explorer-section-title',
);
title?.removeChild(title?.childNodes[0]);
title?.childNodes[0].remove();
expect(title).toHaveTextContent('Enum Values');

let enums = container.querySelectorAll('.graphiql-doc-explorer-enum-value');
Expand All @@ -128,7 +128,7 @@ describe('TypeDocumentation', () => {
const deprecatedTitle = container.querySelectorAll(
'.graphiql-doc-explorer-section-title',
)[1];
deprecatedTitle.removeChild(deprecatedTitle.childNodes[0]);
deprecatedTitle.childNodes[0].remove();
expect(deprecatedTitle).toHaveTextContent('Deprecated Enum Values');

enums = container.querySelectorAll('.graphiql-doc-explorer-enum-value');
Expand Down

0 comments on commit e55be41

Please sign in to comment.