This CL adds the eslint-plugin-jsdoc plugin and enables just one rule,
`jsdoc/check-alignment`, which ensures that all the lines in a comment
are correctly aligned. For example:
```
/**
* foo
* bar
*/
```
Would fail the check and be corrected to:
```
/**
* foo
* bar
*/
```
DISABLE_THIRD_PARTY_CHECK=deliberate install + use of
eslint-plugin-jsdoc node_module
Bug: none
Change-Id: I969983cd550653654a334ede3409b8c850467245
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4110906
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
We had to disable CSSNano because it was causing broken fonts in release
builds (exact reason TBC). This CL installs the `cssnano-preset-lite`
package which applies only the following optimisations:
1. remove whitespace
2. remove empty rules (e.g. `div{}`).
3. remove comments
This should be far less risky and unlikely to cause unexpected
breakages.
DISABLE_THIRD_PARTY_CHECK=installed & used cssnano-preset-lite in the
same CL.
Bug: 1399763
Change-Id: I7fdd8b70b02a2c1a5e1c71a87c7ba145114e6e4b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4111923
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
We have ESBuild as a dep in two places:
1. `DEPS`, managed by gclient
2. `manage_node_deps.py`, managed by npm
These versions need to match, otherwise any builds that use `esbuild`
will fail in Chrome land. This CL introduces a script and PRESUBMIT
check to ensure that the two versions are in sync.
Bug: none
Change-Id: I7ea9172ae386e4e21e1ac82c208d171b65b29e22
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4067299
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
This CL switches out the in-tree versions of en-US.json/en-XL.json
in favor of the versions generated at build time. They are identical.
The implementation is straight-forward. On the minification step, we
exclude the in-tree en-US.json/en-XL.json and instead add the
outputs of the "collect_strings" action (aka the generated en-US.json/
en-XL.json).
R=kimanh@chromium.org
Bug: 1185727
Change-Id: I923fba50033305a7df6bedccf65c657ecc8e5235
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4043247
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
This CL adds a `--log-level` flag to the unit test runner that will
allow the log level to be configured. This flag is passed right through
to Karma, but is also respected by the logs output by our test runner
before initialising Karma.
The default value for `--log-level` is `info`, so this CL doesn't change
the built in functionality; but you can now pass `debug`, `info`, `warn`
or `error` to configure it.
Bug: none
Change-Id: I82006a1a8283c3d93389f124317a37bac69b5038
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3963112
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Thiago Perrotta <tperrotta@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
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>
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>
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>
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>
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>
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>