Skip to content

Commit 808d1e3

Browse files
committed
format existing files
1 parent d1eaccd commit 808d1e3

File tree

83 files changed

+453
-434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+453
-434
lines changed

lit-dev.code-workspace

+13-13
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@
22
"folders": [
33
{
44
"name": "lit-dev-content",
5-
"path": "packages/lit-dev-content"
5+
"path": "packages/lit-dev-content",
66
},
77
{
88
"name": "lit-dev-tools-cjs",
9-
"path": "packages/lit-dev-tools-cjs"
9+
"path": "packages/lit-dev-tools-cjs",
1010
},
1111
{
1212
"name": "lit-dev-tools-esm",
13-
"path": "packages/lit-dev-tools-esm"
13+
"path": "packages/lit-dev-tools-esm",
1414
},
1515
{
1616
"name": "lit-dev-tests",
17-
"path": "packages/lit-dev-tests"
17+
"path": "packages/lit-dev-tests",
1818
},
1919
{
2020
"name": "lit-dev-api",
21-
"path": "packages/lit-dev-api"
21+
"path": "packages/lit-dev-api",
2222
},
2323
{
2424
"name": "lit-dev-server",
25-
"path": "packages/lit-dev-server"
25+
"path": "packages/lit-dev-server",
2626
},
2727
{
2828
"name": "lit-dev-discord-bot",
29-
"path": "packages/lit-dev-discord-bot"
29+
"path": "packages/lit-dev-discord-bot",
3030
},
3131
{
3232
"name": "lit.dev",
33-
"path": "."
34-
}
33+
"path": ".",
34+
},
3535
],
3636
"settings": {
3737
"files.insertFinalNewline": true,
3838
"files.trimTrailingWhitespace": true,
3939
"[typescript]": {
40-
"editor.defaultFormatter": "esbenp.prettier-vscode"
40+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4141
},
4242
"search.exclude": {
43-
"api-data/*/repo": true
43+
"api-data/*/repo": true,
4444
},
4545
},
4646
"extensions": {
47-
"recommendations": ["esbenp.prettier-vscode"]
48-
}
47+
"recommendations": ["esbenp.prettier-vscode"],
48+
},
4949
}

packages/lit-dev-cloudbuild-cleanup/src/cleanup.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function main() {
3939
if (!PROJECT_ID || !REPO_NAME || !_DEPLOY_REGION) {
4040
console.log({PROJECT_ID, REPO_NAME, _DEPLOY_REGION});
4141
throw new Error(
42-
'Missing one or more required environment variables: PROJECT_ID, REPO_NAME, _DEPLOY_REGION'
42+
'Missing one or more required environment variables: PROJECT_ID, REPO_NAME, _DEPLOY_REGION',
4343
);
4444
}
4545

@@ -98,7 +98,7 @@ async function main() {
9898
!rev.metadata.name
9999
) {
100100
throw new Error(
101-
`Found revision with missing necessary metadata: ${JSON.stringify(rev)}`
101+
`Found revision with missing necessary metadata: ${JSON.stringify(rev)}`,
102102
);
103103
}
104104

@@ -160,7 +160,7 @@ async function main() {
160160
} else if (!t.tag.startsWith('main')) {
161161
// Unrecognized tags are kept just in case
162162
console.log(
163-
`Found unrecognized tag "${t.tag}". This will not be deleted.`
163+
`Found unrecognized tag "${t.tag}". This will not be deleted.`,
164164
);
165165
revisionsToKeep.add(t.revisionName);
166166
return true;

packages/lit-dev-content/.eleventy.js

+32-32
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module.exports = function (eleventyConfig) {
7171

7272
eleventyConfig.addWatchTarget('../lit-dev-api/api-data/*/*.json');
7373
eleventyConfig.addWatchTarget(
74-
'../lit-dev-content/samples/tutorials/**/tutorial.json'
74+
'../lit-dev-content/samples/tutorials/**/tutorial.json',
7575
);
7676
eleventyConfig.addWatchTarget('../lit-dev-content/samples/tutorials/**/*.md');
7777
eleventyConfig.addWatchTarget('../lit-dev-content/rollupout/server/*');
@@ -119,14 +119,14 @@ ${content}
119119
Object.assign(new state.Token('div_open', 'div', 1), {
120120
attrs: [['class', `heading ${headingTag}`]],
121121
block: true,
122-
})
122+
}),
123123
);
124124
state.tokens.splice(
125125
idx + 4,
126126
0,
127127
Object.assign(new state.Token('div_close', 'div', -1), {
128128
block: true,
129-
})
129+
}),
130130
);
131131
linkAfterHeaderBase(slug, opts, state, idx + 1);
132132
};
@@ -165,16 +165,16 @@ ${content}
165165
function (url, latestVersion) {
166166
if (!latestVersion) {
167167
throw new Error(
168-
`No latestVersion provided to 'removeLatestVersionFromUrl`
168+
`No latestVersion provided to 'removeLatestVersionFromUrl`,
169169
);
170170
}
171171
if (!url.includes(`/${latestVersion}/`)) {
172172
throw new Error(
173-
`'${url}' does not include the latestVersion versioned path segment`
173+
`'${url}' does not include the latestVersion versioned path segment`,
174174
);
175175
}
176176
return url.replace(`/${latestVersion}/`, '/');
177-
}
177+
},
178178
);
179179

