Install the package as a development dependency. Then initialize the project and run the scanner.
npm i -D palantree
npx palantree init
npx palantree scan
The npm and pnpm commands apply after the package is published. To test a local package, install ./palantree-0.3.4.tgz.
init command
init confirms that the project uses shadcn/ui, detects source roots and token files, and creates palantree.config.json. It does not add scripts to package.json.
Token JSON file or directory. Directories are scanned recursively.
src
One path or an array of paths. Overlapping roots are deduplicated.
exclude
Exact file or directory paths. Globs are not supported.
format
text for the terminal or json for tools and CI.
failOnWarnings
Treat warnings as a failed scan when true.
Defaults and compatibility
Without a configuration file, scan uses the shadcn preset and looks for tokens.json and src in the current directory. It does not search parent directories. An older design-lint.config.json file must be passed with --config.
Tokens and scan coverage
Tokens.Default contains the semantic tokens suggested in code. Primitives.Light and Primitives.Dark are used to check :root and .dark values.
Tailwind and shadcn classes in className or class.
CSS declarations, JSX styles, and CSS-in-JS objects.
cn, clsx, classnames, and cva compositions.
Strings, complete template fragments, ternaries, and logical expressions.
Color rules
text-white, bg-black, and other direct palette colors are violations. Use official shadcn semantic names or custom names in Tokens.Default. Variants such as hover: and md: are preserved.
Analysis limits
Palantree does not execute JavaScript, resolve imports or variables, interpret interpolated classes such as bg-${color}, or inspect CSS inside template literals.
Values inside var(...) are ignored, while hardcoded values beside them are still analyzed. Relative units such as rem are not converted to px without runtime context.
Hidden directories, node_modules, dist, build, coverage, and out are ignored. Recursive discovery does not follow symbolic links.
About the project
A developer tool and a thesis project.
palantree started as my Computer Science undergraduate thesis, combining Design Systems, UI/UX, and development to help keep code aligned with the decisions defined in design.