@lark-apaas/coding-presets
v1.0.1
Published
ESLint, Stylelint, and Tailwind presets for OpenClaw projects
Readme
@lark-apaas/coding-presets
Shared ESLint, Stylelint, Tailwind, and TypeScript presets for OpenClaw coding templates.
Install
pnpm add -D @lark-apaas/coding-presetsESLint
Provides client and server presets with eslint/recommended + typescript-eslint/recommended base configs.
// eslint.config.js
import { eslintPresets } from '@lark-apaas/coding-presets'
export default [
// Client: React + TypeScript
...eslintPresets.client.map(config => config.ignores ? config : {
...config,
files: ['client/**/*.{ts,tsx}'],
}),
// Server: Node.js + TypeScript
...eslintPresets.server.map(config => config.ignores ? config : {
...config,
files: ['server/**/*.ts', 'shared/**/*.ts'],
}),
]Client rules include
- React Hooks recommended rules (exhaustive-deps off)
- TypeScript loose mode (no-unused-vars, no-explicit-any, no-empty-object-type off)
- Restricted syntax:
location.hrefassignment, relative<a>href, Tailwind 4 hsl/rgb space check - Restricted imports:
next/linkprohibited
Server rules include
- Node.js globals (including
NodeJS) - TypeScript loose mode (matching client)
- No NestJS-specific rules (unlike fullstack-presets)
TypeScript
Provides tsconfig.app.json and tsconfig.node.json presets aligned with Vite 8 standards.
// tsconfig.app.json — Client (React)
{
"extends": "@lark-apaas/coding-presets/lib/tsconfig/tsconfig.app.json",
"compilerOptions": {
"types": ["vite/client"],
"paths": { "@/*": ["./client/src/*"] }
},
"include": ["client/src"]
}// tsconfig.node.json — Tooling (vite.config.ts, etc.)
{
"extends": "@lark-apaas/coding-presets/lib/tsconfig/tsconfig.node.json",
"include": ["vite.config.ts"]
}// tsconfig.server.json — Server build (with output)
{
"extends": "@lark-apaas/coding-presets/lib/tsconfig/tsconfig.node.json",
"compilerOptions": {
"outDir": "./dist/server",
"noEmit": false
},
"include": ["server", "shared"]
}TSConfig presets settings
| Option | app | node | |--------|-----|------| | target | ES2023 | ES2023 | | module | ESNext | ESNext | | moduleResolution | bundler | bundler | | strict | true | true | | jsx | react-jsx | — | | verbatimModuleSyntax | true | true | | noEmit | true | true |
Stylelint
import { stylelintPresets } from '@lark-apaas/coding-presets'
// Use stylelintPresets as your stylelint configIncludes custom HSL validation rule and duplicate custom properties check.
Tailwind
import { createTailwindPreset } from '@lark-apaas/coding-presets'
const preset = createTailwindPreset({ content: ['./src/**/*.tsx'] })Includes tailwindcss-animate plugin with class-based dark mode.
License
MIT