180180
/**
@@ -191,11 +191,11 @@ ${content}
191191
}
192192
if (!latestVersion) {
193193
throw new Error(
194-
`latestVersion not provided to 'fixUnversionedCrossLinks`
194+
`latestVersion not provided to 'fixUnversionedCrossLinks`,
195195
);
196196
}
197197
return content.replaceAll(`/docs/${latestVersion}/`, '/docs/');
198-
}
198+
},
199199
);
200200

201201
eleventyConfig.addFilter('removeExtension', function (url) {
@@ -446,7 +446,7 @@ ${content}
446446
if (location === undefined) {
447447
throw new Error(
448448
`Ambiguous symbol ${symbol}. ` +
449-
`Options: ${locations.map((l) => l.anchor).join(', ')}`
449+
`Options: ${locations.map((l) => l.anchor).join(', ')}`,
450450
);
451451
}
452452

@@ -459,17 +459,17 @@ ${content}
459459
'api-v3',
460460
'/docs/v3/api',
461461
JSON.parse(
462-
fsSync.readFileSync('../lit-dev-api/api-data/lit-3/symbols.json', 'utf8')
463-
)
462+
fsSync.readFileSync('../lit-dev-api/api-data/lit-3/symbols.json', 'utf8'),
463+
),
464464
);
465465

466466
addApiShortcode(
467467
'api',
468468
'/docs/v2/api',
469469
// Don't use require() because of Node caching in watch mode.
470470
JSON.parse(
471-
fsSync.readFileSync('../lit-dev-api/api-data/lit-2/symbols.json', 'utf8')
472-
)
471+
fsSync.readFileSync('../lit-dev-api/api-data/lit-2/symbols.json', 'utf8'),
472+
),
473473
);
474474

475475
addApiShortcode(
@@ -478,9 +478,9 @@ ${content}
478478
JSON.parse(
479479
fsSync.readFileSync(
480480
'../lit-dev-api/api-data/lit-html-1/symbols.json',
481-
'utf8'
482-
)
483-
)
481+
'utf8',
482+
),
483+
),
484484
);
485485

486486
addApiShortcode(
@@ -489,9 +489,9 @@ ${content}
489489
JSON.parse(
490490
fsSync.readFileSync(
491491
'../lit-dev-api/api-data/lit-element-2/symbols.json',
492-
'utf8'
493-
)
494-
)
492+
'utf8',
493+
),
494+
),
495495
);
496496

497497
/**
@@ -520,7 +520,7 @@ ${content}
520520
`CleanCSS errors/warnings on file ${path}:\n\n${[
521521
...result.errors,
522522
...result.warnings,
523-
].join('\n')}`
523+
].join('\n')}`,
524524
);
525525
}
526526
return `<style>${result.styles}</style>`;
@@ -554,14 +554,14 @@ ${content}
554554
// Source: https://github.com/11ty/eleventy-base-blog/blob/master/.eleventy.js
555555
eleventyConfig.addFilter('readableDate', (dateObj) => {
556556
return luxon.DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat(
557-
'LLL d, yyyy'
557+
'LLL d, yyyy',
558558
);
559559
});
560560

561561
// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
562562
eleventyConfig.addFilter('yyyymmdd', (dateObj) => {
563563
return luxon.DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat(
564-
'yyyy-LL-dd'
564+
'yyyy-LL-dd',
565565
);
566566
});
567567

@@ -587,15 +587,15 @@ ${content}
587587
ENV.eleventyOutDir + '/docs/v3/introduction.html',
588588
ENV.eleventyOutDir + '/docs/v3/*/index.html',
589589
],
590-
{ignore: ENV.eleventyOutDir + '/docs/(v1|v2|v3)/index.html'}
590+
{ignore: ENV.eleventyOutDir + '/docs/(v1|v2|v3)/index.html'},
591591
)
592592
).filter(
593593
// TODO(aomarks) This is brittle, we need a way to annotate inside an md
594594
// file that a page shouldn't be generated.
595595
(file) =>
596596
!file.includes('why-lit') &&
597597
!file.includes('getting-started') &&
598-
!file.includes('browser-support')
598+
!file.includes('browser-support'),
599599
);
600600
await Promise.all(emptyDocsIndexFiles.map((path) => fs.unlink(path)));
601601

