@kirill.konshin/lint 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rules/webstorm.md +16 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirill.konshin/lint",
3
3
  "description": "ESLint + Prettier + lint-staged config and AI agent rules/skills for monorepos",
4
- "version": "0.4.7",
4
+ "version": "0.4.8",
5
5
  "type": "module",
6
6
  "skipGenerate": true,
7
7
  "bin": {
package/rules/webstorm.md CHANGED
@@ -197,3 +197,19 @@ Ban build directories from search using examples:
197
197
  </component>
198
198
  </project>
199
199
  ```
200
+
201
+ # Git Worktrees
202
+
203
+ `.idea/%projectName%.iml`, `.idea/modules.xml` and `.idea/.name` are usually tracked. Every git worktree therefore checks out a module with the same name as the main checkout's, and WebStorm refuses to attach it: `Cannot attach project: Module name '%projectName%' already exists`.
204
+
205
+ - When creating a worktree, ALWAYS give it a distinct module and project name derived from the branch, e.g. `Packing Travel App` for `travel-app`:
206
+ 1. Copy `.idea/%projectName%.iml` to `.idea/%projectName% %Branch Title%.iml`. The module name is the file name.
207
+ 2. Point `.idea/modules.xml` at the copy.
208
+ 3. Write the same name into `.idea/.name`.
209
+ - Keep the rename local, and NEVER commit it or merge it back:
210
+ - Run `git update-index --skip-worktree .idea/modules.xml .idea/.name`.
211
+ - Ignore the copy in the shared `.git/info/exclude` with the pattern `.idea/%projectName% *.iml`.
212
+ - Before a rebase, merge or checkout that updates those files:
213
+ 1. Run `git update-index --no-skip-worktree .idea/modules.xml .idea/.name`.
214
+ 2. Restore the files with `git checkout -- .idea/modules.xml .idea/.name`.
215
+ 3. Redo the rename afterwards.