@alphinex/eslint-config
v1.0.1
Published
Readme
@alphinex/eslint-config
Shared ESLint flat configs for apps and packages built on the Alphinex platform.
Usage
// eslint.config.js
import react from "@alphinex/eslint-config/react";
export default [...react];@alphinex/eslint-config/base— TypeScript + import hygiene rules, no framework assumptions.@alphinex/eslint-config/react—baseplus React/React Hooks rules and the platform's design- token discipline (no raw hex/rgb color literals — usevar(--aui-*)or the Tailwind preset utilities) and RTL logical-property discipline.@alphinex/eslint-config/a11y— accessibility rules (eslint-plugin-jsx-a11y).
Allowing raw color literals in a primitive color-ramp file
The one sanctioned place for raw hex/rgb literals is a primitive color-ramp definition (a
ColorRamp-shaped token file, per @alphinex/theme's docs) — everywhere else must reference a
semantic token. no-restricted-syntax can only be toggled per rule, not per selector, so scope the
override to that single file by path in your own eslint.config.js (this is exactly how
@alphinex/theme itself allows raw literals in src/tokens/primitives.ts):
// eslint.config.js
import react from "@alphinex/eslint-config/react";
export default [
...react,
{
// Your primitive color-ramp file only — turning the rule off here also lifts the
// RTL logical-property rule for this file, which is fine since a token-definition
// file has no JSX/classNames to enforce that against.
files: ["src/theme/colorRamp.ts"],
rules: {
"no-restricted-syntax": "off",
},
},
];