npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@verajs/tsconfig

v0.1.1

Published

TypeScript base config for VeraJS components. Turns off useDefineForClassFields so a field declaration cannot silently destroy a property set before the element upgrades.

Readme

@verajs/tsconfig

TypeScript base config for VeraJS components.

npm i -D @verajs/tsconfig
{
  "extends": "@verajs/tsconfig",
  "include": ["src"]
}

Why this exists

One setting, and it is the reason this package is worth installing:

"useDefineForClassFields": false

At target ES2022 that option defaults to on, and it makes a field declaration into a runtime instruction:

class UserCard extends HTMLElement {
  user?: { name: string };
}
// with useDefineForClassFields: true — the default
class UserCard extends HTMLElement {
  user;                       // Object.defineProperty(this, 'user', { value: undefined })
}

// with useDefineForClassFields: false — what this config sets
class UserCard extends HTMLElement {
}                             // nothing emitted

That matters because a custom element is routinely given properties before it upgrades — a parent binds .user=${store} while the child's module is still loading, or code assigns to an element whose customElements.define has not run. The property lands on the un-upgraded instance; then define upgrades it synchronously, the field initializer runs, and the value is silently overwritten. Nothing throws. The component renders empty and it reads as broken reactivity.

Turning the option off means the declaration emits nothing, so there is nothing to overwrite — and you do not have to remember declare on every such field.

What it does not fix

A field written with an explicit default still assigns during construction either way:

// useDefineForClassFields: false
class UserCard extends HTMLElement {
  constructor() {
    super(...arguments);
    this.count = 0;           // still overwrites a value set before upgrade
  }
}

That spelling is at least visible in your source, unlike the declaration above. @verajs/eslint-config flags both.

The trade-off, stated plainly

useDefineForClassFields: false is project-wide, not component-only. It opts all your classes out of standard ES2022 class-field semantics and back to the assignment semantics TypeScript used before. That is well-trodden ground — it was the only behaviour for years, and Lit recommends the same setting — but it is a real divergence from what the language does, and it applies to code that has nothing to do with web components.

If you would rather stay on standard semantics, do not extend this config; write declare on custom-element fields instead and let @verajs/eslint-config enforce it.

Everything else in here

Ordinary defaults for a modern component package, all overridable:

| | | | --- | --- | | target / lib | ES2022, with DOM and DOM.Iterable | | module / moduleResolution | ESNext / Bundler | | strict, noImplicitOverride, noFallthroughCasesInSwitch | on | | isolatedModules, verbatimModuleSyntax | on — required by most bundlers | | skipLibCheck, forceConsistentCasingInFileNames, sourceMap | on |

It sets no outDir, rootDir, include or paths. Those are yours.

License

MIT