Standardized TypeScript, ESLint, and Prettier configuration for Charlie Lab's TypeScript projects.
Why does this exist?
- Consistent and familiar configuration across Charlie Labs projects
- Reduces configuration boilerplate in each project
- Reduces time spent keeping configuration updated and in sync
Install @charlie-labs/config as a dev dependency.
Add the following line to your package.json:
"prettier": "@charlie-labs/config/prettier",Create a eslint.config.js file in the root of the project:
import { config } from '@charlie-labs/config/eslint';
/** @type {import("eslint").Linter.Config[]} */
export default [...config];Create a tsconfig.json file in the root that extends @charlie-labs/config/tsconfig-node or @charlie-labs/config/tsconfig-react. You will still need to specify includes and any compilerOptions you want to add or override.
This is just a convenient export of @total-typescript/ts-reset.
This repo is set up to auto-publish to npm on merge to the default branch (currently master) via GitHub Actions. You only need to bump the version and merge a PR.
-
Create a branch and bump the version in
package.jsonwithout creating a git tag:# pick one: patch | minor | major | or an explicit version npm version patch --no-git-tag-version # or: npm version 0.0.13 --no-git-tag-version
-
Commit the change and open a PR. Keep the PR limited to the version bump and any release notes you want in the description.
-
When the PR is merged to the default branch, the workflow at
.github/workflows/release.ymlwill:- run typecheck and ESLint
- publish to npm if the version is new (requires
NPM_TOKEN) - create a GitHub Release with generated notes
Notes:
- Don’t push git tags manually; the workflow creates the tag during the GitHub Release step.
- If no new version is present (i.e.,
package.jsondidn’t change), the publish step is skipped and no release is created. - The publish step skips npm lifecycle scripts; typecheck and lint run explicitly in the workflow.
To publish to npm from GitHub Actions, add an npm access token as a secret named NPM_TOKEN:
- Create an npm access token with at least “Publish” permission in your npm account settings.
- In this repository’s Settings → Secrets and variables → Actions, add a new Repository secret named
NPM_TOKENwith that token’s value. An Organization secret works too. - Nothing else is required—our release workflow already:
- requests
id-token: writefor npm provenance support, and - uses
actions/setup-node@v4to provide a recent npm version during publish.
- requests
If your org enforces “Require provenance” on npm, the existing provenance: true input on the publish step satisfies it.
{ "extends": "@charlie-labs/config/tsconfig-node", "include": ["src"], "exclude": ["**/node_modules", "**/.*/"], "compilerOptions": { // Add or override compiler options here }, }