All skills
onmax avatar

/ts-library

@50538df

Use when authoring TypeScript libraries or npm packages - covers project setup, package.json exports, build tooling (tsdown/unbuild), API design patterns, type inference tricks, testing, and publishing to npm. Use when bundling, configuring dual CJS/ESM output, or setting up release workflows.

  • 20 files
  • 73.4 KB
  • MIT
  • Updated 7 months ago
  • GitHub

Use this Skill: https://skilld.dev/gh/onmax/claude-config/ts-library

This session only. Nothing lands on disk.

referenceseslint-config.md

≈809 tokens on demand. Your agent reads this file only when SKILL.md points to it.

@antfu/eslint-config

Flat ESLint config that handles both linting and formatting - replaces Prettier.

Setup

pnpm add -D eslint @antfu/eslint-config
// eslint.config.mjs
import antfu from '@antfu/eslint-config'

export default antfu()
{ "scripts": { "lint": "eslint ." } }

Configuration Options

import antfu from '@antfu/eslint-config'

export default antfu({
  type: 'lib',        // 'lib' for libraries, 'app' for applications
  ignores: ['**/fixtures', '**/dist'],
  stylistic: { indent: 2, quotes: 'single' },
  typescript: true,   // Auto-detected
  vue: true,          // Auto-detected
})

Framework Support

Framework Option Required Package
Vue vue: true (auto-detected)
React react: true @eslint-react/eslint-plugin eslint-plugin-react-hooks
Next.js nextjs: true @next/eslint-plugin-next
Svelte svelte: true eslint-plugin-svelte
Astro astro: true eslint-plugin-astro
Solid solid: true eslint-plugin-solid
UnoCSS unocss: true @unocss/eslint-plugin

Formatters (CSS, HTML, Markdown)

For files ESLint doesn't handle natively:

export default antfu({
  formatters: {
    css: true,      // Prettier for CSS/LESS/SCSS
    html: true,     // Prettier for HTML
    markdown: 'prettier' // or 'dprint'
  }
})
// Requires: pnpm add -D eslint-plugin-format

Rule Overrides

Global

export default antfu(
  { /* config options */ },
  { rules: { 'style/semi': ['error', 'never'] } }
)

Per-integration

export default antfu({
  vue: { overrides: { 'vue/operator-linebreak': ['error', 'before'] } },
  typescript: { overrides: { 'ts/consistent-type-definitions': ['error', 'interface'] } },
})

Plugin Prefix Renaming

New Prefix Original
ts/* @typescript-eslint/*
style/* @stylistic/*
import/* import-lite/*
node/* n/*
test/* vitest/*
// eslint-disable-next-line ts/consistent-type-definitions

Type-Aware Rules

export default antfu({
  typescript: { tsconfigPath: 'tsconfig.json' },
})

VS Code Settings

{
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit", "source.organizeImports": "never" },
  "eslint.rules.customizations": [
    { "rule": "style/*", "severity": "off", "fixable": true },
    { "rule": "format/*", "severity": "off", "fixable": true },
    { "rule": "*-indent", "severity": "off", "fixable": true },
    { "rule": "*-spacing", "severity": "off", "fixable": true }
  ],
  "eslint.validate": ["javascript", "typescript", "vue", "html", "markdown", "json", "yaml"]
}

Source: SKILL.md on GitHub

No third-party reports yet.

Signed by skilld at 50538df. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 19 hours ago.

Activeupdated 7 months ago

README badge

README badge for onmax/claude-config/ts-library