@@ -611,32 +611,32 @@ ${content}
611611
// immediately, instead of triggering an Eleventy build.
612612
await symlinkForce(
613613
path.join(__dirname, 'site', 'css'),
614-
path.join(__dirname, ENV.eleventyOutDir, 'css')
614+
path.join(__dirname, ENV.eleventyOutDir, 'css'),
615615
);
616616
await symlinkForce(
617617
path.join(__dirname, 'site', 'images'),
618-
path.join(__dirname, ENV.eleventyOutDir, 'images')
618+
path.join(__dirname, ENV.eleventyOutDir, 'images'),
619619
);
620620
await symlinkForce(
621621
path.join(__dirname, 'site', 'fonts'),
622-
path.join(__dirname, ENV.eleventyOutDir, 'fonts')
622+
path.join(__dirname, ENV.eleventyOutDir, 'fonts'),
623623
);
624624
await symlinkForce(
625625
path.join(__dirname, 'samples'),
626-
path.join(__dirname, ENV.eleventyOutDir, 'samples')
626+
path.join(__dirname, ENV.eleventyOutDir, 'samples'),
627627
);
628628

629629
// Symlink lib -> _dev/js. This lets us directly reference tsc outputs in
630630
// dev mode, instead of the Rollup bundles we use for production.
631631
await symlinkForce(
632632
path.join(__dirname, 'lib'),
633-
path.join(__dirname, ENV.eleventyOutDir, 'js')
633+
path.join(__dirname, ENV.eleventyOutDir, 'js'),
634634
);
635635
} else {
636636
// Inline all Playground project files directly into their manifests, to
637637
// cut down on requests per project.
638638
await inlinePlaygroundFilesIntoManifests(
639-
`${ENV.eleventyOutDir}/samples/**/project.json`
639+
`${ENV.eleventyOutDir}/samples/**/project.json`,
640640
);
641641

642642
// Pre-compress all outputs as .br and .gz files so the server can read
@@ -649,7 +649,7 @@ ${content}
649649
await fs.writeFile(
650650
path.join(ENV.eleventyOutDir, 'csp-inline-script-hashes.txt'),
651651
[...cspInlineScriptHashes].join('\n'),
652-
'utf8'
652+
'utf8',
653653
);
654654
}
655655
});
@@ -676,7 +676,7 @@ ${content}
676676
// In prod SSR should use the lit templates run through the minifier.
677677
if (!DEV) {
678678
componentModules = componentModules.map((componentPath) =>
679-
componentPath.replace('lib/components', 'rollupout/server')
679+
componentPath.replace('lib/components', 'rollupout/server'),
680680
);
681681
}
682682

