Skip to content

Commit

Permalink
Adds prettier commit hook for svelte files (#3745)
Browse files Browse the repository at this point in the history
Adds svelte config for prettier

---------

Co-authored-by: Ndricim <[email protected]>
  • Loading branch information
walmazacn and ndricimrr authored May 28, 2024
1 parent 02ab6a4 commit 90b4d9a
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 200 deletions.
4 changes: 4 additions & 0 deletions core/src/navigation/TabNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@
{#each nodes as node, index2}
{#if !node.hideFromNav}
{#if node.label}
<!-- prettier-ignore -->
{@const isSelected = node === selectedNodeForTabNav}
<span
role="presentation"
Expand All @@ -421,10 +422,13 @@
{/if}
{/each}
{:else if isTabItemWithSubItems(nodes)}
<!-- prettier-ignore -->
{@const uid = `${index}-0`}
<!-- prettier-ignore -->
{@const popoverId = `lui-${uid}-popover`}
{#if isMultiClickAreaTabItem(nodes)}
<!-- prettier-ignore -->
{@const nodeToNavigateTo = getNodeToNavigateTo(nodes)}
<span
{uid}
Expand Down
23 changes: 22 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"lodash.template": ">=4.5.0",
"meow": "8.1.2",
"mixin-deep": ">=1.3.2",
"prettier": "^1.15.3",
"prettier": "^1.19.1",
"prettier-plugin-svelte": "^1.4.2",
"set-value": ">=2.0.1",
"simple-git": "^3.3.0",
"sirv-cli": "^0.4.4",
Expand Down
14 changes: 14 additions & 0 deletions prettier_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,19 @@
"tabWidth": 2,
"singleQuote": true,
"printWidth": 90
},
"svelte": {
"parser": "svelte",
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"printWidth": 120,
"singleQuote": true,
"svelteAllowShorthand": true,
"svelteBracketNewLine": true,
"svelteIndentScriptAndStyle": true,
"svelteSortOrder": "scripts-markup-styles",
"svelteStrictMode": false,
"tabWidth": 2,
"trailingComma": "none"
}
}
225 changes: 117 additions & 108 deletions test/e2e-test-application/src/assets/sampleexternal.html
Original file line number Diff line number Diff line change
@@ -1,129 +1,138 @@
<!DOCTYPE html>
<html>
<head>
<title>External sample page</title>
<link rel="stylesheet" href="/fundamental-styles/fundamental-styles.css" />
<style type="text/css">
body {
padding: 0;
margin: 0;
font-size: 14px;
}

<head>
<title>External sample page</title>
<link rel='stylesheet' href='/fundamental-styles/fundamental-styles.css'>
<style type="text/css">
body {
padding: 0;
margin: 0;
font-size: 14px;
}

blockquote,
figure,
ol,
p,
table,
ul {
margin-top: 0;
margin-bottom: 12px;
}
blockquote,
figure,
ol,
p,
table,
ul {
margin-top: 0;
margin-bottom: 12px;
}

.section-spacer {
height: 800px;
}
.section-spacer {
height: 800px;
}

.fd-form-item {
margin-bottom: 10px;
}
.fd-form-item {
margin-bottom: 10px;
}

.fd-list__item {
display: block;
}
.fd-list__item {
display: block;
}

a {
color: #0a6ed1;
text-decoration: none;
}
a {
color: #0a6ed1;
text-decoration: none;
}

a:hover {
color: #085caf;
}
</style>
</head>
a:hover {
color: #085caf;
}
</style>
</head>

<body>
<a name="ext"></a>
<section class="fd-section">
<div class="fd-section__header">
<h3 class="fd-section__title">Cross Domain Example</h3>
</div>
<div class="fd-layout-panel">
<div class="fd-layout-panel__body">
<p>This page behaves equally to an external hosted micro frontend. <br />For demo purposes, it utilizes manual hiding
of the loading indicator.</p>
<body>
<a name="ext"></a>
<section class="fd-section">
<div class="fd-section__header">
<h3 class="fd-section__title">Cross Domain Example</h3>
</div>
</div>
</section>

<section class="fd-section">
<div class="fd-layout-panel">
<div class="fd-layout-panel__header">
<div class="fd-layout-panel__head">
<h3 class="fd-layout-panel__title">Luigi Client Features</h3>
<div class="fd-layout-panel">
<div class="fd-layout-panel__body">
<p>
This page behaves equally to an external hosted micro frontend. <br />For demo
purposes, it utilizes manual hiding of the loading indicator.
</p>
</div>
</div>
<div class="fd-layout-panel__body">
<p><a class="fd-link" href="javascript:demoLoadingIndicator()">Show loading indicator</a> - and hide it after 3 seconds.<br />
<pre>LuigiClient.uxManager().showLoadingIndicator();
LuigiClient.uxManager().hideLoadingIndicator();</pre>
</p>
</section>

<section class="fd-section">
<div class="fd-layout-panel">
<div class="fd-layout-panel__header">
<div class="fd-layout-panel__head">
<h3 class="fd-layout-panel__title">Luigi Client Features</h3>
</div>
</div>
<div class="fd-layout-panel__body">
<div>
<a class="fd-link" href="javascript:demoLoadingIndicator()"
>Show loading indicator</a
>
- and hide it after 3 seconds.<br />
<pre>
LuigiClient.uxManager().showLoadingIndicator();
LuigiClient.uxManager().hideLoadingIndicator();
</pre
>
</div>
</div>
</div>
</div>
</section>
</section>

<div class="section-spacer"></div>
<a name="one"></a>
<section class="fd-section">
<div class="fd-layout-panel">
<div class="fd-layout-panel__body">
<p><strong>One</strong></p>
<div class="section-spacer"></div>
<a name="one"></a>
<section class="fd-section">
<div class="fd-layout-panel">
<div class="fd-layout-panel__body">
<p><strong>One</strong></p>
</div>
</div>
</div>
</section>
</section>

<div class="section-spacer"></div>
<a name="two"></a>
<section class="fd-section">
<div class="fd-layout-panel">
<div class="fd-layout-panel__body">
<p><strong>Two</strong></p>
<div class="section-spacer"></div>
<a name="two"></a>
<section class="fd-section">
<div class="fd-layout-panel">
<div class="fd-layout-panel__body">
<p><strong>Two</strong></p>
</div>
</div>
</div>
</section>
<div class="section-spacer"></div>
<script type="text/javascript" src="/luigi-client/luigi-client.js"></script>
<script type="text/javascript">
// If node has loadingIndicator.hideAutomatically set to false, we need to manually
// trigger LuigiClient.uxManager().hideLoadingIndicator();
</section>
<div class="section-spacer"></div>
<script type="text/javascript" src="/luigi-client/luigi-client.js"></script>
<script type="text/javascript">
// If node has loadingIndicator.hideAutomatically set to false, we need to manually
// trigger LuigiClient.uxManager().hideLoadingIndicator();

console.info('Delaying loading indicator for demo purposes');
console.info('Delaying loading indicator for demo purposes');

function demoLoadingIndicator() {
LuigiClient.uxManager().showLoadingIndicator();
function demoLoadingIndicator() {
LuigiClient.uxManager().showLoadingIndicator();
hideLoadingIndicator();
}
function hideLoadingIndicator() {
setTimeout(function() {
LuigiClient.uxManager().hideLoadingIndicator();
}, 3000);
}
hideLoadingIndicator();
}
function hideLoadingIndicator() {
setTimeout(function () {
LuigiClient.uxManager().hideLoadingIndicator();
}, 3000);
}
hideLoadingIndicator();
</script>
<script type="text/javascript">
window.addEventListener('popstate', function (event) {
if (window.location.hash) {
var anch = document.getElementsByName(encodeURIComponent(window.location.hash.replace('#', '')));
if (anch.length > 0) {
anch[0].scrollIntoView();
</script>
<script type="text/javascript">
window.addEventListener('popstate', function(event) {
if (window.location.hash) {
var anch = document.getElementsByName(
encodeURIComponent(window.location.hash.replace('#', ''))
);
if (anch.length > 0) {
anch[0].scrollIntoView();
}
} else {
window.scrollTo(0, 0);
}
} else {
window.scrollTo(0, 0);
}
});
</script>
</body>

</html>
});
</script>
</body>
</html>
Loading

0 comments on commit 90b4d9a

Please sign in to comment.