SPB Git

Repository Public

eslint.config.mjs 1.2 KB 25 lines javascript

1import next from "eslint-config-next/core-web-vitals";2import nextTs from "eslint-config-next/typescript";34const config = [5  { ignores: [".next/**", "node_modules/**", "src/api/schema.d.ts", "next-env.d.ts", "test-results/**", "playwright-report/**"] },6  ...next,7  ...nextTs,8  {9    rules: {10      // Product rules (see DESIGN-SYSTEM.md): no raw HTML injection, no hard-coded colours in TS/TSX.11      "react/no-danger": "error",12      "no-restricted-syntax": [13        "error",14        { selector: "Literal[value=/^#[0-9a-fA-F]{3,8}$/]", message: "Use a design token (--mcc-color-…), not a hard-coded colour." },15        { selector: "MemberExpression[object.name='localStorage'][property.name=/^(setItem|getItem)$/]", message: "Use lib/prefs (UI preferences only). Never store session material." },16      ],17      "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],18    },19  },20  { files: ["src/lib/prefs.ts"], rules: { "no-restricted-syntax": "off" } },21  // tests feed sample token values to the colour helpers22  { files: ["**/*.test.ts", "**/*.test.tsx"], rules: { "no-restricted-syntax": "off" } },23];24export default config;25
Files main
Menu

Theme