packages/lit-dev-content/src/code-language-preference.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const getCodeLanguagePreference = (): CodeLanguagePreference =>
6464
*/
6565
export const setCodeLanguagePreference = (
6666
preference: CodeLanguagePreference,
67-
force = false
67+
force = false,
6868
): void => {
6969
if (!force) {
7070
let cancelled = false;
@@ -75,7 +75,7 @@ export const setCodeLanguagePreference = (
7575
},
7676
};
7777
window.dispatchEvent(
78-
new CustomEvent(BEFORE_CODE_LANGUAGE_CHANGE, {detail})
78+
new CustomEvent(BEFORE_CODE_LANGUAGE_CHANGE, {detail}),
7979
);
8080
if (cancelled) {
8181
return;

packages/lit-dev-content/src/components/algolia-search-controller.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class AgloliaSearchController<T extends {}> {
6262
constructor(
6363
host: ReactiveControllerHost,
6464
argsFn: () => string,
65-
options?: Partial<AlgoliaSearchControllerOptions>
65+
options?: Partial<AlgoliaSearchControllerOptions>,
6666
) {
6767
const opts = {...agloliaSearchControllerDefaultOptions, ...options};
6868
this._indexName = opts.index;
@@ -75,7 +75,7 @@ export class AgloliaSearchController<T extends {}> {
7575
this._task = new Task(
7676
host,
7777
([text]) => this._querySearch(text),
78-
() => [argsFn()]
78+
() => [argsFn()],
7979
);
8080

8181
aa('init', {

packages/lit-dev-content/src/components/lazy-svg.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export default class LazySvg extends LitElement {
147147
},
148148
{
149149
rootMargin: this.rootMargin,
150-
}
150+
},
151151
);
152152
observer.observe(this._svgEl);
153153
}

packages/lit-dev-content/src/components/litdev-aside.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class LitDevAside extends LitElement {
9090
default:
9191
const exhaustiveCheck: never = this.type;
9292
console.warn(
93-
`Received unexpected type for <litdev-aside>: ${exhaustiveCheck}`
93+
`Received unexpected type for <litdev-aside>: ${exhaustiveCheck}`,
9494
);
9595
return nothing;
9696
}

packages/lit-dev-content/src/components/litdev-banner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class LitDevBanner extends HTMLElement {
3333
if (size) {
3434
document.documentElement.style.setProperty(
3535
'--banner-height',
36-
`${size.blockSize}px`
36+
`${size.blockSize}px`,
3737
);
3838
}
3939
});

packages/lit-dev-content/src/components/litdev-code-language-switch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ export class LitDevCodeLanguageSwitch extends LitElement {
113113
super.connectedCallback();
114114
window.addEventListener(
115115
CODE_LANGUAGE_CHANGE,
116-
this._onCodeLanguagePreferenceChanged
116+
this._onCodeLanguagePreferenceChanged,
117117
);
118118
}
119119

120120
override disconnectedCallback() {
121121
super.disconnectedCallback();
122122
window.removeEventListener(
123123
CODE_LANGUAGE_CHANGE,
124-
this._onCodeLanguagePreferenceChanged
124+
this._onCodeLanguagePreferenceChanged,
125125
);
126126
}
127127

packages/lit-dev-content/src/components/litdev-cookie-banner.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export default class LitdevCookieBanner extends LitElement {
3131
/* Material 2 elevation 5
3232
https://lit.dev/playground/?mods=gists#gist=3ee0643323ce76d53bb8f5a98149dd45
3333
*/
34-
box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 5px -1px,
34+
box-shadow:
35+
rgba(0, 0, 0, 0.2) 0px 3px 5px -1px,
3536
rgba(0, 0, 0, 0.14) 0px 5px 8px 0px,
3637
rgba(0, 0, 0, 0.12) 0px 1px 14px 0px;
3738
}

0 commit comments

Comments
 (0)