- Install eslint-plugin-boundaries@^4.2.2 to enforce three-tag boundary model - Configure element types: app, core-composition (core-api/core-cms), core, feature, tooling - Enforce unidirectional dependency graph: apps→features→core, core-composition→features - Add eslint.config.js to all 17 packages and apps (required for ESLint 9 flat config) - Fix pre-existing linting issues to achieve clean lint pass Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
import js from "@eslint/js";
|
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
import tseslint from "typescript-eslint";
|
|
import turboPlugin from "eslint-plugin-turbo";
|
|
import boundaries from "eslint-plugin-boundaries";
|
|
|
|
export default [
|
|
{ ignores: ["dist/**", "node_modules/**", ".next/**", ".turbo/**"] },
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
eslintConfigPrettier,
|
|
{
|
|
plugins: { turbo: turboPlugin },
|
|
rules: {
|
|
"turbo/no-undeclared-env-vars": "warn",
|
|
},
|
|
},
|
|
{
|
|
plugins: { boundaries },
|
|
settings: {
|
|
"boundaries/elements": [
|
|
{ type: "app", pattern: "apps/*" },
|
|
{ type: "core-composition", pattern: "packages/core-api" },
|
|
{ type: "core-composition", pattern: "packages/core-cms" },
|
|
{ type: "core", pattern: "packages/core-*" },
|
|
{ type: "tooling", pattern: "packages/eslint-config" },
|
|
{ type: "tooling", pattern: "packages/typescript-config" },
|
|
{ type: "feature", pattern: "packages/!(core-*|eslint-config|typescript-config)" },
|
|
],
|
|
},
|
|
rules: {
|
|
"boundaries/element-types": [
|
|
2,
|
|
{
|
|
default: "disallow",
|
|
rules: [
|
|
{ from: "app", allow: ["app", "core", "core-composition", "feature", "tooling"] },
|
|
{ from: "feature", allow: ["core", "tooling"] },
|
|
{ from: "core", allow: ["core", "tooling"] },
|
|
{ from: "core-composition", allow: ["core", "feature", "tooling"] },
|
|
{ from: "tooling", allow: ["tooling"] },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|