feat(eslint-config): add boundaries plugin enforcing app→feature→core graph
- 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>
This commit is contained in:
@@ -2,9 +2,10 @@ 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/**"] },
|
||||
{ ignores: ["dist/**", "node_modules/**", ".next/**", ".turbo/**"] },
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
eslintConfigPrettier,
|
||||
@@ -14,4 +15,33 @@ export default [
|
||||
"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"] },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
3
packages/eslint-config/eslint.config.js
Normal file
3
packages/eslint-config/eslint.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import baseConfig from "./base.js";
|
||||
|
||||
export default baseConfig;
|
||||
@@ -14,6 +14,7 @@
|
||||
"@typescript-eslint/parser": "^8.25.0",
|
||||
"eslint": "^9.20.0",
|
||||
"eslint-config-prettier": "^10.1.0",
|
||||
"eslint-plugin-boundaries": "^4.2.2",
|
||||
"eslint-plugin-turbo": "^2.4.0",
|
||||
"typescript-eslint": "^8.25.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user