@sinova-development/repos-configs
v0.0.3
Published
Sinova Development repos configs
Readme
Sinova Development Repos Configs
Configurations for Sinova Development projects.
Installation
pnpm add -D @sinova-development/repos-configsQuick Setup
For basic setup of all tools (Prettier, ESLint, Husky, and tsconfig), run:
npx sinova-general-config-initConfigurations
Prettier Configuration
Main settings:
{
printWidth: 120,
trailingComma: 'all',
singleQuote: true,
singleAttributePerLine: true
}Required plugins:
prettier-plugin-tailwindcss- Automatic Tailwind CSS class sorting
Install Prettier only:
npx sinova-prettier-initESLint Configuration
Flat configs for frontend (React, Next.js) and backend (Node/TS, NestJS) projects.
Includes:
- Shared core rules (TypeScript strict + stylistic, imports, Unicorn, JSDoc, erasable-syntax-only, etc.)
- Frontend preset: generic browser/JSX (core + browser globals, no React/Next)
- React preset: extends Frontend + React, React Hooks, Playwright, i18next, check-file, JSX a11y. Optional Storybook plugin and rules via
storybook: true(default: false) - Next.js preset: extends React +
@next/eslint-plugin-next, App Router conventions. Optional Storybook viastorybook: true(default: false). (eslint-plugin-tailwindcss disabled: TODO re-enable when it supports Tailwind CSS v4) - Backend preset: generic Node/TS backend (core only, no framework plugins). Optional Prisma ORM rules via
orm: 'prisma' - NestJS preset: extends Backend +
@darraghor/eslint-plugin-nestjs-typed. Optional Prisma ORM rules viaorm: 'prisma'
Install ESLint only:
npx sinova-eslint-initWhen run interactively, you choose frontend/backend, then preset (Next.js, React, Frontend, NestJS, Backend). For React or Next.js you can optionally include Storybook rules (or use --storybook with --react/--nextjs). For backend or NestJS you can optionally choose Prisma to add @v2nic/eslint-plugin-prisma rules (schema + TypeScript).
Install ESLint only (choose preset):
npx sinova-eslint-init --nextjsnpx sinova-eslint-init --nextjs --storybooknpx sinova-eslint-init --reactnpx sinova-eslint-init --react --storybooknpx sinova-eslint-init --frontendnpx sinova-eslint-init --backendnpx sinova-eslint-init --nestjsUse config directly (Next.js):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/nextjs';
export default [...createConfig(process.cwd())];Use config directly (Next.js with Storybook):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/nextjs';
export default [...createConfig(process.cwd(), { storybook: true })];Use config directly (React):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/react';
export default [...createConfig(process.cwd())];Use config directly (React with Storybook):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/react';
export default [...createConfig(process.cwd(), { storybook: true })];Use config directly (frontend):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/frontend';
export default [...createConfig(process.cwd())];Use config directly (backend):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/backend';
export default [...createConfig(process.cwd())];Use config directly (backend with Prisma):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/backend';
export default [...createConfig(process.cwd(), { orm: 'prisma' })];Use config directly (NestJS):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/nestjs';
export default [...createConfig(process.cwd())];Use config directly (NestJS with Prisma):
// eslint.config.mjs
import { createConfig } from '@sinova-development/repos-configs/eslint-config/nestjs';
export default [...createConfig(process.cwd(), { orm: 'prisma' })];Husky Configuration
Pre-commit hooks:
pnpm run pre-commitInstall Husky only:
npx sinova-husky-initLint-staged Configuration
Default settings:
{
"lint-staged": {
"**/*": "prettier --write --ignore-unknown",
"**/*.{js,jsx,ts,tsx,mjs,cjs}": "eslint"
}
}When using
sinova-eslint-init, the ESLint lint-staged rule is added automatically.
TypeScript Configuration (tsconfig)
Shared tsconfig presets for backend and frontend projects, intended to be used with extends.
Available presets:
backend- Node.js/NestJS defaults (module: NodeNext,moduleResolution: NodeNext,types: ["node"])frontend- basic frontend defaults (moduleResolution: Bundler, DOM libs)react- extendsfrontendand enables React JSX transform (jsx: react-jsx)next- extendsreactand adds Next.js TS plugin ("plugins": [{ "name": "next" }])
Install tsconfig only:
npx sinova-tsconfig-initnpx sinova-tsconfig-init --backendnpx sinova-tsconfig-init --frontendnpx sinova-tsconfig-init --reactnpx sinova-tsconfig-init --nextThis setup installs typescript, writes tsconfig.json with an extends, and adds:
type-check→tsc --noEmittype-check:watch→tsc --noEmit --watch
Use backend preset directly (tsconfig.json):
{
"extends": "@sinova-development/repos-configs/tsconfig/backend/index.json"
}Use frontend preset directly (tsconfig.json):
{
"extends": "@sinova-development/repos-configs/tsconfig/frontend/index.json"
}Use React preset directly (tsconfig.json):
{
"extends": "@sinova-development/repos-configs/tsconfig/frontend/react.json"
}Use Next.js config via generator (--next) output (tsconfig.json):
{
"extends": "@sinova-development/repos-configs/tsconfig/frontend/next.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", ".next"]
}Scripts
When using sinova-eslint-init, the following are added or updated in package.json:
- Lint scripts:
lintandlint:fix(e.g.eslint . --max-warnings=0 --cacheand same with--fix) - Lint-staged:
**/*.{js,jsx,ts,tsx,mjs,cjs}→eslint - Type-check scripts:
type-checkandtype-check:watch(fromsinova-tsconfig-init)
Other scripts (e.g. format, format:check, pre-commit) come from the general setup or your project.
