Commit Graph
1274 Commits
Author SHA1 Message Date
Jack Franklin 5445f5cf5f Update eslint node_module
Bug: none
Change-Id: I07591be5189d93085d49ace61ec030291af12b9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3757654
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-07-15 09:09:49 +00:00
Jack Franklin e7a4dd0e8a Upgrade ESLint+TypeScript node_modules
Bug: none
Change-Id: I1f99b10bc418d589cb11adba64ef2211bede5cd8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3757653
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-07-13 11:51:00 +00:00
Jack Franklin 3a80260722 Inline type imports in front_end
This CL enables the `inline_type_imports` rule for devtools-frontend,
and is the result of running the auto-fixer to update all imports
accordingly.

Bug: 1319340
Change-Id: I303256476fd4e94f4505bbf4355c0070ac101aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3752799
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-07-13 09:26:00 +00:00
Jack Franklin 061f09c304 Upgrade TypeScript to 4.7.4
There are a couple of code changes for us that are relevant:

1.The accuracy of `lib.d.ts` (DOM definitions) has improved, so we have
  to update a type in `Button.ts`. This changes the type from
  `X|undefined` to `X|null` so this is very minor.

2. TypeScript got better at understanding conditionals that will always
  return `true`, and caught a case where we were doing:

  ```
  addEventListener(e => e.key === 'Enter' && Common.Revealer.reveal(...)
  && false)
  ```

  TS errored because the `reveal()` call is a promise and therefore will
  always return true, causing the entire expression to return the final
  `false`. Returning `false` from an event listener doesn't do anything,
  so I've removed it.

DISABLE_THIRD_PARTY_CHECK=required updates to land TS upgrade

Bug: none
Change-Id: I89ab2ad730d40308da173bd7788c17daf0b4a511
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3757623
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2022-07-12 15:22:50 +00:00
Jack Franklin 130d2ae03b Disable clang/eslint in front_end/generated
This CL disables formatting within the `generated` directory, which is
all code that is programatically generated. Previously we disabled
eslint for `protocol.ts`, but now we are being consistent and disabling
it (and clang) for all files.

I also re-generated the files in the generated folder, so we avoid any
confusion if/when the generated scripts get re-run and suddenly the
format drastically changes.

DISABLE_THIRD_PARTY_CHECK=changing generated files + config

Bug: none
Change-Id: I714ada8bf7d85020e3be71b35c9db98840bf3ef2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3755163
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-12 10:51:50 +00:00
Jack Franklin 66c2bf52b7 [ESLint] allow nested components within a components/ folder
Without this fix lint rule was complaining about
`front_end/panels/foo/bar/components/X.ts`. In some situations we do
nest components further within panels, so let's check that the component
is within a `components` folder regardless of the nesting.

Bug:1206616
Change-Id: Ib6ae6252a517f6d5756fd37f51e130df1c7d5014
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3752797
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-08 14:58:37 +00:00
Jack Franklin cc2dbce19a [ESLint] allow custom element rule to configure frontend directory
Bug: 1206616
Change-Id: I33d2e5db33e617370eabab1a01f59e49eb7d2767
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3751200
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-07-07 14:47:41 +00:00
Jack Franklin cf56966bc3 [ESLint] lint front_end/third_party
In crrev.com/c/3748106 we noticed that a CL was able to land that
imported a file without the `.js` extension.

This is because `.eslintignore` listed `front_end/third_party`, so that
folder wasn't linted at all. This is an issue because whilst most of the
code in that directory is not authored by us, the entry points usually
are, and we want to apply our lint rules there.

This CL removes the blanket ignore, instead preferring to ignore
`third_party/X/package/`, and a few other special cases, ensuring that
devtools-frontend authored files in `third_party/` do get linted.

The CL updates the `es_modules_import` rule to not apply the import
checks to files in `third_party` (as they cannot apply the same
conventions we use in DevTools), but it will still check for file
extensions on imports.

The remaining changes are small stylistic changes to align to our ESLint
rules.

Fixed: 1342530
Change-Id: I4ce438499b8c9c77c3fe661576a58bad59d9b061
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3749191
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-07-07 10:55:21 +00:00
Randolf J 26e9ff964e Update puppeteer to 15.3.1
Also disables reviewer lookup and fixes boolean arguments for the `roll_front_end_third_party.py` script.

