Skip to content

Revert "Sync fork with chromium/7103" #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
36 changes: 36 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
front_end/.eslintrc.js
front_end/diff/diff_match_patch.jD
front_end/models/javascript_metadata/NativeFunctions.js
front_end/models/javascript_metadata/DOMPinnedProperties.ts

// All of the scripts in this folder are auto-generated so don't lint them.
front_end/generated/

// Any third_party addition has its source code checked out into
// third_party/X/package, so we ignore that code as it's not code we author or
// own.
front_end/third_party/*/package/
// Any JS files are also not authored by devtools-frontend, so we ignore those.
front_end/third_party/**/*.js
// Lighthouse doesn't have a package/ folder but has other nested folders, so
// we ignore any folders within the lighthouse directory.
front_end/third_party/lighthouse/*/
// The CodeMirror bundle file is auto-generated and rolled-up as part of the
// install script, so we don't need to lint it.
front_end/third_party/codemirror.next/bundle.ts
// Lit lib files are auto-generated and rolled up as part of the install script.
front_end/third_party/lit/src/*.ts
// @puppeteer/replay is auto-generated.
front_end/third_party/puppeteer-replay/**/*.ts

extensions/cxx_debugging/third_party/

node_modules
scripts/migration/**/*.js
scripts/protocol_typescript/*.js
scripts/deps/tests/fixtures
test/**/fixtures/
test/e2e/**/*.js
test/shared/**/*.js

*.d.ts
275 changes: 275 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// clang-format off

const path = require('path');
const rulesDirPlugin = require('eslint-plugin-rulesdir');
rulesDirPlugin.RULES_DIR = path.join(__dirname, 'scripts', 'eslint_rules', 'lib');

