@digital-natives/dinalint
v1.0.10
Published
Universal in-house linting and formatting presets for React + TypeScript projects.
Readme
dinalint
In-house linting and formatting standards for React + TypeScript projects.
dinalint provides shared ESLint and Prettier configuration to keep frontend projects aligned with one setup.
What dinalint includes
- ESLint flat config for React + TypeScript.
- Import ordering and unused import rules.
- React hooks rules.
- Recommended accessibility rules.
- Tailwind class ordering rule.
- Shared Prettier config.
- CLI wrapper commands for lint, lint:fix, format, format:check, typecheck, check, and check:fix.
- Fixture-based tests and CI checks for this package.
Before you start
Existing lint setup warning
If your project already has ESLint/Prettier config, remove or merge it before enabling dinalint.
Running multiple overlapping configs can create conflicting rules.
Supported toolchain
- ESLint:
9.x(currently required) - Node:
>=20
If your project has eslint@10, @digital-natives/dinalint/eslint will throw a clear compatibility error.
Use eslint@^9 until dinalint is upgraded for ESLint 10.
Flow 1: Install from published npm package
Use this flow when @digital-natives/dinalint is published and available in npm.
1) Install @digital-natives/dinalint
npm install -D @digital-natives/dinalintpnpm add -D @digital-natives/dinalintyarn add -D @digital-natives/dinalintbun add -d @digital-natives/dinalint2) Create ESLint config
For default profile (@digital-natives/dinalint/eslint):
Create a file named eslint.config.mjs in your project root.
import dinalint from "@digital-natives/dinalint/eslint";
export default dinalint;For strict profile (@digital-natives/dinalint/eslint/strict), which adds type-aware linting and stricter rule severities:
import dinalintStrict from "@digital-natives/dinalint/eslint/strict";
export default dinalintStrict;Use strict profile when your project has a valid tsconfig.json and you want CI-grade enforcement.
3) Create Prettier config
Create .prettierrc.mjs:
import prettierConfig from "@digital-natives/dinalint/prettier";
export default prettierConfig;4) Add scripts in package.json
Use dinalint wrapper commands so scripts are package-manager-agnostic and robust:
{
"scripts": {
"lint": "dinalint lint .",
"lint:fix": "dinalint lint:fix .",
"format": "dinalint format .",
"format:check": "dinalint format:check .",
"typecheck": "dinalint typecheck",
"check": "dinalint check .",
"check:fix": "dinalint check:fix ."
}
}For PR gate scripts (strictest recommended quality pipeline), add:
{
"scripts": {
"lint:strict": "eslint \"src/**/*.{ts,tsx}\" --max-warnings=0",
"typecheck": "tsc --noEmit",
"imports:check": "ts-unused-exports ./tsconfig.json",
"check:strict": "npm run format:check && npm run lint:strict && npm run imports:check && npm run typecheck"
}
}5) Initialize editor defaults
Run in the consumer project:
npx dinalint initThis creates a .editorconfig in the current project.
If the file already exists and you want to replace it:
npx dinalint init --force6) Verify setup
Run:
npm run checkIf your project is not npm-based, run the equivalent for your package manager:
pnpm run checkyarn run checkbun run checkFlow 2: Local install using npm pack (without publishing changes)
Use this flow when testing @digital-natives/dinalint from local source without publishing to npm.
1) Pack in dinalint repository
In the dinalint repo:
Run the prepublish release step (checks + patch version bump):
npm run prepublishThis runs:
npm run checknpm version patch --no-git-tag-version
Then pack:
npm packThis creates a tarball such as digital-natives-dinalint-1.0.1.tgz.
2) Install tarball in consumer project
In the consumer project:
npm install -D /absolute/path/to/dinalint/digital-natives-dinalint-1.0.1.tgzpnpm add -D /absolute/path/to/dinalint/digital-natives-dinalint-1.0.1.tgzyarn add -D /absolute/path/to/dinalint/digital-natives-dinalint-1.0.1.tgzbun add -d /absolute/path/to/dinalint/digital-natives-dinalint-1.0.1.tgz3) Apply the same setup steps as Flow 1
After tarball install, repeat Flow 1 steps:
- Create
eslint.config.js. - Create
.prettierrc.mjs. - Add scripts.
- Run
dinalint init. - Run
check.
4) Uninstall later
npm uninstall @digital-natives/dinalintpnpm remove @digital-natives/dinalintyarn remove @digital-natives/dinalintbun remove @digital-natives/dinalintTurborepo guidance
In Turborepo, each frontend package should define:
- Local
eslint.config.jsimporting@digital-natives/dinalint/eslint. - Local Prettier config importing
@digital-natives/dinalint/prettier.
Root-level scripts can use turbo filters, for example:
{
"scripts": {
"lint": "turbo run lint",
"format:check": "turbo run format:check"
}
}Manual release checklist (v1)
- Run prepublish (checks + patch bump):
npm run prepublish
- (Recommended) remove local tarballs after local testing:
rm -f *.tgz
- (Optional) verify package contents:
npm pack --dry-run
- Publish:
npm publish
- Add short release notes in the changelog section or release description.