Bug: none
Change-Id: I3fb3538352841551048520f1f1e85f60d91afe24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3747780
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-07-06 17:03:25 +00:00
Jack Franklin 3ceef987a2 [Lint] fix pathing rules for inject_checkbox_styles
I'd made a mistake in the pathing logic for resolving imports; I needed
the _directory_ of the TS file being linted, not the filename itself.

I then also had to update all the tests as they contained incorrect
filepaths which caused me to miss the bug in the first place.

Bug: 1316297
Change-Id: Ie8303291b23d078a9ea1937d28ab3bef73deb258
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3747779
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-07-06 12:11:55 +00:00
Jack Franklin 8f8ec22bb3 Update karma to 6.4.0
No changes in the changelog
(https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) to
concern ourselves about, but one useful change is they upgraded the
log4js dependency which was spitting out console messages on each test
run. This is fixed with this version of Karma.

Bug: none
Change-Id: Ic49618cbda7a079cacb9813f5129692a83508a92
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3745621
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-07-05 10:46:37 +00:00
Victor Porof 7e0446e7ad Include applicable state information alongside all the other other property information
This makes it easier to consume the data in the frontend.

Bug: 1325812
Change-Id: I37979a7266af728399a9c4938bf97f77e5781b5b
Signed-off-by: Victor Porof <victorporof@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702682
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-15 13:05:36 +00:00
Victor Porof 93f266f30a Eslint-ignore generated DOM pinned properties dataset
This follows the example of the other generated files.
Avoids having to fight the presubmit check on regeneration.

Bug: 1325812
Change-Id: Ia925628fd5025a03b42aaf9e147e43ff752d2764
Signed-off-by: Victor Porof <victorporof@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702268
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-15 12:51:46 +00:00
Jack Franklin 06218d9b3c [Lint] fix component naming bug
I had an issue where I'd copied/pasted a component definition but
forgotten to change the litTagName property. I then realised that this
rule wasn't detecting the case where we have duplicate `litTagName`
items and should be, so we now check if we've seen a tag before and
error if so. This ensures no duplicate tag names can exist in any single
file.

Bug: none
Change-Id: I2fe5bdfe3bee6a2d2f52e90f9b80e5c82737f416
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702263
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-14 08:59:45 +00:00
John Emau 254c8dd221 Fix for devtools-frontend full checkout paths on Windows
Currently calculating the path to chromium's root directory returns an empty string on Windows because the path used to compare against the executable path is not normalized.

```
PATH_TO_EXECUTED_FILE.indexOf(devtoolsPath)
```
Becomes
```
'D:\\drive\chromium\src\third_party\devtool-frontend\src\...'.indexOf('src/third_party/devtools-frontend'); -> -1 on Windows
```

The fix is to use the normalizedPath variable to return the correct substring.

Change-Id: Ia12232f3746466f3257975d652342ac8b9ed2578
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3703315
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: John Emau <John.Emau@microsoft.com>
2022-06-14 07:03:15 +00:00
Victor Porof d8a8db74c8 Improve in-place array merges when generating the DOM pinned properties dataset
Array#includes is O(n) whereas set lookups are O(1).
We still O(n) to generate the set, but only happens once.

Signed-off-by: Victor Porof <victorporof@chromium.org>
Bug: 1325812
Change-Id: I29da73edf5e42ad4d088fd9018e505d0e787744a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3702261
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-13 16:48:05 +00:00
Victor Porof 1a8a30d6b4 Add a DOM pinned properties dataset generator
Signed-off-by: Victor Porof <victorporof@chromium.org>
Bug: 1325812
Change-Id: I292d49d273d74d33a82e25179478405395159537
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695372
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-13 14:07:20 +00:00
Victor Porof 6e09692deb Add @webref/idl dependency
Signed-off-by: Victor Porof <victorporof@chromium.org>
Bug: 1325812
Change-Id: I044170880d20ce0402062755787cccafd63c6a42
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695370
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-13 10:23:45 +00:00
Richard Wang efcbd38590 typescript: Fully replace devtools_use_rbe with devtools_use_remoteexec
BUG=chromium:1247781
DISABLE_THIRD_PARTY_CHECK=Update devtools_entrypoint simultaneously rather than making yet another CL

