chrome-devtools-frontend 1.0.940255 → 1.0.942095
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/gni/all_devtools_files.gni +0 -13
- package/config/gni/devtools_grd_files.gni +13 -13
- package/config/gni/devtools_image_files.gni +1 -2
- package/front_end/.eslintrc.js +1 -0
- package/front_end/Images/src/feedback_button_icon.svg +3 -0
- package/front_end/Tests.js +15 -0
- package/front_end/core/common/Color.ts +5 -0
- package/front_end/core/i18n/locales/en-US.json +39 -30
- package/front_end/core/i18n/locales/en-XL.json +39 -30
- package/front_end/core/sdk/DOMDebuggerModel.ts +18 -1
- package/front_end/core/sdk/sdk-meta.ts +17 -3
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -7
- package/front_end/entrypoints/main/MainImpl.ts +26 -0
- package/front_end/entrypoints/shell/shell.js +0 -11
- package/front_end/entrypoints/shell/shell.json +0 -1
- package/front_end/entrypoints/worker_app/worker_app.json +0 -4
- package/front_end/generated/InspectorBackendCommands.js +1 -0
- package/front_end/generated/protocol.d.ts +2 -0
- package/front_end/global_typings/global_defs.d.ts +5 -0
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +14 -2
- package/front_end/legacy_test_runner/legacy_test_runner.ts +10 -1
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +9 -0
- package/front_end/models/formatter/SourceFormatter.ts +0 -10
- package/front_end/models/workspace/UISourceCode.ts +9 -42
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/application/ApplicationPanelSidebar.ts +3 -3
- package/front_end/panels/application/application-meta.ts +0 -3
- package/front_end/panels/console/ConsolePinPane.ts +21 -26
- package/front_end/panels/coverage/CoverageDecorationManager.ts +4 -5
- package/front_end/panels/coverage/CoverageView.ts +2 -105
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +11 -56
- package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -8
- package/front_end/panels/elements/ElementsTreeElement.ts +4 -9
- package/front_end/panels/elements/components/adornerSettingsPane.css +0 -4
- package/front_end/panels/emulation/emulation-meta.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +22 -4
- package/front_end/panels/issues/issues-meta.ts +0 -2
- package/front_end/panels/layers/module.json +0 -1
- package/front_end/panels/lighthouse/lighthouseStartView.css +4 -0
- package/front_end/panels/media/media-meta.ts +0 -3
- package/front_end/panels/network/NetworkLogView.ts +3 -0
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -1
- package/front_end/panels/network/network-meta.ts +0 -3
- package/front_end/panels/profiler/module.json +1 -2
- package/front_end/panels/security/security-meta.ts +0 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +16 -30
- package/front_end/panels/sources/CSSPlugin.ts +310 -331
- package/front_end/panels/sources/CallStackSidebarPane.ts +28 -34
- package/front_end/panels/sources/CoveragePlugin.ts +121 -6
- package/front_end/panels/sources/DebuggerPlugin.ts +1166 -1243
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +71 -101
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -3
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +26 -23
- package/front_end/panels/sources/Plugin.ts +20 -4
- package/front_end/panels/sources/ProfilePlugin.ts +185 -0
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/ScriptOriginPlugin.ts +0 -10
- package/front_end/panels/sources/SnippetsPlugin.ts +1 -10
- package/front_end/panels/sources/SourcesPanel.ts +15 -10
- package/front_end/panels/sources/SourcesView.ts +10 -8
- package/front_end/panels/sources/TabbedEditorContainer.ts +31 -27
- package/front_end/panels/sources/UISourceCodeFrame.ts +335 -470
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -2
- package/front_end/panels/sources/sources-legacy.ts +0 -6
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/module.json +0 -2
- package/front_end/third_party/codemirror.next/bundle.ts +9 -13
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/javascript.js +2 -2
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -6
- package/front_end/third_party/codemirror.next/chunk/php.js +2 -6
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +2 -2
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +279 -198
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +13 -11
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +60 -68
- package/front_end/ui/components/data_grid/dataGrid.css +12 -10
- package/front_end/ui/components/docs/css_overview/start_view.html +25 -0
- package/front_end/ui/components/docs/css_overview/start_view.ts +14 -0
- package/front_end/ui/components/docs/panel_feedback/basic.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/basic.ts +20 -0
- package/front_end/ui/components/docs/panel_feedback/button.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/button.ts +18 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +1 -0
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +67 -0
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +100 -0
- package/front_end/ui/components/panel_feedback/panelFeedback.css +76 -0
- package/front_end/ui/components/panel_feedback/panel_feedback.ts +6 -0
- package/front_end/ui/components/report_view/reportValue.css +1 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +79 -36
- package/front_end/ui/components/text_editor/config.ts +42 -26
- package/front_end/ui/components/text_editor/javascript.ts +2 -3
- package/front_end/ui/components/text_editor/position.ts +17 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/components/text_editor/theme.ts +5 -1
- package/front_end/ui/legacy/Infobar.ts +2 -6
- package/front_end/ui/legacy/ShortcutRegistry.ts +11 -7
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +35 -131
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -1
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +3 -6
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +18 -14
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +502 -252
- package/front_end/ui/legacy/components/source_frame/source_frame-legacy.ts +0 -11
- package/front_end/ui/legacy/components/source_frame/source_frame.ts +0 -2
- package/front_end/ui/legacy/components/text_editor/cmdevtools.css +3 -1
- package/front_end/ui/legacy/radioButton.css +1 -13
- package/front_end/ui/legacy/softContextMenu.css +1 -0
- package/front_end/ui/legacy/themeColors.css +36 -0
- package/front_end/ui/legacy/utils/append-style.ts +9 -4
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +23 -9
- package/scripts/build/ninja/generate_css.gni +10 -1
- package/scripts/eslint_rules/lib/check_css_import.js +2 -2
- package/scripts/eslint_rules/tests/check_css_import_test.js +12 -0
- package/front_end/Images/radioDot-dark-theme.png +0 -0
- package/front_end/Images/radioDot.png +0 -0
- package/front_end/panels/application/module.json +0 -7
- package/front_end/panels/issues/module.json +0 -6
- package/front_end/panels/layer_viewer/module.json +0 -6
- package/front_end/panels/media/module.json +0 -6
- package/front_end/panels/network/module.json +0 -6
- package/front_end/panels/security/module.json +0 -5
- package/front_end/ui/legacy/components/perf_ui/module.json +0 -13
- package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +0 -1030
|
@@ -39,17 +39,6 @@ SourceFrame.SourceFrame = SourceFrameModule.SourceFrame.SourceFrameImpl;
|
|
|
39
39
|
/** @interface */
|
|
40
40
|
SourceFrame.LineDecorator = SourceFrameModule.SourceFrame.LineDecorator;
|
|
41
41
|
|
|
42
|
-
/** @constructor */
|
|
43
|
-
SourceFrame.SourcesTextEditor = SourceFrameModule.SourcesTextEditor.SourcesTextEditor;
|
|
44
|
-
|
|
45
|
-
SourceFrame.SourcesTextEditor.Events = SourceFrameModule.SourcesTextEditor.Events;
|
|
46
|
-
SourceFrame.SourcesTextEditor.lineNumbersGutterType = SourceFrameModule.SourcesTextEditor.lineNumbersGutterType;
|
|
47
|
-
|
|
48
|
-
/** @interface */
|
|
49
|
-
SourceFrame.SourcesTextEditorDelegate = SourceFrameModule.SourcesTextEditor.SourcesTextEditorDelegate;
|
|
50
|
-
|
|
51
|
-
SourceFrame.SourcesTextEditor.TokenHighlighter = SourceFrameModule.SourcesTextEditor.TokenHighlighter;
|
|
52
|
-
|
|
53
42
|
/** @constructor */
|
|
54
43
|
SourceFrame.XMLView = SourceFrameModule.XMLView.XMLView;
|
|
55
44
|
|
|
@@ -9,7 +9,6 @@ import * as JSONView from './JSONView.js';
|
|
|
9
9
|
import * as PreviewFactory from './PreviewFactory.js';
|
|
10
10
|
import * as ResourceSourceFrame from './ResourceSourceFrame.js';
|
|
11
11
|
import * as SourceFrame from './SourceFrame.js';
|
|
12
|
-
import * as SourcesTextEditor from './SourcesTextEditor.js';
|
|
13
12
|
import * as XMLView from './XMLView.js';
|
|
14
13
|
|
|
15
14
|
export {
|
|
@@ -20,6 +19,5 @@ export {
|
|
|
20
19
|
PreviewFactory,
|
|
21
20
|
ResourceSourceFrame,
|
|
22
21
|
SourceFrame,
|
|
23
|
-
SourcesTextEditor,
|
|
24
22
|
XMLView,
|
|
25
23
|
};
|
|
@@ -5,31 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
::slotted(input.dt-radio-button) {
|
|
8
|
-
--override-radio-dot: var(--image-file-radioDot);
|
|
9
|
-
|
|
10
8
|
height: 17px;
|
|
11
9
|
width: 17px;
|
|
12
10
|
min-width: 17px;
|
|
13
|
-
border: 1px solid var(--color-details-hairline);
|
|
14
|
-
background-image: linear-gradient(to bottom, var(--color-background-elevation-0), var(--color-background-elevation-1));
|
|
15
11
|
border-radius: 8px;
|
|
16
|
-
appearance: none;
|
|
17
12
|
vertical-align: middle;
|
|
18
13
|
margin: 0 5px 5px 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
::slotted(input.dt-radio-button:checked) {
|
|
22
|
-
background: var(--override-radio-dot) center no-repeat, linear-gradient(to bottom, var(--color-background-elevation-0), var(--color-background-elevation-1));
|
|
14
|
+
accent-color: var(--color-checkbox-accent-color);
|
|
23
15
|
}
|
|
24
16
|
|
|
25
17
|
::slotted(input.dt-radio-button:focus) {
|
|
26
18
|
box-shadow: var(--legacy-focus-ring-active-shadow);
|
|
27
19
|
}
|
|
28
20
|
|
|
29
|
-
:host-context(.-theme-with-dark-background) ::slotted(input.dt-radio-button) {
|
|
30
|
-
--override-radio-dot: var(--image-file-radioDot-dark-theme);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
21
|
@media (forced-colors: active) {
|
|
34
22
|
::slotted(input.dt-radio-button) {
|
|
35
23
|
--gradient-start: ButtonFace;
|
|
@@ -163,9 +163,27 @@
|
|
|
163
163
|
--color-nonmatching-bracket-background: rgb(255 0 0 / 7%);
|
|
164
164
|
--color-editor-selection: #cfe8fc;
|
|
165
165
|
--color-editor-selection-blurred: #e0e0e0;
|
|
166
|
+
--color-trailing-whitespace: rgb(255 0 0 / 5%);
|
|
166
167
|
--color-selected-option: #fff;
|
|
167
168
|
--color-selected-option-background: #1a73e8;
|
|
168
169
|
--color-highlighted-line: rgb(255 255 0 / 50%);
|
|
170
|
+
--color-search-match-border: rgb(128 128 128);
|
|
171
|
+
--color-selected-search-match: var(--color-text-primary);
|
|
172
|
+
--color-selected-search-match-background: rgb(241 234 0);
|
|
173
|
+
--color-coverage-used: #63acbe;
|
|
174
|
+
--color-execution-line-background: rgb(0 59 255 / 10%);
|
|
175
|
+
--color-execution-line-outline: rgb(64 115 244);
|
|
176
|
+
--color-execution-token-background: rgb(15 72 252 / 35%);
|
|
177
|
+
--color-continue-to-location: rgb(5 65 255 / 10%);
|
|
178
|
+
--color-continue-to-location-hover: rgb(15 72 252 / 35%);
|
|
179
|
+
--color-continue-to-location-hover-border: rgb(121 141 254);
|
|
180
|
+
--color-continue-to-location-async: rgb(58 162 8 / 30%);
|
|
181
|
+
--color-continue-to-location-async-hover: rgb(75 179 6 / 55%);
|
|
182
|
+
--color-continue-to-location-async-hover-border: rgb(100 154 100);
|
|
183
|
+
--color-evaluated-expression: rgb(255 255 11 / 25%);
|
|
184
|
+
--color-evaluated-expression-border: rgb(163 41 34);
|
|
185
|
+
--color-variable-values: #ffe3c7;
|
|
186
|
+
--color-non-breakable-line: rgb(128 128 128 / 40%);
|
|
169
187
|
}
|
|
170
188
|
|
|
171
189
|
.-theme-with-dark-background {
|
|
@@ -285,7 +303,25 @@
|
|
|
285
303
|
--color-nonmatching-bracket-background: initial;
|
|
286
304
|
--color-editor-selection: hsl(207deg 88% 22%);
|
|
287
305
|
--color-editor-selection-blurred: #454545;
|
|
306
|
+
--color-trailing-whitespace: rgb(255 0 0 / 5%);
|
|
288
307
|
--color-selected-option: #fff;
|
|
289
308
|
--color-selected-option-background: #0e639c;
|
|
290
309
|
--color-highlighted-line: hsl(133deg 100% 30% / 50%);
|
|
310
|
+
--color-search-match-border: rgb(128 128 128);
|
|
311
|
+
--color-selected-search-match: #eee;
|
|
312
|
+
--color-selected-search-match-background: hsl(133deg 100% 30%);
|
|
313
|
+
--color-coverage-used: rgb(65 138 156);
|
|
314
|
+
--color-execution-line-background: rgb(0 154 17 / 30%);
|
|
315
|
+
--color-execution-line-outline: #33cc6b;
|
|
316
|
+
--color-execution-token-background: rgb(132 237 78 / 20%);
|
|
317
|
+
--color-continue-to-location: rgb(0 173 56 / 35%);
|
|
318
|
+
--color-continue-to-location-hover: rgb(0 173 56 / 35%);
|
|
319
|
+
--color-continue-to-location-hover-border: #33cc6b;
|
|
320
|
+
--color-continue-to-location-async: rgb(87 238 0 / 20%);
|
|
321
|
+
--color-continue-to-location-async-hover: rgb(128 241 48 / 50%);
|
|
322
|
+
--color-continue-to-location-async-hover-border: rgb(101 155 101);
|
|
323
|
+
--color-evaluated-expression: rgb(71 70 0 / 75%);
|
|
324
|
+
--color-evaluated-expression-border: rgb(221 99 92);
|
|
325
|
+
--color-variable-values: rgb(56 28 0);
|
|
326
|
+
--color-non-breakable-line: rgb(127 127 127 / 40%);
|
|
291
327
|
}
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Root from '../../../core/root/root.js';
|
|
6
6
|
|
|
7
|
-
export function appendStyle(node: Node,
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
7
|
+
export function appendStyle(node: Node, cssReference: string|{cssContent: string}): void {
|
|
8
|
+
let content: string;
|
|
9
|
+
if (typeof cssReference === 'string') {
|
|
10
|
+
content = Root.Runtime.cachedResources.get(cssReference) || '';
|
|
11
|
+
if (!content) {
|
|
12
|
+
console.error(cssReference + ' not preloaded. Check module.json');
|
|
13
|
+
}
|
|
14
|
+
} else {
|
|
15
|
+
content = cssReference.cssContent;
|
|
11
16
|
}
|
|
12
17
|
const styleElement = document.createElement('style');
|
|
13
18
|
styleElement.textContent = content;
|
package/package.json
CHANGED
|
@@ -4,34 +4,48 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const CleanCSS = require('clean-css');
|
|
7
|
-
const [, , isDebugString, targetName, srcDir, targetGenDir, files] = process.argv;
|
|
7
|
+
const [, , isDebugString, legacyString, targetName, srcDir, targetGenDir, files] = process.argv;
|
|
8
8
|
|
|
9
9
|
const filenames = files.split(',');
|
|
10
10
|
const configFiles = [];
|
|
11
11
|
const cleanCSS = new CleanCSS();
|
|
12
12
|
const isDebug = isDebugString === 'true';
|
|
13
|
+
const isLegacy = legacyString === 'true';
|
|
13
14
|
|
|
14
15
|
for (const fileName of filenames) {
|
|
15
16
|
let output = fs.readFileSync(path.join(srcDir, fileName), {encoding: 'utf8', flag: 'r'});
|
|
16
17
|
output = output.replace(/\`/g, '\\\'');
|
|
17
18
|
output = output.replace(/\\/g, '\\\\');
|
|
18
19
|
|
|
20
|
+
const stylesheetContents = isDebug ? output : cleanCSS.minify(output).styles;
|
|
21
|
+
|
|
22
|
+
let exportStatement;
|
|
23
|
+
if (isLegacy) {
|
|
24
|
+
exportStatement = `export default {
|
|
25
|
+
cssContent: \`${stylesheetContents}\`
|
|
26
|
+
};`;
|
|
27
|
+
} else {
|
|
28
|
+
exportStatement = `const styles = new CSSStyleSheet();
|
|
29
|
+
styles.replaceSync(
|
|
30
|
+
\`${stylesheetContents}
|
|
31
|
+
/*# sourceURL=${fileName} */
|
|
32
|
+
\`);
|
|
33
|
+
export default styles;`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const generatedFileName = `${fileName}${isLegacy ? '.legacy' : ''}.js`;
|
|
37
|
+
|
|
19
38
|
fs.writeFileSync(
|
|
20
|
-
path.join(targetGenDir,
|
|
39
|
+
path.join(targetGenDir, generatedFileName),
|
|
21
40
|
`// Copyright ${new Date().getFullYear()} The Chromium Authors. All rights reserved.
|
|
22
41
|
// Use of this source code is governed by a BSD-style license that can be
|
|
23
42
|
// found in the LICENSE file.
|
|
24
43
|
// IMPORTANT: this file is auto generated. Please do not edit this file.
|
|
25
44
|
/* istanbul ignore file */
|
|
26
|
-
|
|
27
|
-
styles.replaceSync(
|
|
28
|
-
\`${isDebug ? output : cleanCSS.minify(output).styles}
|
|
29
|
-
/*# sourceURL=${fileName} */
|
|
30
|
-
\`);
|
|
31
|
-
export default styles;
|
|
45
|
+
${exportStatement}
|
|
32
46
|
`);
|
|
33
47
|
|
|
34
|
-
configFiles.push(`\"${
|
|
48
|
+
configFiles.push(`\"${generatedFileName}\"`);
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
fs.writeFileSync(path.join(targetGenDir, `${targetName}-tsconfig.json`), `{
|
|
@@ -18,6 +18,7 @@ template("generate_css") {
|
|
|
18
18
|
|
|
19
19
|
args = [
|
|
20
20
|
"$is_debug",
|
|
21
|
+
"${invoker.legacy}",
|
|
21
22
|
target_name,
|
|
22
23
|
_src,
|
|
23
24
|
_dest,
|
|
@@ -26,7 +27,11 @@ template("generate_css") {
|
|
|
26
27
|
|
|
27
28
|
outputs = []
|
|
28
29
|
foreach(_input, sources) {
|
|
29
|
-
|
|
30
|
+
_file_name = _input
|
|
31
|
+
if (invoker.legacy) {
|
|
32
|
+
_file_name = "$_file_name.legacy"
|
|
33
|
+
}
|
|
34
|
+
outputs += [ "$target_gen_dir/$_file_name.js" ]
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
data = outputs
|
|
@@ -38,3 +43,7 @@ template("generate_css") {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
}
|
|
46
|
+
|
|
47
|
+
set_defaults("generate_css") {
|
|
48
|
+
legacy = false
|
|
49
|
+
}
|
|
@@ -31,10 +31,10 @@ module.exports = {
|
|
|
31
31
|
ImportDeclaration(node) {
|
|
32
32
|
const importPath = path.normalize(node.source.value);
|
|
33
33
|
|
|
34
|
-
if (importPath.endsWith('.css.js')) {
|
|
34
|
+
if (importPath.endsWith('.css.js') || importPath.endsWith('.css.legacy.js')) {
|
|
35
35
|
const importingFileName = path.resolve(context.getFilename());
|
|
36
36
|
const exportingFileName = path.resolve(path.dirname(importingFileName), importPath);
|
|
37
|
-
const importedCSS = exportingFileName.replace(
|
|
37
|
+
const importedCSS = exportingFileName.replace(/(\.legacy)?\.js$/, '');
|
|
38
38
|
|
|
39
39
|
if (!fs.existsSync(importedCSS)) {
|
|
40
40
|
context.report({
|
|
@@ -14,6 +14,10 @@ ruleTester.run('check_css_import', rule, {
|
|
|
14
14
|
code: 'import styles from \'./check_css_import_test_file.css.js\';',
|
|
15
15
|
filename: 'scripts/eslint_rules/tests/file.ts',
|
|
16
16
|
},
|
|
17
|
+
{
|
|
18
|
+
code: 'import styles from \'./check_css_import_test_file.css.legacy.js\';',
|
|
19
|
+
filename: 'scripts/eslint_rules/tests/file.ts',
|
|
20
|
+
},
|
|
17
21
|
{
|
|
18
22
|
code: 'import styles from \'../../../scripts/eslint_rules/tests/check_css_import_test_file.css.js\';',
|
|
19
23
|
filename: 'front_end/ui/components/file.ts',
|
|
@@ -29,6 +33,14 @@ ruleTester.run('check_css_import', rule, {
|
|
|
29
33
|
message: 'File styles.css does not exist. Check you are importing the correct file.',
|
|
30
34
|
}],
|
|
31
35
|
},
|
|
36
|
+
{
|
|
37
|
+
// Files that do not exist are caught
|
|
38
|
+
code: 'import styles from \'styles.css.legacy.js\';',
|
|
39
|
+
filename: 'front_end/ui/components/component/file.ts',
|
|
40
|
+
errors: [{
|
|
41
|
+
message: 'File styles.css does not exist. Check you are importing the correct file.',
|
|
42
|
+
}],
|
|
43
|
+
},
|
|
32
44
|
{
|
|
33
45
|
// Filename typos are caught
|
|
34
46
|
code: 'import styles from \'../../../scripts/eslint_rules/test/check_css_import_tests_file.css.js\';',
|
|
Binary file
|
|
Binary file
|