Comments (5)
如果是前后端都放在一起的项目(monorepo),合理结构应该是
├── .git/
├── frontend/
│ └── package.json -> 不是这里
├── backend/
│ └── package.json
├── package.json -> 安装在这里
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
└── tsconfig.json
安装在子项目的package.json的话,意义不是很大,因为同一个仓库的代码风格应该一致。
如果非要这样做,可以在根目录添加一个lint-staged.config.js
module.exports = {
"frontend/**/*": ["npx git-validator -u"]
}
这样你提交代码时,就只会检查/frontend文件夹,不会检查其他文件夹
from git-validator.
@weicong 不支持。这种场景第一次见,为什么项目会在.git
的子目录下?
from git-validator.
有一些项目,可能只需要一个程序员维护,所以前后端在一个 git 库里,结构大概是这个样子
https://scottsauber.com/2021/06/01/using-husky-git-hooks-and-lint-staged-with-nested-folders/
https://www.interglobalmedianetwork.com/blog/adding-husky-to-a-subfolder-of-a-git-root-repository
from git-validator.
@zanminkian 好,多谢
from git-validator.
先关闭了哈,有任何问题再重新提issue或者再打开当前issue
from git-validator.
Related Issues (20)
- fix(git-validator): ignore `as const` when analyzing HOT 1
- feat(git-validator): count for `rename import` when analyzing
- refactor(eslint-config): remove offed rules HOT 1
- doc(git-validator): encourage user to use builtin eslint-config
- feat(git-validator): count call expressions which accept or return `any` type HOT 1
- refactor: remove globstar once node22 achieve lts
- feat(git-validator): count the usages of `import.meta` and `node:` module. HOT 1
- feat(eslint-plugin-packagejson): `dependencies` and `devDependencies` should be locked HOT 1
- feat(git-validator): count for import expression
- feat(eslint-plugin): `no-for-in`
- feat(eslint-config): integrate publint
- feat(git-validator): count for the expression of `top-level-await`
- feat(git-validator)!: `git-validator -u` should do format -> lint -> format
- feat(git-validator): detect whether there are circular imports existing in project
- feat(eslint-plugin): do not allow to import from git ignored path HOT 1
- fix(eslint-config): globally ignores should respect the `.gitignore` files that is in non-root dir HOT 1
- feat(eslint-plugin): `consistent-object-array-spread`
- feat(eslint-plugin): no es6 setter and getter
- feat(git-validator): show format and lint progress
- type safe for `Reflect.xxx`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-validator.