Repository Analysis

lit/lit

Lit is a simple library for building fast, lightweight web components.

0.9 Likely human-written View on GitHub
0.9
Adjusted Score
0.9
Raw Score
100%
Time Factor
2026-05-28
Last Push
21,633
Stars
TypeScript
Language
215,419
Lines of Code
1641
Files
159
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 1MEDIUM 4LOW 154

Pattern Findings

159 matches across 6 categories. Click a row to expand file-level details.

Over-Commented Block67 hits · 67 pts
SeverityFileLineSnippet
LOWrollup-common.js101// lowercase letters for short, public APIs. Keep this list in order by mangled
LOWrollup-common.js321 // access internal details of lit-html.js.
LOWrollup-common.js421 // const DEV_MODE = true;
LOWrollup-common.js501 'const ENABLE_EXTRA_SECURITY_HOOKS = false',
LOW…s/labs/tsserver-plugin/src/lib/lit-language-service.ts201 element: (element: Element) => {
LOWpackages/labs/ssr-client/src/lib/hydrate-lit-html.ts241 // https://github.com/lit/lit/issues/1434
LOWpackages/labs/ssr-client/src/lib/hydrate-lit-html.ts481
LOWpackages/labs/preact-signals/src/lib/watch.ts41 this.__dispose?.();
LOWpackages/labs/signals/src/lib/signal-watcher.ts301 super.disconnectedCallback();
LOWpackages/labs/ssr-dom-shim/src/index.ts421};
LOW…s/labs/ssr-dom-shim/src/test/event-target-shim_test.ts281 'slot:2/non-capture/BUBBLING_PHASE/child:3',
LOW…ckages/labs/motion/src/test/animate_controller_test.ts21
LOW…ckages/labs/motion/src/test/animate_controller_test.ts41// options: AnimateOptions = {onStart, onComplete},
LOW…ckages/labs/motion/src/test/animate_controller_test.ts61// opacity: 0;
LOW…ckages/labs/motion/src/test/animate_controller_test.ts81// </div>`;
LOW…ckages/labs/motion/src/test/animate_controller_test.ts101
LOWpackages/labs/ssr/src/test/integration/tests/basic.ts841 },
LOWpackages/labs/ssr/src/test/integration/tests/basic.ts861 // async setup() {
LOWpackages/labs/ssr/src/test/integration/tests/basic.ts881 // return {
LOW…ges/labs/ssr/src/test/test-files/render-test-module.ts501
LOWpackages/labs/ssr/src/lib/render-value.ts801 // - Literal sections of the template
LOWpackages/labs/ssr/src/lib/render-result-readable.ts41
LOW…labs/observers/src/test/performance-controller_test.ts41 await nextFrame();
LOW…/compiler/test_files/handle_deprecated_octal_escape.js1import {html} from 'lit';
LOW…er/test_files/handle_deprecated_octal_escape.golden.js1import { html } from 'lit';
LOWpackages/labs/analyzer/src/lib/package-analyzer.ts61 allowJs: true,
LOWpackages/labs/analyzer/src/lib/javascript/classes.ts341 // as references. If we want to support complex expressions in future,
LOWpackages/labs/analyzer/src/lib/javascript/modules.ts301 */
LOW…bs/virtualizer/src/test/scenarios/item-changes.test.ts81 // If outOfBounds is true, then the directive's
LOW…c/polyfills/resize-observer-polyfill/ResizeObserver.js481 var vertPad = paddings.top + paddings.bottom;
LOW…c/polyfills/resize-observer-polyfill/ResizeObserver.js501 if (Math.round(height + vertPad) !== clientHeight) {
LOW…tdata/build-transform-xliff/goldens/tsout/zh_CN/foo.js21// end tag).
LOW…data/build-transform-xliff/goldens/tsout/es-419/foo.js21// end tag).
LOW…testdata/build-transform-xliff/goldens/tsout/en/foo.js21// end tag).
LOW…a/build-transform-xliff-std/goldens/tsout/zh_CN/foo.js21// end tag).
LOW…/build-transform-xliff-std/goldens/tsout/es-419/foo.js21// end tag).
LOW…data/build-transform-xliff-std/goldens/tsout/en/foo.js21// end tag).
LOWpackages/localize-tools/src/modes/transform.ts281 //
LOWpackages/localize-tools/src/modes/runtime.ts201 * if there is embedded HTML.
LOWpackages/lit-starter-js/web-test-runner.config.js21// {
LOWpackages/lit-starter-js/web-test-runner.config.js41// capabilities: {
LOWpackages/lit-starter-js/web-test-runner.config.js61 // ===========
LOWpackages/lit-starter-ts/web-test-runner.config.js21// {
LOWpackages/lit-starter-ts/web-test-runner.config.js41// capabilities: {
LOWpackages/lit-starter-ts/web-test-runner.config.js61 // ===========
LOWpackages/lit-html/src/lit-html.ts801): [TrustedHTML, Array<string>] => {
LOWpackages/lit-html/src/lit-html.ts1681 private _commitIterable(value: Iterable<unknown>): void {
LOWpackages/lit-html/src/polyfill-support.ts141 if (hasScopeCss) {
LOWpackages/lit-html/src/polyfill-support.ts221 const scope = this.options?.scope;
LOWpackages/lit-html/src/directives/repeat.ts101 // oldParts is not an Array then this is the first render and we return
LOWpackages/lit-html/src/directives/repeat.ts121 // Maps from key to index for current and previous update; these
LOWpackages/lit-html/src/directives/repeat.ts141 // The initial scenario might look like this (for brevity of
LOWpackages/lit-html/src/directives/repeat.ts161 // `oldHead` and `newHead` pointers (will be reflected in the
LOWpackages/lit-html/src/directives/repeat.ts181 // newHead ^ ^ newTail
LOWpackages/lit-html/src/directives/repeat.ts201 // newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail
LOWpackages/lit-html/src/directives/repeat.ts221 // oldHead v v oldTail
LOWpackages/lit-html/src/directives/repeat.ts241 // * Example below: the head pointers once again match, so
LOWpackages/lit-html/src/directives/repeat.ts261 // oldHead v v oldTail
LOWpackages/lit-html/src/directives/repeat.ts281 // newHead ^ ^ newTail
LOWpackages/lit-html/src/directives/repeat.ts301 // it at the new head position, and the update is complete.
7 more matches not shown…
Fake / Example Data45 hits · 60 pts
SeverityFileLineSnippet
LOWpackages/labs/motion/demo/hero.html370 qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
LOWpackages/labs/motion/demo/hero.html370 qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
LOWpackages/labs/analyzer/test-files/js/classes/classes.js107 * @description TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOWpackages/labs/analyzer/test-files/js/classes/classes.js107 * @description TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOWpackages/labs/analyzer/test-files/js/classes/classes.js117 * UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOWpackages/labs/analyzer/test-files/js/classes/classes.js117 * UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…ges/labs/analyzer/test-files/ts/classes/src/classes.ts97 * @description TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…ges/labs/analyzer/test-files/ts/classes/src/classes.ts97 * @description TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…ges/labs/analyzer/test-files/ts/classes/src/classes.ts107 * UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…ges/labs/analyzer/test-files/ts/classes/src/classes.ts107 * UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…/analyzer/test-files/ts/vanilla-jsdoc/src/element-a.ts51 * @description TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…/analyzer/test-files/ts/vanilla-jsdoc/src/element-a.ts51 * @description TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…/analyzer/test-files/ts/vanilla-jsdoc/src/element-a.ts61 * UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…/analyzer/test-files/ts/vanilla-jsdoc/src/element-a.ts61 * UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…bs/analyzer/src/test/server/javascript/classes_test.ts22 `TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…bs/analyzer/src/test/server/javascript/classes_test.ts22 `TaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…bs/analyzer/src/test/server/javascript/classes_test.ts36 `UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOW…bs/analyzer/src/test/server/javascript/classes_test.ts36 `UntaggedDescription description. Lorem ipsum dolor sit amet, consectetur
LOWpackages/labs/eleventy-plugin-lit/demo/test.md10Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWpackages/labs/eleventy-plugin-lit/demo/test.md10Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWpackages/labs/eleventy-plugin-lit/demo/test.md16Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWpackages/labs/eleventy-plugin-lit/demo/test.md16Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json168 "longText": "Esse ullamco veniam aliquip cillum aliqua veniam in consequat eu cupidatat. Ad amet reprehenderit sit a
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json652 "longText": "Consequat laborum est irure eiusmod fugiat dolore fugiat do. Consequat occaecat deserunt non consectetu
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json1092 "longText": "Qui cillum proident id irure quis sit. Sit nisi et fugiat amet exercitation eiusmod esse enim pariatur
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json1400 "longText": "Ullamco veniam exercitation velit eu aute fugiat nisi dolor do. Deserunt culpa laboris ipsum cillum sun
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json2060 "longText": "Anim voluptate consequat et deserunt. Officia culpa quis consequat et occaecat adipisicing commodo ipsu
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json3864 "longText": "Excepteur voluptate irure proident enim nulla eiusmod anim enim nisi id et incididunt velit. Id anim ex
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json4326 "longText": "Officia nulla cillum duis nostrud labore mollit eiusmod labore ut aliqua elit incididunt. Minim exercit
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json5909 "mediumText": "Tempor sunt anim occaecat in irure occaecat enim cupidatat voluptate ex laboris enim. Exercitation fu
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json6372 "longText": "Consectetur aute officia nisi sint ut enim consequat. Id culpa in velit tempor nulla officia culpa. Ips
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json6438 "longText": "Amet veniam ex eiusmod ex nulla consequat nulla non duis officia. Reprehenderit esse laborum laboris ve
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json8021 "mediumText": "Ullamco elit eu id excepteur incididunt Lorem ipsum pariatur laboris incididunt Lorem ullamco. Veniam
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json8154 "longText": "Velit enim nostrud et ut elit nostrud laboris mollit. Pariatur sit sint proident officia ea sunt consec
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json8880 "longText": "Ipsum ullamco commodo aliqua non consectetur culpa in. Et nulla nulla adipisicing sit sunt irure ea com
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json9012 "longText": "Nulla pariatur in cupidatat qui fugiat. Id incididunt ad aute consequat velit anim ad velit fugiat labo
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json9342 "longText": "Ullamco exercitation deserunt enim est ea. Ullamco irure ipsum dolore labore do nisi in minim occaecat
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json9430 "longText": "Culpa ipsum irure eiusmod et ad esse cillum. In ipsum qui dolor dolor. Ex deserunt incididunt duis exer
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json9539 "mediumText": "Lorem ipsum ipsum elit ad reprehenderit do culpa proident qui labore ea cillum tempor aute. Velit nis
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json9694 "longText": "Ipsum non enim aliqua culpa velit enim deserunt proident laboris sunt. Sunt esse officia qui est ut ad
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json10111 "mediumText": "Cupidatat officia duis do sunt veniam voluptate exercitation. Ea excepteur tempor magna fugiat Lorem
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json10112 "longText": "Lorem ipsum culpa voluptate labore consectetur reprehenderit anim duis fugiat anim consequat tempor off
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json10244 "longText": "Pariatur ea veniam fugiat officia incididunt aliquip occaecat commodo. Enim anim officia aliquip eu. Oc
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json10772 "longText": "Lorem ea id veniam proident exercitation culpa dolor deserunt do cillum dolor ullamco cillum id. Esse s
LOW…/labs/virtualizer/test/screenshot/shared/contacts.json10925 "mediumText": "Fugiat pariatur in Lorem ipsum ex id. Ex commodo magna enim non ullamco nulla officia velit. Et et ip
Hyper-Verbose Identifiers39 hits · 40 pts
SeverityFileLineSnippet
LOWplayground/scripts/util.js15async function getModuleSpecifiersFromFile(filePath) {
LOWplayground/scripts/util.js43async function getBareModuleSpecifiersFromFile(filePath) {
LOWplayground/scripts/util.js49export async function getBareModuleSpecifiersFromDir(dir) {
LOW…ver-plugin/src/lib/type-helpers/lit-expression-type.ts96function getRenderTypeFromDirectiveResult(
LOW…ckages/labs/ssr/src/test/integration/tests/ssr-test.ts44export function isPartialHydrationExpectation(
LOWpackages/labs/ssr/src/lib/render-value.ts1080function throwErrorForPartIndexMismatch(
LOWpackages/labs/ssr/src/lib/render-value.ts1115function renderBooleanAttributePart(
LOW…fy-html-literals/src/test/minify-html-literals.spec.ts339 function renderWithStyleAndExpressions(color, size) {
LOW…fy-html-literals/src/test/minify-html-literals.spec.ts358 function renderWithStyleAndExpressions(color, size) {
LOW…labs/virtualizer/src/support/resize-observer-errors.ts29export function setupIgnoreWindowResizeObserverLoopErrors(
LOW…labs/virtualizer/src/support/resize-observer-errors.ts48export function isResizeObserverLoopErrorMessage(message: string): boolean {
LOW…labs/virtualizer/src/support/resize-observer-errors.ts105export function ignoreWindowResizeObserverLoopErrors(
LOW…labs/virtualizer/src/support/resize-observer-errors.ts116export function preventResizeObserverLoopErrorEventDefaults() {
LOW…c/polyfills/resize-observer-polyfill/ResizeObserver.js246 (function observeExistingShadowRoots(node) {
LOW…c/polyfills/resize-observer-polyfill/ResizeObserver.js462function getHTMLElementContentRect(target) {
LOWpackages/localize-tools/src/program-analysis.ts24export function extractMessagesFromProgram(program: ts.Program): {
LOWpackages/localize-tools/src/program-analysis.ts403function replaceExpressionsAndHtmlWithPlaceholders(
LOWpackages/localize-tools/src/program-analysis.ts480function combineAdjacentPlaceholders(
LOWpackages/localize-tools/src/program-analysis.ts513function replaceHtmlWithPlaceholders(
LOWpackages/localize-tools/src/messages.ts124export function validateLocalizedPlaceholders(
LOWpackages/localize-tools/src/messages.ts195function normalizeExpressionInTemplateString(templateString: string): string {
LOWpackages/localize-tools/src/typescript.ts86export function escapeTextContentToEmbedInTemplateLiteral(
LOWpackages/localize-tools/src/typescript.ts103export function parseStringAsTemplateLiteral(
LOWpackages/localize-tools/src/config.ts26export function readConfigFileAndWriteSchema(configPath: string): Config {
LOWpackages/localize-tools/src/config.ts81function writeConfigSchemaIfMissing(config: ConfigFile, configPath: string) {
LOWpackages/localize-tools/src/formatters/xml-utils.ts11export function getOneElementByTagNameOrThrow(
LOWpackages/localize-tools/src/formatters/xml-utils.ts29export function getNonEmptyAttributeOrThrow(
LOWpackages/internal-scripts/src/add-browser-exports.ts132function optionallyAddBrowserExportCondition(exports: Exports): {
LOWpackages/tests/src/run-web-tests.ts67async function startWithNextAvailablePort() {
LOWpackages/localize/src/tests/runtime.test.ts365 function assertEventLogEqualsAndFlush(expected: LocaleStatusEventDetail[]) {
LOWpackages/lit-html/src/async-directive.ts235function notifyChildPartConnectedChanged(
LOWpackages/lit-html/src/test/directive-helpers_test.ts128 function acceptUncompiledTemplateResult(_v: UncompiledTemplateResult) {}
LOWpackages/lit-html/src/test/directive-helpers_test.ts130 function acceptTemplateOrCompiledTemplateResult(
LOWpackages/lit-html/src/test/directive-helpers_test.ts139 function acceptTemplateResultMathMl(
LOWpackages/ts-transformers/src/idiomatic-decorators.ts58export function idiomaticDecoratorsTransformer(
LOWpackages/ts-transformers/src/preserve-blank-lines.ts61export function preserveBlankLinesTransformer(): ts.TransformerFactory<ts.SourceFile> {
LOWpackages/ts-transformers/src/constructor-cleanup.ts31export function constructorCleanupTransformer(
LOW…kages/ts-transformers/src/tests/compile-ts-fragment.ts77export function createTsProgramFromFragment(
LOWpackages/ts-transformers/src/internal/util.ts60function getSuperClassTypeExpression(
AI Slop Vocabulary3 hits · 9 pts
SeverityFileLineSnippet
MEDIUMpackages/labs/analyzer/src/lib/javascript/jsdoc.ts218 // from `ts.forEachChild` is more robust than `sourceFile.getChildAt(0)`,
MEDIUM…c/polyfills/resize-observer-polyfill/ResizeObserver.js484 // be possible to utilize the getBoundingClientRect if only it's data wasn't
MEDIUMpackages/lit-html/src/lit-html.ts389// Note that the regexes are stateful. We utilize lastIndex and sync it
Cross-Language Confusion (JS/TS)1 hit · 8 pts
SeverityFileLineSnippet
HIGHpackages/lit-html/src/async-directive.ts133 * @return True if there were children to disconnect; false otherwise
Slop Phrases4 hits · 6 pts
SeverityFileLineSnippet
MEDIUMpackages/labs/ssr-dom-shim/src/index.ts97 * This is a basic implementation of an EventTarget.
LOWpackages/lit-html/scripts/check-version-tracker.js17 `Don't forget to update the version tracker string before release!`
LOW…ages/reactive-element/scripts/check-version-tracker.js19 `Don't forget to update the version tracker string before release!`
LOWpackages/lit-element/scripts/check-version-tracker.js19 `Don't forget to update the version tracker string before release!`