Change-Id: Id85a820f0ab30a46d0631c6e5581a88c206fa8f9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3694875
Commit-Queue: Richard Wang <richardwa@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-10 12:01:23 +00:00
Philip Pfaffe 17a9f74a71 Don't build wasm module test inputs in the chromium tree
We currently don't check out emscripten in the chromium tree, so disable
inclusion of the modules that would call emscripten tools in that case.

Bug: none
Change-Id: I7e69d87da6af7a198f6a509a1d2a2b02d6d94341
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695365
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2022-06-10 09:55:03 +00:00
Philip Pfaffe e29b186fe5 Generate inputs to wasm tests from wasm text
This CL introduces support for writing inputs to wasm tests in wat
format. This will allow removing dependencies on opaque binary resources
that can't be regenerated without changing hardcoded offsets in all
tests. Referencing binary and/or source file offsets will now be
possible through special comments left in the wat source.

Bug: 1328729
Change-Id: I6369c86ca57860fd9803b894797f63c36c65d554
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3666419
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-06-09 17:12:02 +00:00
Eric Leese ed8fe6a3c5 UI polish for authored/deployed grouping
Bug: 1334536
Change-Id: I97a45377ec48f4852e792925771b0790a0415311
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695547
Reviewed-by: Victor Porof <victorporof@chromium.org>
Reviewed-by: Jecelyn Yeen <jec@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2022-06-09 16:00:02 +00:00
Jack Franklin c03b4c8493 Add undefined checks to lit_template_result_or_nothing rule
My editor errored at me because it tried to lint some code and an
exception was thrown in this rule. I tracked it down to some fields that
we need to ensure exist before continuing. If they don't exist, we can
bail early and not check further.

Bug: none
Change-Id: I32d9a37a7e588e07885f2ba3fa52f2292b9754a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3695546
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-06-09 11:17:34 +00:00
Danil Somsikov b46acf27bd Added tests for the size of chunked response.
These would replace flaky browser tests.

Bug: 1307734
Change-Id: I7812c29de230072b94b3ef097e60de902154551b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3657457
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2022-05-24 11:59:01 +00:00
Johan Bay 4ae584d7a4 Forward mixin interface methods to their includers
This ensures that we have argument hints for things such as
`window.clearTimeout` where `clearTimeout` is defined in a mixin
`WindowOrWorkerGlobalScope` and `Window` includes the mixin.

Bug: 1255619
Change-Id: I8fe2434f0b88bc39454feed3900639f5edc05305
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3660423
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-05-24 08:35:50 +00:00
Johan Bay ebb70e3356 Change JavaScriptMetadata to contain list of receivers
Bug: 1255619, 1327573
Change-Id: I8fbe5a041b1ef5aef519d1b0b76f1bded237bd6f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3580497
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2022-05-24 07:56:40 +00:00
Randolf J 87999eee8a Update puppeteer to 14.1.1
R=mathias@chromium.org, sadym@chromium.org

Bug: none
Change-Id: I0c0dd6481bcc1814cc293212952c4dd5b2ead0b6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3655470
Commit-Queue: Randolf Jung <jrandolf@google.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
2022-05-20 10:20:06 +00:00
Randolf J 5c18744742 [Infra] Add script for auto-rolling front_end/third_party deps
Bug: 1324875
Change-Id: I1160e12382845d67b6bae56787208927db16de52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3652203
Commit-Queue: Randolf Jung <jrandolf@google.com>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
2022-05-18 13:03:26 +00:00
Alex Rudenko ce49c72ced add a whitespace 2022-05-12 11:08:38 +02:00
Randolf J 5cbcb68e9a Update puppeteer from 13.1.1 to 14.0.0
Bug: none
Change-Id: I157e7f5ddff43eb17fe371cc1437a636ad42cd4f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3641417
Commit-Queue: Randolf Jung <jrandolf@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-05-11 13:38:33 +00:00
Jack Franklin d7508305f9 Enable ESLint rule for LitHtml.LitTemplate
Bug: 1320753
Change-Id: If7e442d3250508c9be9199f1706e73847782197d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3629865
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-05-09 15:06:40 +00:00
Ergün Erdoğmuş 5f638bacef Add eslint rule for binding scheduleRender render argument
Bug: NO_BUG
Change-Id: I64d643a65d0cf4bc3546ed4f75adde7a53c83c4e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3624641
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
2022-05-05 11:06:21 +00:00
Jack Franklin aa70334697 Script to reformat js/ts files with clang-format
During my work to update JS import wrapping, I wrote up a hacky script
to auto-run clang on all JS and TS files. This CL is that script, but
tidied up and made a bit neater. I think it's worth landing as I can
easily imagine us needing to use it again in the future if clang
releases new config options we want to apply.

