diff --git a/desktop/package.json b/desktop/package.json index e4e1749f..981e0ebc 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -10,7 +10,7 @@ "dev": "node --experimental-loader ts-node/esm scripts/watch.mts", "build": "npm run build -ws --if-present", "codegen": "npm run codegen -ws --if-present --", - "lint": "eslint . --ext .ts,.tsx,mts", + "lint": "eslint './**/*.{ts,tsx,mts}'", "format": "npm run check:format --write", "check:format": "prettier . --check", "check:type": "npx --ws tsc", diff --git a/desktop/packages/main/.eslintrc.js b/desktop/packages/main/.eslintrc.js new file mode 100644 index 00000000..bba169b5 --- /dev/null +++ b/desktop/packages/main/.eslintrc.js @@ -0,0 +1,28 @@ +module.exports = { + extends: ["@smartpointer-desktop/eslintrc/index.js"], + rules: { + "import/no-restricted-paths": [ + "error", + { + zones: [ + { + from: "./src/model/**/*", + target: "./src/(controller|view)/**/*", + message: + "Model 層は Controller 層および View 層に依存してはいけません", + }, + { + from: "./src/view/**/*", + target: "./src/model/**/*", + message: "View 層は Model 層に依存してはいけません", + }, + { + from: "./src/controller/**/*", + target: "./src/view/**/*", + message: "Controller 層は View 層に依存してはいけません", + }, + ], + }, + ], + }, +}; diff --git a/desktop/packages/main/package.json b/desktop/packages/main/package.json index 5ba9d813..0494be69 100644 --- a/desktop/packages/main/package.json +++ b/desktop/packages/main/package.json @@ -4,7 +4,8 @@ "description": "", "scripts": { "build": "vite build", - "codegen": "gql-gen --config ../../graphql.config.ts" + "codegen": "gql-gen --config ../../graphql.config.ts", + "lint": "eslint ." }, "keywords": [], "author": "",