Skip to content

Commit 2593106

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
lint: rename no-widget-show-document-body > no-document-body-mutation
Bug: 421811012 Change-Id: Iaf44afa038277b09e7d45cc7a4ccfdb5b0a007a0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6611008 Commit-Queue: Alex Rudenko <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Jack Franklin <[email protected]>
1 parent 1db1231 commit 2593106

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
lines changed

eslint.config.mjs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import eslintPlugin from 'eslint-plugin-eslint-plugin';
77
import importPlugin from 'eslint-plugin-import';
88
import jsdocPlugin from 'eslint-plugin-jsdoc';
99
import mochaPlugin from 'eslint-plugin-mocha';
10-
import { defineConfig, globalIgnores } from 'eslint/config';
10+
import {defineConfig, globalIgnores} from 'eslint/config';
1111
import globals from 'globals';
12-
import { join } from 'path';
12+
import {join} from 'path';
1313
import typescriptEslint from 'typescript-eslint';
1414

1515
import rulesdirPlugin from './scripts/eslint_rules/rules-dir.mjs';
@@ -193,7 +193,7 @@ export default defineConfig([
193193
radix: 'error',
194194
'valid-typeof': 'error',
195195
'no-return-assign': ['error', 'always'],
196-
'no-implicit-coercion': ['error', { allow: ['!!'] }],
196+
'no-implicit-coercion': ['error', {allow: ['!!']}],
197197

198198
'no-array-constructor': 'error',
199199

@@ -305,11 +305,11 @@ export default defineConfig([
305305
parserOptions: {
306306
allowAutomaticSingleRunInference: true,
307307
project: join(
308-
import.meta.dirname,
309-
'config',
310-
'typescript',
311-
'tsconfig.eslint.json',
312-
),
308+
import.meta.dirname,
309+
'config',
310+
'typescript',
311+
'tsconfig.eslint.json',
312+
),
313313
},
314314
},
315315

@@ -554,12 +554,12 @@ export default defineConfig([
554554
{
555555
// Enforce that any import of models/trace/trace.js names the import Trace.
556556
modulePath: join(
557-
import.meta.dirname,
558-
'front_end',
559-
'models',
560-
'trace',
561-
'trace.js',
562-
),
557+
import.meta.dirname,
558+
'front_end',
559+
'models',
560+
'trace',
561+
'trace.js',
562+
),
563563
importName: 'Trace',
564564
},
565565
],
@@ -704,7 +704,7 @@ export default defineConfig([
704704
'rulesdir/prefer-sinon-assert': 'error',
705705
'rulesdir/prefer-url-string': 'error',
706706
'rulesdir/trace-engine-test-timeouts': 'error',
707-
'rulesdir/no-widget-show-document-body': 'error',
707+
'rulesdir/no-document-body-mutation': 'error',
708708
'rulesdir/enforce-custom-element-definitions-location': 'off',
709709
},
710710

front_end/testing/DOMHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const setupTestDOM = async () => {
7979
const newContainer = document.createElement('div');
8080
newContainer.id = TEST_CONTAINER_ID;
8181

82-
// eslint-disable-next-line rulesdir/no-widget-show-document-body
82+
// eslint-disable-next-line rulesdir/no-document-body-mutation
8383
document.body.appendChild(newContainer);
8484
};
8585

scripts/eslint_rules/lib/no-widget-show-document-body.ts renamed to scripts/eslint_rules/lib/no-document-body-mutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function isDocumentBodyMethodCallToAddDOM(node: TSESTree.Node): node is TSESTree
5757
}
5858

5959
export default createRule({
60-
name: 'no-widget-show-document-body',
60+
name: 'no-document-body-mutation',
6161
meta: {
6262
type: 'problem',
6363

scripts/eslint_rules/tests/no-widget-show-document-body.test.ts renamed to scripts/eslint_rules/tests/no-document-body-mutation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright 2020 The Chromium Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
import rule from '../lib/no-widget-show-document-body.ts';
4+
import rule from '../lib/no-document-body-mutation.ts';
55

66
import {RuleTester} from './utils/RuleTester.ts';
77

8-
new RuleTester().run('no-widget-show-document-body', rule, {
8+
new RuleTester().run('no-document-body-mutation', rule, {
99
valid: [
1010
{
1111
code: `const div = document.createElement('div');

test/e2e/issues/cookie-domain-attribute-non-ascii_test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ describe('Cookie domain attribute should not contain non-ASCII characters issue'
3030
img.onerror = c;
3131
});
3232
img.src = './issues/cookie-domain-non-ascii.rawresponse';
33-
// This rule only applies to unit tests. TODO(crbug.com/421811012) update
34-
// the rule so it is only run on front_end unit test files.
35-
// eslint-disable-next-line rulesdir/no-widget-show-document-body
33+
// This rule is only relevant for unit tests.
34+
// eslint-disable-next-line rulesdir/no-document-body-mutation
3635
document.body.appendChild(img);
3736
await done;
3837
});

0 commit comments

Comments
 (0)