Bug: none
Change-Id: I43240c0ffab912d77950cb76540ccdfe8fed556c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3627330
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-05-04 11:37:00 +00:00
Jack Franklin a00b89c22a Lint against TemplateResult|typeof nothing
We have a common pattern in our codebase where a function might return a
lit template, or the result of `Lit.nothing` (which is equivalent to
`{}`). Therefore we have a fair amount of code that looks like:

```
foo(): LitHtml.TemplateResult|{}
// or
foo(): LitHtml.TemplateResult|typeof LitHtml.nothing
```

I'd like us to be consistent over which we prefer, but also this feels
like a little bit of an implementation detail that's leaking out - to a
person using our components system, a Lit template result or `{}` are
really equivalent - and we shouldn't have code that cares.

Therefore I'm proposing we expose (this will be done in a separate CL):

```
type LitTemplate = TemplateResult|typeof nothing
```

And then use this ESLint rule to:

1) update existing code to use the new type
2) ban future code from not using the new type

Both of those steps will also be done in a follow-up CL, this CL
introduces the basic rule.

Bug: 1320753
Change-Id: I2f3d5029a695922c9a71334e34259597eaebfcc0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3613881
Commit-Queue: Andres Olivares <andoli@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-29 16:07:23 +00:00
Mathias Bynens 54303dcc64 Unify developer-facing and user-facing short URLs
For any shortened URLs:

- Use goo.gle for Google Docs and chromium.org target URLs.
- Use g.co for everything else.

Bug: chromium:1321016
Change-Id: I09099dc62b92a14fa68d62155953262328476db2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3613872
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2022-04-29 10:46:23 +00:00
Jack Franklin c70d2688e1 ESLint rule for inlined type imports
This rule is able to merge imports such as:

```
import type {Crumb} from './breadcrumbs.js';
import {BreadcrumbComponent} from './breadcrumbs.js';
```

Into:

```
import {BreadcrumbComponent, type Crumb} from './breadcrumbs.js';
```

It can also inline standalone type imports:

```
import type {X, Y} from './foo.js';
```

Into:

```
import {type X, type Y} from './foo.js';
```

Note: this CL only lands the rule and does not enable it.

Bug: 1319340
Change-Id: I0f7d9e8a6833f836a0e4581d68ee7fd1b27c0edc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3605262
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-26 11:54:37 +00:00
Simon Zünd 41c626075a Don't prepend PWD to file paths for natives generation
roll_deps.py was upgraded to Python3 in https://crrev.com/c/3521887.
This changed the paths that are passed to the natives generation script
to be absolute and no longer relative.

To account for this, we no longer prepend the working directory to
calculated paths.

R=jobay@chromium.org

Bug: None
Change-Id: Ia0a0f946e27d61fa64e7856daef0f709fb058365
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3607830
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-04-26 09:43:17 +00:00
Jack Franklin 38391d47f5 Land --no-fix flag to ESLint runner
This is useful sometimes if debugging a new ESLint rule - I've found
myself manually updating the script to disable fixing whilst I figure
something out.

Adding this flag and a separate `lint-check-js` script will make this
easier.

Bug: none
Change-Id: I929b13b09ece40690d630620da162986ed01e790
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3605263
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-25 13:00:57 +00:00
Jack Franklin 40a72b0ca0 Remove run_lint_check_js.js
We have run_lint_check_js.mjs which is used in PRESUBMIT, package.json
and on the bots. I think we just forgot to delete the old version.

