48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
|
|
// ESLint flat config — enforces shared/engine dependency boundary.
|
||
|
|
|
||
|
|
import js from "@eslint/js";
|
||
|
|
import tseslint from "typescript-eslint";
|
||
|
|
import boundaries from "eslint-plugin-boundaries";
|
||
|
|
import importPlugin from "eslint-plugin-import";
|
||
|
|
import globals from "globals";
|
||
|
|
|
||
|
|
export default tseslint.config(
|
||
|
|
{
|
||
|
|
ignores: ["dist/", "node_modules/", "coverage/", "**/*.d.ts"],
|
||
|
|
},
|
||
|
|
js.configs.recommended,
|
||
|
|
...tseslint.configs.recommended,
|
||
|
|
{
|
||
|
|
files: ["src/**/*.{ts,tsx}"],
|
||
|
|
languageOptions: {
|
||
|
|
ecmaVersion: 2022,
|
||
|
|
sourceType: "module",
|
||
|
|
globals: { ...globals.node },
|
||
|
|
},
|
||
|
|
plugins: {
|
||
|
|
boundaries,
|
||
|
|
import: importPlugin,
|
||
|
|
},
|
||
|
|
settings: {
|
||
|
|
"import/resolver": {
|
||
|
|
typescript: { project: "./tsconfig.json" },
|
||
|
|
},
|
||
|
|
"boundaries/elements": [
|
||
|
|
{ type: "shared", pattern: "src/shared/**" },
|
||
|
|
{ type: "engine", pattern: "src/engine/**" },
|
||
|
|
],
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
"boundaries/element-types": [
|
||
|
|
2,
|
||
|
|
{
|
||
|
|
default: "disallow",
|
||
|
|
rules: [
|
||
|
|
{ from: "shared", allow: [] },
|
||
|
|
{ from: "engine", allow: ["shared"] },
|
||
|
|
],
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
);
|