Cotton code
50 lines · 1.9 KB · TypeScriptRaw
// ESLint for apps/cotton's TypeScript.//// The apps themselves are Swift. What is left for ESLint is the small// TypeScript surface that builds AROUND them: `scripts/derive-icons.ts` and its// geometry library (the constellation-C master → the app's icon forms). The window's section registry used to be here too,// as `sections.ts`; step 5b moved it into `cotton-core`'s `design` module and// deleted the TypeScript.//// Until this file existed the package was NOT LINTED AT ALL: no config and no// `lint` script, so `turbo lint` skipped it and CI's lint step never read a// line of it, while every other TypeScript package in the repo was checked.//// The rules are the repo's shared set (`../../eslint.rules.shared.js`), whose// only consumer this is: canonical method verbs, the one-source-for-colour ban,// no `any`, and no use of a `@deprecated` export.const { defineConfig } = require("eslint/config");const tseslint = require("typescript-eslint");const sharedRules = require("../../eslint.rules.shared");module.exports = defineConfig([  {    ignores: [      "node_modules/*",      "eslint.config.js",      "native/*",      "out/*",      ".build/*",      ".ffi/*",    ],  },  {    files: ["scripts/**/*.ts", "__tests__/**/*.ts"],    plugins: { "@typescript-eslint": tseslint.plugin },    languageOptions: {      parser: tseslint.parser,      parserOptions: { projectService: true, tsconfigRootDir: __dirname },    },    rules: {      ...sharedRules.restrictedSyntaxRules,      ...sharedRules.typeSafetyRules,      ...sharedRules.deprecationRules,      "@typescript-eslint/no-require-imports": "error",    },  },  // The repo's own allowlist, spread last so its file patterns win. The entry  // that matters here is `**/__tests__/**`: a fixture may need a raw colour,  // which is the same decision every other package in the repo already made.  ...sharedRules.designSystemAllowlist,]);