Bug: none
Change-Id: I91179c3d30c306968774981678a044f3249c1d18
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598880
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-04-22 08:22:47 +00:00
Alex Rudenko d990ae300a Improve handling of .spawnSync errors
Fixed: 1198532
Change-Id: Id299bb7700f7a78aad97ad77eee23e4bd0c5b5f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598878
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-04-21 15:37:27 +00:00
Jack Franklin 3710bbf933 Upgrade eslint to 8.13.0
Bug: none
Change-Id: I438ea7b8e1c69e85939b1ed60578aa10fe87b821
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598874
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-04-21 10:20:38 +00:00
Jack Franklin e60446000d Lint for checkbox stylesheet adoption in Lit components
This CL introduces (but does not enable) an ESLint rule to check that if
a Lit component renders a checkbox, that it also imports and adopts the
common `Input.checkboxStyles` into the component's shadow root.

We can also roll this rule out to the text inputs too, but I wanted to
start with just one and see how it goes. I will follow up this CL with a
CL to enable this rule.

Bug: 1316297
Change-Id: Ibed7109d5948c8be3f4c9d376738290137e444ff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3586906
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-19 08:53:26 +00:00
Simon Zünd 7a5852438e Update @typescript-eslint/plugin to 5.20.0
Our current @typescript-eslint version does not support TypeScript 4.6.
The update fixes that.

.eslintrc.js changes taken from https://crrev.com/c/3583292.

DISABLE_THIRD_PARTY_CHECK="Update contains a breaking change. Requires
updated config"

Bug: None
Change-Id: Id1d9f4f073f068ec95af6632a6d061adbee63cca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3592593
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-04-19 07:12:14 +00:00
Jack Franklin 46a28a3c5d Allow same-module .css.js imports
These don't need to have the same import rules applied quite so
religiously to them.

Bug: none
Change-Id: Iddded5916ff93a5acf661ecf288ee6d5f79a029a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3584111
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-04-14 15:35:31 +00:00
Jack Franklin 0a2413e991 Add callee check to check_component_naming lint rule
I had an error in my editor; I was midway through typing and ESLint was
running. It turns out we needed to check for the existence of a `callee`
before reading properties on it.

Bug: none
Change-Id: If1f1b2a2fb621514265c894fec94e454048ae6ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3569023
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-04-04 15:06:22 +00:00
Jack Franklin 85ad87189b Upgrade eslint to 8.11
Bug: none
Change-Id: I27c4a453180acadf8935ab3f766751245bc2963b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3550273
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2022-03-25 12:36:13 +00:00
Liviu Rau b9d36166b6 Migrate to py3
+ drive-by imports cleanup

DISABLE_THIRD_PARTY_CHECK=Migrating multiple scripts to py3
Bug: 1292013
Change-Id: Ie81765366236bd6f6213075de3d529afe21d561f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3521887
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-03-15 13:19:16 +00:00
Tim van der Lippe 30e0d8719a Update to TypeScript 4.6.2
There was only 1 fix required in InspectorView where `DisplayNames.of`
can also return `undefined`. Default to "English" (which I don't think
can ever happen, but alas) is the safest option. Other than that, no
problems with the upgrade 🎉

DISABLE_THIRD_PARTY_CHECK=TypeScript fix
R=szuend@chromium.org

Fixed: 1304218
Change-Id: Ie3c61858259b325f465062aec9dbaf34492a6e00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3509848
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-03-09 11:15:43 +00:00
Tim van der Lippe ece3c51ea2 Fix install deps script on Python 3
We ran into "RuntimeError: OrderedDict mutated during iteration" when
running this script. The problem was that we were mutating the
`pkg_data` while also iterating over it. Per
https://stackoverflow.com/a/52549728 the fix is to copy the package data
and pop from there.

R=jacktfranklin@chromium.org

Bug: 1304218
Change-Id: Ibaeb3f1e26ca346c794984311c082bb2f9e672c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3509847
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-03-08 15:43:11 +00:00
Jack Franklin 3ea21da3c7 Lint against image URLs containing Images/src
Fixed: 1304152
Change-Id: If4e8928af76ab27ef9ea4584399419a4f94b91a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3506656
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2022-03-08 15:19:00 +00:00