Peter Marshall
f8f4ea4e9f
tests: Add a lint check for it.repeat()
...
We don't want these accidentally committed.
Bug: 1101782
Change-Id: I67a820bbaa6b8a8d1cb4a1a6afdb29bc8dacdc5e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354107
Commit-Queue: Peter Marshall <petermarshall@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-08-17 08:04:25 +00:00
Paul Lewis
7b17f160f7
[global] Stage second impl of ThemeSupport
...
Theme Support is currently in the ui/utils subdirectory. This ultimately
creates a circular dependency when we move to accessing it via imports
rather than by the global namespaced version. This CL creates an inert
copy of the Theme Support logic in the top level folder, and a future CL
will migrate all call sites to this version and remove the current
implementation in ui/utils.
Change-Id: I628b335dcc34fba29c79d11e4180593bb936f798
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2346370
Commit-Queue: Paul Lewis <aerotwist@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-08-10 15:44:55 +00:00
Philip Pfaffe
7d128bd540
[eslint] Ensure that linting doesn't crash on a custom it.skip
...
Change-Id: I3fc841a4c0e34b1c29686157ba3089e620036f51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332230
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-07-31 13:35:59 +00:00
Mathias Bynens
4a0d19365c
Reland “De-obfuscate X-Client-Data header values in Network tab”
...
Reland of: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
Screenshot: https://i.imgur.com/LJHFIp9.png
Note that the screenshot shows this as a response header instead of a
request header, since that was easier to test. In real-world scenarios
it would be a request header instead, but the UI looks the same.
CL preparing the ClientVariationsParser for use in the DevTools UI:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065
TBR=isherman@chromium.org ,mathias@chromium.org ,changhaohan@chromium.org ,alexrudenko@chromium.org
Bug: chromium:1103854
Change-Id: I6b959a1d57bcbc84f8571257a88fcbec805bf330
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318257
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Reviewed-by: Ilya Sherman <isherman@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
2020-07-28 06:54:51 +00:00
Mathias Bynens
43af8ef5d3
Revert "De-obfuscate X-Client-Data header values in Network tab"
...
This reverts commit d63cf4f023 .
Reason for revert: [5770:5770:0726/142022.954931:WARNING:devtools_ui_data_source.cc(206)] Unable to find DevTools resource: third_party/chromium/client-variations/ClientVariationsParser.js
Original change's description:
> De-obfuscate X-Client-Data header values in Network tab
>
> Screenshot: https://i.imgur.com/LJHFIp9.png
> Note that the screenshot shows this as a response header instead of a
> request header, since that was easier to test. In real-world scenarios
> it would be a request header instead, but the UI looks the same.
>
> CL preparing the ClientVariationsParser for use in the DevTools UI:
> https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065
>
> Bug: chromium:1103854
> Change-Id: Ifb63c011df2ea7af8aeb47dd615e2b20863a02c1
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
> Reviewed-by: Ilya Sherman <isherman@chromium.org >
> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org >
> Reviewed-by: Changhao Han <changhaohan@chromium.org >
> Commit-Queue: Mathias Bynens <mathias@chromium.org >
TBR=isherman@chromium.org ,mathias@chromium.org ,changhaohan@chromium.org ,alexrudenko@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: chromium:1103854
Change-Id: Id405f5991fd33a4dff5dd13c44da5ac3e67609cd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2318251
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
2020-07-27 11:15:07 +00:00
Mathias Bynens
d63cf4f023
De-obfuscate X-Client-Data header values in Network tab
...
Screenshot: https://i.imgur.com/LJHFIp9.png
Note that the screenshot shows this as a response header instead of a
request header, since that was easier to test. In real-world scenarios
it would be a request header instead, but the UI looks the same.
CL preparing the ClientVariationsParser for use in the DevTools UI:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316065
Bug: chromium:1103854
Change-Id: Ifb63c011df2ea7af8aeb47dd615e2b20863a02c1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316062
Reviewed-by: Ilya Sherman <isherman@chromium.org >
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org >
Reviewed-by: Changhao Han <changhaohan@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
2020-07-24 09:04:39 +00:00
Simon Zünd
a9f48fb117
Introduce thin wrapper module for third_party package 'marked'
...
This CL adds the //front_end/marked module as a thin wrapper for the
third_party package. Please note that //front_end/marked is currently
only usable from Closure land. Support for TypeScript-land is planned
but currently blocked on infra changes.
R=aerotwist@chromium.org
Change-Id: I91d0ce2772271ce09d608113ecb6fe13b48e1af2
Bug: chromium:1099162
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2287511
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Simon Zünd <szuend@chromium.org >
2020-07-08 12:01:16 +00:00
Tim van der Lippe
d9af05ccd9
Fix eslint check_test_definitions to handle template literals
...
R=petermarshall@chromium.org
Fixed: 1102324
Change-Id: I059e8ec845382f126d09c85b92e9752457a9a1b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282569
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Peter Marshall <petermarshall@chromium.org >
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Peter Marshall <petermarshall@chromium.org >
2020-07-06 15:28:51 +00:00
Alex Rudenko
4f8e4f9344
Reuse blendColors util
...
This CL extracts blendColors into a new utils file (more lightweight
function utils compared to Color.js) and reuses it in the overlay code.
Also, it adds an exception to eslint module import rules for the
inspector overlay folder because inspector overlay benefits from
granular imports instead of complete namespace imports.
Bug: 1078267
Change-Id: I01ec8f295da8bfac0b57b9dd2661ca9f798de869
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2228514
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Reviewed-by: Changhao Han <changhaohan@chromium.org >
2020-06-04 06:23:51 +00:00
Tim van der Lippe
55f7489e8e
Fix es_modules_import to handle .mjs files
...
This is required for the usage of `acorn.mjs`
R=jacktfranklin@chromium.org
Change-Id: I76fe80b1d444b4325c05a896028ba80fce4ad2bc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2212167
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-05-27 12:52:39 +00:00
Tim van der Lippe
4b342721d0
Use acorn-loose from front_end/third_party
...
This also required adding a dummy `.d.ts` file. I will send a
PR upstream to add that.
R=bmeurer@chromium.org
Bug: 1011811
Change-Id: I754ce07bd7d06ae39ab689974f77a71338adb48f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2212164
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org >
2020-05-26 11:09:21 +00:00
Tim van der Lippe
b4efb6ecad
Fix regex for name matching
...
Package names can include dashes and lower dashes in their name.
R=jacktfranklin@chromium.org ,aerotwist@chromium.org
Change-Id: I268fa9931431ad4492b27c5a01a958ea74a0d234
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209087
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-21 11:01:26 +00:00
Tim van der Lippe
f864f5b3d9
Port cm files to third_party/codemirror usages
...
The codemirror.css file needs to stay and will be removed in a
separate CL. Apparently we have our custom CodeMirror theme
in `text_editor/cmdevtools.css` which overwrites internals.
We should look into porting the css styles to use CSS variables
like all other themes.
R=mathias@chromium.org
Bug: 1076825
Change-Id: I0bdbdfa297d5ffac916d93dcadd1db66f15af6b3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2179844
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Mathias Bynens <mathias@chromium.org >
2020-05-18 09:41:01 +00:00
Tim van der Lippe
c606bf358e
Fix invalid cross-namespace star import
...
Discovered in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193588/1/front_end/sdk/CSSMedia.js#5
R=jacktfranklin@chromium.org
Change-Id: I9a34975891256d40ca0df59647cc3a48df9d1caf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193954
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 >
2020-05-11 16:17:30 +00:00
Tim van der Lippe
03fe3e7b0f
Fix ESLint rule for full relative URL
...
Discovered in https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193578/1/front_end/sdk/CSSProperty.js#5
R=jacktfranklin@chromium.org
Change-Id: I40225afb5b6018dc99f1d0d7af53ee9016c86e66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193953
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-05-11 15:52:50 +00:00
Tim van der Lippe
1066bfdb3e
Port cm_web_modes files to third_party/codemirror usages
...
This removes the cm_web_modes folder, as we now import from third_party
instead. We still double include the css.js and htmlmixed.js in the
formatter_worker and text_editor, but sadly we can't remove that until
the module.json files are removed.
roll CodeMirror
R=mathias@chromium.org
Bug: 1076825
Change-Id: I7b5a15bcc9db51b4a38be7db3d2da97aa9deb0f6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2179362
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-06 11:47:22 +00:00
Tim van der Lippe
4b1e8293fd
Use Acorn distribution in formatter_worker
...
R=aerotwist@chromium.org
Bug: 1011811
Change-Id: I564fd56105eb6c1ae484f556febc409796701f57
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2181217
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-06 10:14:52 +00:00
Tim van der Lippe
a17f6d2107
Port cm_modes files to third_party/codemirror usages
...
roll CodeMirror
R=mathias@chromium.org
Bug: 1076825
Change-Id: I85c076a68770b6c4d710bca3b5d4b055ac0e78d3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2178589
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
2020-05-04 13:09:51 +00:00
Tim van der Lippe
f40e0827f8
Remove checked in headlesscodemirror.js in favor of third_party source
...
The `headlesscodemirror.js` was actually a copy of
`addon/runmode/runmode-standalone.js`. Using the third_party source
allows to remove configuration for clang-format, ESLint and the
roll_codemirror.py files.
The cm_headless module is used in the formatter_worker. I verified that
the import is working as intended by building DevTools and formatting
a CSS file (which is one of the formatters that makes use of CodeMirror).
Then I found out that the runmode-standalone file expects `window` to
exist, which doesn't exist in workers. Therefore, locally patch that
to `globalThis.CodeMirror`.
R=mathias@chromium.org
Bug: 1011811, 1076825
Change-Id: Id8e5ed1d0ca81c3699def73a0eb63835ffc7a43f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2174418
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Mathias Bynens <mathias@chromium.org >
2020-05-04 10:25:16 +00:00
Jack Franklin
93f52244c5
Reland "Move UIString into Platform"
...
This is a reland of 992295e37d
Original change's description:
> Move `UIString` into `Platform`
>
> Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
>
> We have code we want to move to Platform but cannot because it needs
> `ls` and therefore creates a circular dependency. So this CL moves
> UIString into Platform.
>
> To avoid rewriting a lot of imports we re-export it from `common.js`.
>
> Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
> Reviewed-by: Paul Lewis <aerotwist@chromium.org >
Change-Id: I482323d1b35eb38066a571cb8630078b6cff6cde
TBR=aerotwist@chromium.org ,tvanderlippe@chromium.org ,jacktfranklin@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165793
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
2020-04-27 13:59:26 +00:00
Mathias Bynens
6ac9100804
Revert "Move UIString into Platform"
...
This reverts commit 992295e37d .
Reason for revert: breaks tree
Original change's description:
> Move `UIString` into `Platform`
>
> Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
>
> We have code we want to move to Platform but cannot because it needs
> `ls` and therefore creates a circular dependency. So this CL moves
> UIString into Platform.
>
> To avoid rewriting a lot of imports we re-export it from `common.js`.
>
> Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
> Reviewed-by: Paul Lewis <aerotwist@chromium.org >
TBR=aerotwist@chromium.org ,tvanderlippe@chromium.org ,jacktfranklin@chromium.org
Change-Id: Ic75fa4dfd49a2c413eee37b03d4c1f54e70eee20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165789
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
2020-04-27 12:38:27 +00:00
Jack Franklin
992295e37d
Move UIString into Platform
...
Platform is the "lowest" part of DevTools - e.g. it depends on nothing.
We have code we want to move to Platform but cannot because it needs
`ls` and therefore creates a circular dependency. So this CL moves
UIString into Platform.
To avoid rewriting a lot of imports we re-export it from `common.js`.
Change-Id: I399bbe8593e043148c4c7e51f598cbd73a89f639
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2165758
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-04-27 11:57:16 +00:00
Tim van der Lippe
0c197e5a9e
Add extensions for implicit imports in named export declarations
...
R=jacktfranklin@chromium.org
Change-Id: I9886922dc14e0bc05248a1d1a7c3f85304ea7c9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2167756
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-04-27 10:50:35 +00:00
Jack Franklin
28447fd262
Add ESLint rule to ban assert.equal
...
`assert.equal` is a non-strict check - it uses `==`. In our tests we
should either use:
* `assert.strictEqual` which uses `===`
* `assert.deepEqual` which does
a comparison on objects.
Change-Id: I872f9be140dc4c60b199fce94f95d0c12ee2bbc0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2160929
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-04-23 12:41:30 +00:00
Benedikt Meurer
3244d968e1
[CodeMirror] roll CodeMirror to 5.53.2
...
Also fix instructions and roll_codemirror.py script, and add the
new `wast.js` web mode for WebAssembly disassembly (which is going
to be hooked up in a follow up CL).
Bug: chromium:1042721
Change-Id: I2f14934b48528439b707538a64dfff4c2ac846e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159505
Reviewed-by: Mathias Bynens <mathias@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org >
2020-04-23 10:11:09 +00:00
Tim van der Lippe
80c102878f
Add ESLint rule for skipped tests
...
This makes sure that every skipped test also has a corresponding
CRBug filed to track re-enabling that test. Additionally, every
skipped test must have an attached comment with an explanation
as to why it is skipped.
R=jacktfranklin@chromium.org
Change-Id: I006a66ab32e7c014ef2287cb79f50b77de559a20
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2159518
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-04-22 13:32:39 +00:00
Tim van der Lippe
b0f499fbae
Fix eslint import rules to warn on test import extensions
...
Tests should also use imports that end with an extension, particularly
as it can silently fail in Karma.
We discovered this issue in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144163/4/test/e2e/application/cookies.ts#10
R=janscheffler@chromium.org
Change-Id: Ic379cb90b8e201b55a24010dc45565f6f45d910e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150450
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
2020-04-15 14:02:58 +00:00
Tim van der Lippe
650668eda9
Fix ES module import linter for module entrypoints
...
Module entrypoints need to be of the form:
import * as File from './File.js'
This makes sure that all usages of the symbols in a cross-namespace
module use the form Namespace.File.Symbol.
We discovered this issue in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2120014/5/front_end/common/common.js#14
R=mathias@chromium.org
Change-Id: If550c3d11456c1ac31ad3230705439e58d226d11
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150452
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Mathias Bynens <mathias@chromium.org >
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Mathias Bynens <mathias@chromium.org >
2020-04-15 13:09:08 +00:00
Tim van der Lippe
c27927c22e
Remove esprima
...
Esprima is an older parser that does not support modern JavaScript
features. Moreover, we are no longer this parser in either the
ESLint pipeline nor the localization pipeline. Therefore, we can
remove our mirror on GitHub and delete it from node_modules.
R=jacktfranklin@chromium.org
DISABLE_THIRD_PARTY_CHECK=Remove esprima
Change-Id: I372b66c973424752bcd487954504c20b2282d0d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2140940
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-04-09 11:42:50 +00:00
Tim van der Lippe
6021e3e22e
Automatically fix imports with missing file extensions
...
Missing file extensions are a runtime error in the browser, even though
TypeScript accepts imports without a file extension.
R=jacktfranklin@chromium.org
Bug: 1011811
Change-Id: I5c5abac2c45be7c8151340cc3981c74c89e96fb7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2116444
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-24 12:19:42 +00:00
Tim van der Lippe
44d389ace1
Relax import style rules for inner-module imports
...
Since imports within a module can be of any style, relax the rules
to also allow `import * as` for all files, not only ARIAutils.js
R=sigurds@chromium.org ,jacktfranklin@chromium.org
Change-Id: I9cd8973176c200c72a6009496e07404b959435a6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2116442
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Sigurd Schneider <sigurds@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-24 11:28:42 +00:00
Tim van der Lippe
4a8441c385
Port license header check to ESLint
...
This improves the PRESUBMIT performance as we can rely on the AST
parsing of ESLint, meaning we don't have to parse AST twice.
It also allows us to use the nice `--fix` solution to insert the proper
license header in the files.
This shaves an expected 5 seconds of the presubmit time
(non-scientifically computed based on 2 uploads).
Change-Id: I5c53e9b232585f9ec46f86b36557c50bf80f7add
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097992
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-12 16:08:22 +00:00
Tim van der Lippe
ba26b2b503
Run ESLint on the scripts directory
...
We weren't running ESLint on this directory and, as it turns out, there
are quite a few linter errors in this folder.
R=jacktfranklin@chromium.org
Change-Id: Ic6cb9f6ad4858f69114e0c433a954041215b49e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096705
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-11 14:47:51 +00:00
Jack Franklin
6a14c8da7c
Allow third_party DEPs to be exempt from import rules
...
We want to use the same rules for importing from third_party but
ultimately if the dep isn't quite structured in a way that lets us do
that we need to be able to make it exempt, which is what this CL does,
starting with `lit-html`.
We don't import `lit-html` on master yet but we do in the Breadcrumbs CL
[1] and we're unable to import everything from the root `lit-html.js`
file as it doesn't expose everything we need.
[1]:
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067066
Change-Id: I0678d5ee75e8dcb376cc40df6f9b37f32fbb557d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097983
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
2020-03-11 14:14:06 +00:00
Jack Franklin
eaa866a0a1
Allow TypeScript to import ls directly
...
(Initially made this change on the breadcrumbs CL but pulled it out).
In the components TypeScript world we want it to be really easy and
obvious which function to use for localized strings. We agreed that `ls`
is the best option.
Right now not all of `Common` is TypeScriptified and that means that
from a TypeScript file you can't do `import * as Common ...`. So to get
around this we create a new module, `Common/ls.ts` which literally
re-exports `ls` from `Common/UIString`.
We then update the ES modules importing rules to special case that:
1. IF you are in a TypeScript file
2. AND the import ends in `common/ls.js`
3. then it's OK - else you have to stick to the usual rules.
I'm sure this will change over time as we migrate more to TypeScript and
build more components but this is a good starting point for enabling
easier localization from TypeScript components.
Additionally we can swap the export in `common/ls.ts` out for a newer
one if we decide to change how it works without changing all the
callsites.
Change-Id: I226525b2e606cf70a50ef37a4d17aa37b18a34ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097978
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org >
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Paul Lewis <aerotwist@chromium.org >
2020-03-11 11:52:36 +00:00
Tim van der Lippe
d6c33c4cd6
Add custom ESLint rule to check ES import statements
...
This makes sure that the guidance of
https://docs.google.com/presentation/d/1KaTDaKEcLmgv3Wum79gPP9mv9x2fm3kuEgx_b8wLVug/edit?usp=sharing
will be caught during build time. This prevent issues where duplication
of code in combination with Rollup can cause runtime issues.
Bug: 1060003
Change-Id: Ic8c8dfcc4e9890592791adc23044033b1aa3ca1b
Fixed: 1060123
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096700
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org >
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org >
2020-03-10 17:33:13 +00:00