@dino-labs/eslint-config
v0.2.0
Published
Shared ESLint config for Dino Design: layout goes through Box, and every disable says why.
Maintainers
Readme
@dino-labs/eslint-config
The shared ESLint config for Dino Design, an open-source agentic design system. It keeps JSX on-system: layout goes through Box, and every disable comment says why. Its partner, @dino-labs/stylelint-config, does the same for stylesheets.
Early release. Versions
0.xmay tighten rules between minor versions. The release notes list each change.
Install
npm install --save-dev @dino-labs/eslint-config eslintThe config sets rules, not a parser. A TypeScript app already has one from typescript-eslint:
// eslint.config.js
import brand from '@dino-labs/eslint-config';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
export default defineConfig(tseslint.configs.recommended, brand);What it checks
- Layout through
Box. A raw<div>,<section>,<nav>or any other elementBoxrenders is an error: use<Box as="nav">, whose props take Dino Design's tokens. Text, links, buttons and media have their own components and aren't affected. Member expressions such as<motion.div>pass. - Disable comments explain themselves. Each needs a reason after
--, and one that disables nothing is an error.
return (
// eslint-disable-next-line no-restricted-syntax -- the map library measures this element itself
<div ref={mapRef} />
);Options
// eslint.config.js
import { brand } from '@dino-labs/eslint-config';
export default [...brand({ layoutElements: 'warn', deprecations: true })];layoutElements:'error'(the default) or'warn', for an app still moving onto Dino Design.deprecations: adds@typescript-eslint/no-deprecated, which flags deprecated Dino Design components and props. It needs type information, so register typescript-eslint's typed linting first, for example withtseslint.configs.recommendedTypeChecked. ItsstrictTypeCheckedpreset already includes the rule.files: the files the layout rule applies to. Defaults to every.jsxand.tsxfile.
The layout rule is ESLint's no-restricted-syntax. If your config sets that rule too, the later setting replaces the earlier one, so add Dino Design's entries to yours:
import { layoutElementRestrictions } from '@dino-labs/eslint-config';
const rules = {
'no-restricted-syntax': ['error', ...layoutElementRestrictions, yourEntry],
};Escapes
Dino Design has three levels of escape, so deviation stays visible rather than impossible:
- Sanctioned:
Box's narrowstyleprop, for layout tokens can't express, such asgridTemplateAreasoraspectRatio. No comment needed. - Logged: a disable comment with a reason, like the one above. A margin other than
0always needs one. - Signal: three disables for the same need suggest something Dino Design is missing. Open a gap on the Dino Design repository.
License
MIT © 2026 Ibrahim Moazzam. See LICENSE.