module.exports = {
'root': true,

'env': {'browser': true, 'es6': true},

'parser': '@typescript-eslint/parser',

'plugins': [
'@typescript-eslint',
'mocha',
'rulesdir',
'import',
'jsdoc',
],

'parserOptions': {'ecmaVersion': 9, 'sourceType': 'module'},

/**
* ESLint rules
*
* All available rules: http://eslint.org/docs/rules/
*/
'rules': {
/**
* Enforced rules
*/

// syntax preferences
'quotes': ['error', 'single', {'avoidEscape': true, 'allowTemplateLiterals': false}],
'semi': 'error',
'no-extra-semi': 'error',
'comma-style': ['error', 'last'],
'wrap-iife': ['error', 'inside'],
'spaced-comment': ['error', 'always', {'markers': ['*']}],
'eqeqeq': 'error',
'accessor-pairs': ['error', {'getWithoutSet': false, 'setWithoutGet': false}],
'curly': 'error',
'new-parens': 'error',
'func-call-spacing': 'error',
'arrow-parens': ['error', 'as-needed'],
'eol-last': 'error',

// anti-patterns
'no-caller': 'error',
'no-case-declarations': 'error',
'no-cond-assign': 'error',
'no-console': ['error', {'allow': ['assert', 'context', 'error', 'timeStamp', 'time', 'timeEnd', 'warn']}],
'no-debugger': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-else-return': ['error', {'allowElseIf': false}],
'no-empty-character-class': 'error',
'no-global-assign': 'error',
'no-implied-eval': 'error',
'no-labels': 'error',
'no-multi-str': 'error',
'no-new-object': 'error',
'no-octal-escape': 'error',
'no-self-compare': 'error',
'no-shadow-restricted-names': 'error',
'no-unreachable': 'error',
'no-unsafe-negation': 'error',
'no-unused-vars': ['error', {'args': 'none', 'vars': 'local'}],
'no-var': 'error',
'no-with': 'error',
'prefer-const': 'error',
'radix': 'error',
'valid-typeof': 'error',
'no-return-assign': ['error', 'always'],
'no-implicit-coercion': 'error',

// es2015 features
'require-yield': 'error',
'template-curly-spacing': ['error', 'never'],

// file whitespace
'no-multiple-empty-lines': ['error', {'max': 1}],
'no-mixed-spaces-and-tabs': 'error',
'no-trailing-spaces': 'error',
'linebreak-style': ['error', 'unix'],

/**
* Disabled, aspirational rules
*/

'indent': ['off', 2, {'SwitchCase': 1, 'CallExpression': {'arguments': 2}, 'MemberExpression': 2}],

// brace-style is disabled, as eslint cannot enforce 1tbs as default, but allman for functions
'brace-style': ['off', 'allman', {'allowSingleLine': true}],

// key-spacing is disabled, as some objects use value-aligned spacing, some not.
'key-spacing': ['off', {'beforeColon': false, 'afterColon': true, 'align': 'value'}],
// quote-props is diabled, as property quoting styles are too varied to enforce.
'quote-props': ['off', 'as-needed'],

// no-implicit-globals will prevent accidental globals
'no-implicit-globals': 'off',
'no-unused-private-class-members': 'error',

// forbids interfaces starting with an I prefix.
'@typescript-eslint/naming-convention':
['error', {'selector': 'interface', 'format': ['PascalCase'], 'custom': {'regex': '^I[A-Z]', 'match': false}}],
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-explicit-any': [
"error",
{
"ignoreRestArgs": true
}
],

// Closure does not properly typecheck default exports
'import/no-default-export': 'error',

/**
* Catch duplicate import paths. For example this would catch the following example:
* import {Foo} from './foo.js'
* import * as FooModule from './foo.js'
**/
'import/no-duplicates': 'error',

// Try to spot '// console.log()' left over from debugging
'rulesdir/commented_out_console': 'error',

// Prevent imports being commented out rather than deleted.
'rulesdir/commented_out_import': 'error',

// DevTools specific rules
'rulesdir/es_modules_import': 'error',
'rulesdir/check_license_header': 'error',
/**
* Ensures that JS Doc comments are properly aligned - all the starting
* `*` are in the right place.
*/
'jsdoc/check-alignment': 'error',
},
'overrides': [{
'files': ['*.ts'],
'parserOptions': {
'allowAutomaticSingleRunInference': true,
'project': path.join(__dirname, 'config', 'typescript', 'tsconfig.eslint.json'),
},
'rules': {
'@typescript-eslint/explicit-member-accessibility': ['error', {'accessibility': 'no-public'}],
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],

// run just the TypeScript unused-vars rule, else we get duplicate errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', {'argsIgnorePattern': '^_'}],
// run just the TypeScript semi rule, else we get duplicate errors
'semi': 'off',
'@typescript-eslint/semi': 'error',
'@typescript-eslint/member-delimiter-style': [
'error', {
'multiline': {'delimiter': 'semi', 'requireLast': true},
'singleline': {'delimiter': 'comma', 'requireLast': false},
'overrides': {
'interface': {
'singleline': {'delimiter': 'semi', 'requireLast': false},
'multiline': {'delimiter': 'semi', 'requireLast': true}
},
'typeLiteral': {
'singleline': {'delimiter': 'comma', 'requireLast': false},
'multiline': {'delimiter': 'comma', 'requireLast': true}
}
}
}
],
'@typescript-eslint/no-floating-promises': ['error', {ignoreVoid: true}],
// func-call-spacing doesn't work well with .ts
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',

/**
* Enforce that enum members are explicitly defined:
* const enum Foo { A = 'a' } rather than const enum Foo { A }
*/
'@typescript-eslint/prefer-enum-initializers': 'error',
/**
* Ban non-null assertion operator, e.g.:
* this.foo!.toLowerCase()
*/
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'rulesdir/no_underscored_properties': 'error',
'rulesdir/prefer_readonly_keyword': 'error',
'rulesdir/inline_type_imports': 'error',
}
}, {
'files': ['*.test.ts', 'test/**/*.ts', '**/testing/*.ts'],
'rules': {
// errors on it('test') with no body
'mocha/no-pending-tests' : 'error',

// errors on {describe, it}.only
'mocha/no-exclusive-tests' : 'error',

'mocha/no-async-describe': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-nested-tests': 'error',

'rulesdir/check_test_definitions' : 'error',
'rulesdir/avoid_assert_equal' : 'error',
'rulesdir/no_repeated_tests' : 'error',
'rulesdir/compare_arrays_with_assert_deepequal' : 'error',
'rulesdir/ban_screenshot_test_outside_perf_panel' : 'error',
'rulesdir/trace_engine_test_timeouts' : 'error',
'@typescript-eslint/naming-convention' :
[
'error',
{
'selector' :
[
'function', 'accessor', 'method', 'property',
'parameterProperty'
],
'format' : ['camelCase'],
},
{
// Allow PascalCase as well as it is used for dynamic module imports.
'selector' : 'variable',
'format' : ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
{
'selector' : 'classProperty',
'modifiers' : ['static', 'readonly'],
'format' : ['UPPER_CASE'],
},
{
'selector' : 'enumMember',
'format' : ['PascalCase', 'UPPER_CASE'],
},
{
'selector' : ['typeLike'],
'format' : ['PascalCase'],
},
{
// Also allow UPPER_CASE so argument function to evaluate can take constants as arguments without renaming.
'selector' : 'parameter',
'format' : ['camelCase', 'UPPER_CASE'],
'leadingUnderscore' : 'allow',
},
{
// Object literals may be constructed as arguments to external libraries which follow different styles.
'selector' : ['objectLiteralMethod', 'objectLiteralProperty'],
'modifiers' : ['public'],
'format' : null,
},
],
'@typescript-eslint/no-non-null-assertion' : 'off',
},
'settings': {
'mocha/additionalCustomNames': [
{ 'name': 'describeWithDevtoolsExtension', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
{ 'name': 'describeWithEnvironment', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
{ 'name': 'describeWithLocale', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
{ 'name': 'describeWithMockConnection', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
{ 'name': 'describeWithRealConnection', 'type': 'suite', 'interfaces': [ 'BDD', 'TDD' ] },
{ 'name': 'itScreenshot', 'type': 'testCase', 'interfaces': [ 'BDD', 'TDD' ] },
]
}
}],
};

// clang-format on
8 changes: 0 additions & 8 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,3 @@ aaf6c64ae8d791f878599bf2cea8a9b1e6a5001c

# Always add braces to single-line if-statements (https://crrev.com/c/1821526)
1d6e57a0e314d709029cac52b98898b828f45a12

# [AI Assistance] Renames and refactorings (https://crrev.com/c/6080811)
786bd4290956c5b8560a03cf73d860572559e382

# RPP mass-renames. https://crrev.com/c/5867685 https://crrev.com/c/6191870 https://crrev.com/c/6190947
8da83d7f627b0588b1c49d7761a90368efbfed73
b1b834b0a1f9e61213fba85d8bc4a3c9ccfdefd7
a59de5d27b5977b0bb8d260634f1d8d45e69cfdf
2 changes: 0 additions & 2 deletions .gitallowed
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This key is expected to be visible in the frontend code
# b/349721878
CRUX_API_KEY
# Publicly-visible API key for Firebase analytics, used in NetworkRequestHandler.test.ts
AIzaSyCGxLbbFQxH4BV1fY0RODlxTos9nJa2l_g

3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package-lock.json binary
front_end/ui/visual_logging/KnownContextValues.ts merge=union
# Automatically normalize line endings (to LF) for all text-based files.
* text=auto eol=lf
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ config.gypi
/interactions-coverage
/perf-data
npm-debug.log
/scripts/javascript_natives/node_modules
/scripts/protocol_typescript/*.js
/scripts/ai_assistance/data
/scripts/ai_assistance/performance-trace-downloads

/build
/buildtools
Expand All @@ -53,8 +52,3 @@ test/perf/.generated
/.gclient_entries
/.gclient_previous_sync_commits
/.cipd

# Linters caches
.eslintcache
.stylelintcache
**/tsconfig.tsbuildinfo
Loading
Loading