Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

設計上あかんimport を ESLint で怒る #281

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 28 additions & 0 deletions desktop/packages/main/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -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)/**/*",
Comment on lines +9 to +10
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ygkn
パスが間違ってる(?)のか、エラーがでない
なんでかわかる?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

分けて書いたらどう

message:
"Model 層は Controller 層および View 層に依存してはいけません",
},
{
from: "./src/view/**/*",
target: "./src/model/**/*",
message: "View 層は Model 層に依存してはいけません",
},
{
from: "./src/controller/**/*",
target: "./src/view/**/*",
message: "Controller 層は View 層に依存してはいけません",
},
],
},
],
},
};
3 changes: 2 additions & 1 deletion desktop/packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down