Skip to content

Commit d359b7c

Browse files
authored
Revert "Sync fork with chromium/7103 (#170)" (#171)
This reverts commit f2a508f.
1 parent f2a508f commit d359b7c

File tree

26,247 files changed

+1135282
-2790241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

26,247 files changed

+1135282
-2790241
lines changed

.eslintignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
front_end/.eslintrc.js
2+
front_end/diff/diff_match_patch.jD
3+
front_end/models/javascript_metadata/NativeFunctions.js
4+
front_end/models/javascript_metadata/DOMPinnedProperties.ts
5+
6+
// All of the scripts in this folder are auto-generated so don't lint them.
7+
front_end/generated/
8+
9+
// Any third_party addition has its source code checked out into
10+
// third_party/X/package, so we ignore that code as it's not code we author or
11+
// own.
12+
front_end/third_party/*/package/
13+
// Any JS files are also not authored by devtools-frontend, so we ignore those.
14+
front_end/third_party/**/*.js
15+
// Lighthouse doesn't have a package/ folder but has other nested folders, so
16+
// we ignore any folders within the lighthouse directory.
17+
front_end/third_party/lighthouse/*/
18+
// The CodeMirror bundle file is auto-generated and rolled-up as part of the
19+
// install script, so we don't need to lint it.
20+
front_end/third_party/codemirror.next/bundle.ts
21+
// Lit lib files are auto-generated and rolled up as part of the install script.
22+
front_end/third_party/lit/src/*.ts
23+
// @puppeteer/replay is auto-generated.
24+
front_end/third_party/puppeteer-replay/**/*.ts
25+
26+
extensions/cxx_debugging/third_party/
27+
28+
node_modules
29+
scripts/migration/**/*.js
30+
scripts/protocol_typescript/*.js
31+
scripts/deps/tests/fixtures
32+
test/**/fixtures/
33+
test/e2e/**/*.js
34+
test/shared/**/*.js
35+
36+
*.d.ts

.eslintrc.js

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
// Copyright 2020 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// clang-format off
6+
7+
const path = require('path');
8+
const rulesDirPlugin = require('eslint-plugin-rulesdir');
9+
rulesDirPlugin.RULES_DIR = path.join(__dirname, 'scripts', 'eslint_rules', 'lib');
10+
11+
module.exports = {
12+
'root': true,
13+
14+
'env': {'browser': true, 'es6': true},
15+
16+
'parser': '@typescript-eslint/parser',
17+
18+
'plugins': [
19+
'@typescript-eslint',
20+
'mocha',
21+
'rulesdir',
22+
'import',
23+
'jsdoc',
24+
],
25+
26+
'parserOptions': {'ecmaVersion': 9, 'sourceType': 'module'},
27+
28+
/**
29+
* ESLint rules
30+
*
31+
* All available rules: http://eslint.org/docs/rules/
32+
*/
33+
'rules': {
34+
/**
35+
* Enforced rules
36+
*/
37+
38+
// syntax preferences
39+
'quotes': ['error', 'single', {'avoidEscape': true, 'allowTemplateLiterals': false}],
40+
'semi': 'error',
41+
'no-extra-semi': 'error',
42+
'comma-style': ['error', 'last'],
43+
'wrap-iife': ['error', 'inside'],
44+
'spaced-comment': ['error', 'always', {'markers': ['*']}],
45+
'eqeqeq': 'error',
46+
'accessor-pairs': ['error', {'getWithoutSet': false, 'setWithoutGet': false}],
47+
'curly': 'error',
48+
'new-parens': 'error',
49+
'func-call-spacing': 'error',
50+
'arrow-parens': ['error', 'as-needed'],
51+
'eol-last': 'error',
52+
53+
// anti-patterns
54+
'no-caller': 'error',
55+
'no-case-declarations': 'error',
56+
'no-cond-assign': 'error',
57+
'no-console': ['error', {'allow': ['assert', 'context', 'error', 'timeStamp', 'time', 'timeEnd', 'warn']}],
58+
'no-debugger': 'error',
59+
'no-dupe-keys': 'error',
60+
'no-duplicate-case': 'error',
61+
'no-else-return': ['error', {'allowElseIf': false}],
62+
'no-empty-character-class': 'error',
63+
'no-global-assign': 'error',
64+
'no-implied-eval': 'error',
65+
'no-labels': 'error',
66+
'no-multi-str': 'error',
67+
'no-new-object': 'error',
68+
'no-octal-escape': 'error',
69+
'no-self-compare': 'error',
70+
'no-shadow-restricted-names': 'error',
71+
'no-unreachable': 'error',
72+
'no-unsafe-negation': 'error',
73+
'no-unused-vars': ['error', {'args': 'none', 'vars': 'local'}],
74+
'no-var': 'error',
75+
'no-with': 'error',
76+
'prefer-const': 'error',
77+
'radix': 'error',
78+
'valid-typeof': 'error',
79+
'no-return-assign': ['error', 'always'],
80+
'no-implicit-coercion': 'error',
81+
82+
// es2015 features
83+
'require-yield': 'error',
84+
'template-curly-spacing': ['error', 'never'],
85+
86+
// file whitespace
87+
'no-multiple-empty-lines': ['error', {'max': 1}],
88+
'no-mixed-spaces-and-tabs': 'error',
89+
'no-trailing-spaces': 'error',
90+
'linebreak-style': ['error', 'unix'],
91+
92+
/**
93+
* Disabled, aspirational rules
94+
*/
95+
96+
'indent': ['off', 2, {'SwitchCase': 1, 'CallExpression': {'arguments': 2}, 'MemberExpression': 2}],
97+
98+
// brace-style is disabled, as eslint cannot enforce 1tbs as default, but allman for functions
99+
'brace-style': ['off', 'allman', {'allowSingleLine': true}],
100+
101+
// key-spacing is disabled, as some objects use value-aligned spacing, some not.
102+
'key-spacing': ['off', {'beforeColon': false, 'afterColon': true, 'align': 'value'}],
103+
// quote-props is diabled, as property quoting styles are too varied to enforce.
104+
'quote-props': ['off', 'as-needed'],
105+
106+
// no-implicit-globals will prevent accidental globals
107+
'no-implicit-globals': 'off',
108+
'no-unused-private-class-members': 'error',
109+
110+
// forbids interfaces starting with an I prefix.
111+
'@typescript-eslint/naming-convention':
112+
['error', {'selector': 'interface', 'format': ['PascalCase'], 'custom': {'regex': '^I[A-Z]', 'match': false}}],
113+
'@typescript-eslint/explicit-member-accessibility': 'off',
114+
'@typescript-eslint/no-explicit-any': [
115+
"error",
116+
{
117+
"ignoreRestArgs": true
118+
}
119+
],
120+
121+
// Closure does not properly typecheck default exports
122+
'import/no-default-export': 'error',
123+
124+
/**
125+
* Catch duplicate import paths. For example this would catch the following example:
126+
* import {Foo} from './foo.js'
127+
* import * as FooModule from './foo.js'
128+
**/
129+
'import/no-duplicates': 'error',
130+
131+
// Try to spot '// console.log()' left over from debugging
132+
'rulesdir/commented_out_console': 'error',
133+
134+
// Prevent imports being commented out rather than deleted.
135+
'rulesdir/commented_out_import': 'error',
136+
137+
// DevTools specific rules
138+
'rulesdir/es_modules_import': 'error',
139+
'rulesdir/check_license_header': 'error',
140+
/**
141+
* Ensures that JS Doc comments are properly aligned - all the starting
142+
* `*` are in the right place.
143+
*/
144+
'jsdoc/check-alignment': 'error',
145+
},
146+
'overrides': [{
147+
'files': ['*.ts'],
148+
'parserOptions': {
149+
'allowAutomaticSingleRunInference': true,
150+
'project': path.join(__dirname, 'config', 'typescript', 'tsconfig.eslint.json'),
151+
},
152+
'rules': {
153+
'@typescript-eslint/explicit-member-accessibility': ['error', {'accessibility': 'no-public'}],
154+
'comma-dangle': 'off',
155+
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
156+
157+
// run just the TypeScript unused-vars rule, else we get duplicate errors
158+
'no-unused-vars': 'off',
159+
'@typescript-eslint/no-unused-vars': ['error', {'argsIgnorePattern': '^_'}],
160+
// run just the TypeScript semi rule, else we get duplicate errors
161+
'semi': 'off',
162+
'@typescript-eslint/semi': 'error',
163+
'@typescript-eslint/member-delimiter-style': [
164+
'error', {
165+
'multiline': {'delimiter': 'semi', 'requireLast': true},
166+
'singleline': {'delimiter': 'comma', 'requireLast': false},
167+
'overrides': {
168+
'interface': {
169+
'singleline': {'delimiter': 'semi', 'requireLast': false},
170+
'multiline': {'delimiter': 'semi', 'requireLast': true}
171+
},
172+
'typeLiteral': {
173+
'singleline': {'delimiter': 'comma', 'requireLast': false},
174+
'multiline': {'delimiter': 'comma', 'requireLast': true}
175+
}
176+
}
177+
}
178+
],
179+
'@typescript-eslint/no-floating-promises': ['error', {ignoreVoid: true}],
180+
// func-call-spacing doesn't work well with .ts
181+
'func-call-spacing': 'off',
182+
'@typescript-eslint/func-call-spacing': 'error',
183+
184+
/**
185+
* Enforce that enum members are explicitly defined:
186+
* const enum Foo { A = 'a' } rather than const enum Foo { A }
187+
*/
188+
'@typescript-eslint/prefer-enum-initializers': 'error',
189+
/**
190+
* Ban non-null assertion operator, e.g.:
191+
* this.foo!.toLowerCase()
192+
*/
193+
'@typescript-eslint/no-non-null-assertion': 'error',
194+
'@typescript-eslint/consistent-type-imports': 'error',
195+
'rulesdir/no_underscored_properties': 'error',
196+
'rulesdir/prefer_readonly_keyword': 'error',
197+
'rulesdir/inline_type_imports': 'error',
198+
}
199+
}, {
200+
'files': ['*.test.ts', 'test/**/*.ts', '**/testing/*.ts'],
201+
'rules': {
202+
// errors on it('test') with no body
203+
'mocha/no-pending-tests' : 'error',
204+
205+
// errors on {describe, it}.only
206+
'mocha/no-exclusive-tests' : 'error',
207+
208+
'mocha/no-async-describe': 'error',
209+
'mocha/no-global-tests': 'error',
210+
'mocha/no-nested-tests': 'error',
211+
212+
'rulesdir/check_test_definitions' : 'error',
213+
'rulesdir/avoid_assert_equal' : 'error',
214+
'rulesdir/no_repeated_tests' : 'error',
215+
'rulesdir/compare_arrays_with_assert_deepequal' : 'error',
216+
'rulesdir/ban_screenshot_test_outside_perf_panel' : 'error',
217+
'rulesdir/trace_engine_test_timeouts' : 'error',
218+
'@typescript-eslint/naming-convention' :
219+
[
220+
'error',
221+
{
222+
'selector' :
223+
[
224+
'function', 'accessor', 'method', 'property',
225+
'parameterProperty'
226+
],
227+
'format' : ['camelCase'],
228+
},
229+
{
230+
// Allow PascalCase as well as it is used for dynamic module imports.
231+
'selector' : 'variable',
232+
'format' : ['camelCase', 'PascalCase', 'UPPER_CASE'],
233+
},
234+
{
235+
'selector' : 'classProperty',
236+
'modifiers' : ['static', 'readonly'],
237+
'format' : ['UPPER_CASE'],
238+
},
239+
{
240+
'selector' : 'enumMember',
241+
'format' : ['PascalCase', 'UPPER_CASE'],
242+
},
243+
{
244+
'selector' : ['typeLike'],
245+
'format' : ['PascalCase'],
246+
},
247+
{
248+
// Also allow UPPER_CASE so argument function to evaluate can take constants as arguments without renaming.
249+
'selector' : 'parameter',
250+
'format' : ['camelCase', 'UPPER_CASE'],
251+
'leadingUnderscore' : 'allow',
252+
},
253+
{
254+
// Object literals may be constructed as arguments to external libraries which follow different styles.
255+
'selector' : ['objectLiteralMethod', 'objectLiteralProperty'],
256+
'modifiers' : ['public'],
257+
'format' : null,
258+
},
259+
],
260+
'@typescript-eslint/no-non-null-assertion' : 'off',
261+
},
262+
'settings': {
263+
'mocha/additionalCustomNames': [
264+
{ 'name': 'describeWithDevtoolsExtension', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
265+
{ 'name': 'describeWithEnvironment', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
266+
{ 'name': 'describeWithLocale', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
267+
{ 'name': 'describeWithMockConnection', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
268+
{ 'name': 'describeWithRealConnection', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
269+
{ 'name': 'itScreenshot', 'type': 'testCase', 'interfaces': [ 'BDD', 'TDD' ] },
270+
]
271+
}
272+
}],
273+
};
274+
275+
// clang-format on

.git-blame-ignore-revs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,3 @@ aaf6c64ae8d791f878599bf2cea8a9b1e6a5001c
349349

350350
# Always add braces to single-line if-statements (https://crrev.com/c/1821526)
351351
1d6e57a0e314d709029cac52b98898b828f45a12
352-
353-
# [AI Assistance] Renames and refactorings (https://crrev.com/c/6080811)
354-
786bd4290956c5b8560a03cf73d860572559e382
355-
356-
# RPP mass-renames. https://crrev.com/c/5867685 https://crrev.com/c/6191870 https://crrev.com/c/6190947
357-
8da83d7f627b0588b1c49d7761a90368efbfed73
358-
b1b834b0a1f9e61213fba85d8bc4a3c9ccfdefd7
359-
a59de5d27b5977b0bb8d260634f1d8d45e69cfdf

.gitallowed

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# This key is expected to be visible in the frontend code
22
# b/349721878
33
CRUX_API_KEY
4-
# Publicly-visible API key for Firebase analytics, used in NetworkRequestHandler.test.ts
5-
AIzaSyCGxLbbFQxH4BV1fY0RODlxTos9nJa2l_g
64

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package-lock.json binary
2-
front_end/ui/visual_logging/KnownContextValues.ts merge=union
32
# Automatically normalize line endings (to LF) for all text-based files.
4-
* text=auto eol=lf
3+
* text=auto eol=lf

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
build:
8-
runs-on: ubuntu-22.04
8+
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v3
1111
with:

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ config.gypi
2424
/interactions-coverage
2525
/perf-data
2626
npm-debug.log
27+
/scripts/javascript_natives/node_modules
2728
/scripts/protocol_typescript/*.js
28-
/scripts/ai_assistance/data
29-
/scripts/ai_assistance/performance-trace-downloads
3029

3130
/build
3231
/buildtools
@@ -53,8 +52,3 @@ test/perf/.generated
5352
/.gclient_entries
5453
/.gclient_previous_sync_commits
5554
/.cipd
56-
57-
# Linters caches
58-
.eslintcache
59-
.stylelintcache
60-
**/tsconfig.tsbuildinfo

0 commit comments

Comments
 (0)