@kirill.konshin/lint 0.3.5 → 0.3.6

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.
package/README.md CHANGED
@@ -374,6 +374,7 @@ paths:
374
374
  - [ ] Yarn 1 (classic) — root detection now delegates to `@manypkg/find-root` (workspace-manifest walk); unverified since the switch
375
375
  - [ ] pnpm — root detection via `@manypkg/find-root` (`pnpm-workspace.yaml`); `public-hoist-pattern` guidance unverified in a real pnpm workspace
376
376
  - [ ] npm — env fast-path (`npm_config_local_prefix`) verified previously; `@manypkg/find-root` fallback unverified since the switch
377
+ - [ ] Explore Yarn [constraints](https://yarnpkg.com/features/constraints) & add a helper to Lint package so Yarn enforces version consistency w/o `overrides`, but be careful not to screw up NPM dependencies
377
378
  - ESLint 9
378
379
  - [x] https://github.com/microsoft/rushstack/issues/4635 Failed to patch ESLint because the calling module was not recognized
379
380
  - [x] https://github.com/microsoft/rushstack/issues/4965 Failed to patch ESLint because the calling module was not recognized
package/lintPrepare.js CHANGED
@@ -38,8 +38,7 @@ This file is auto-generated by @kirill.konshin/lint. Do not edit directly - cust
38
38
 
39
39
  ---`;
40
40
 
41
- const FOOTER = `
42
- ---
41
+ const FOOTER = `---
43
42
 
44
43
  # Custom Rules
45
44
 
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.3.5",
4
+ "version": "0.3.6",
5
5
  "type": "module",
6
6
  "skipGenerate": true,
7
7
  "bin": {
package/rules/github.md CHANGED
@@ -57,13 +57,6 @@ jobs:
57
57
  id: yarn-cache-dir-path
58
58
  run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
59
59
 
60
- - name: Install dependencies
61
- run: yarn install --immutable
62
-
63
- # Add this if Yarn 2+ is used and package is NOT private
64
- - name: Prepare
65
- run: yarn prepare
66
-
67
60
  - uses: actions/cache@v6
68
61
  id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
69
62
  with:
@@ -72,13 +65,28 @@ jobs:
72
65
  restore-keys: |
73
66
  ${{ runner.os }}-yarn-
74
67
 
75
- #TODO https://turbo.build/repo/docs/guides/ci-vendors/github-actions#remote-caching
68
+ #TODO https://turbo.build/repo/docs/guides/ci-vendors/github-actions#remote-caching
76
69
  #TODO https://turborepo.dev/docs/guides/ci-vendors/github-actions#remote-caching-with-github-actionscache
77
- - name: Cache turbo build setup
70
+ - name: Cache Turbo
78
71
  uses: actions/cache@v6
79
72
  with:
80
73
  path: .turbo
81
74
  key: ${{ runner.os }}-turbo-${{ github.sha }}
82
75
  restore-keys: |
83
76
  ${{ runner.os }}-turbo-
77
+
78
+ - name: Cache NX
79
+ uses: actions/cache@v6
80
+ with:
81
+ path: .nx
82
+ key: ${{ runner.os }}-turbo-${{ github.sha }}
83
+ restore-keys: |
84
+ ${{ runner.os }}-turbo-
85
+
86
+ - name: Install dependencies
87
+ run: yarn install --immutable
88
+
89
+ # Add this if Yarn 2+ is used and package is NOT private, otherwise postinstall should be configured, and this block skipped
90
+ - name: Prepare
91
+ run: yarn prepare
84
92
  ```
package/rules/gitlab.md CHANGED
@@ -11,25 +11,67 @@ paths:
11
11
  # Example
12
12
 
13
13
  ```yml
14
- build:
15
- image: node:24
16
- env:
17
- YARN_ENABLE_GLOBAL_CACHE: false # so that .yarn/cache is written
18
- cache:
19
- key:
20
- files:
21
- - yarn.lock
14
+ image: node:lts
15
+
16
+ variables:
17
+ YARN_ENABLE_GLOBAL_CACHE: false # so that .yarn/cache is written
18
+
19
+ cache:
20
+ - key:
21
+ files:
22
+ - yarn.lock # dependencies cached based on lockfile
23
+ paths:
24
+ - .yarn
25
+ - .pnp.js
26
+ - yarn.lock
27
+ - node_modules
28
+ - '**/node_modules'
29
+ - key: $CI_COMMIT_REF_NAME # build-related files cached per-branch
30
+ paths:
31
+ - '**/.turbo'
32
+ - '**/.nx'
33
+ - '**/.tscache'
34
+ - '**/.tsbuildinfo'
35
+ - '**/.next/cache'
36
+
37
+ stages:
38
+ - install
39
+ - test
40
+ - build
41
+
42
+ # separate so that cache can pre-populate if other steps would fail, it speeds things up
43
+ before_script:
44
+ - corepack enable
45
+ - yarn install --immutable
46
+ - yarn prepare # Add this if Yarn 2+ is used and package is NOT private, otherwise postinstall should be configured, and this line skipped
47
+
48
+ install:
49
+ stage: install
50
+ script:
51
+ - echo Done
52
+
53
+ lint:
54
+ stage: test
55
+ script:
56
+ - yarn lint
57
+
58
+ test:
59
+ stage: test
60
+ image: mcr.microsoft.com/playwright:v1.50.0-noble # keep in sync with installed Playwright version
61
+ artifacts:
62
+ when: always
22
63
  paths:
23
- - .yarn/cache
24
- - yarn.lock
25
- - node_modules
26
- - '**/node_modules'
27
- - '**/.turbo'
28
- - '**/.tscache'
29
- - '**/.next/cache'
64
+ - test-results
65
+ - test-results-html
66
+ reports:
67
+ junit: test-results/junit.xml
68
+ script:
69
+ - yarn test:playwright # https://playwright.dev/docs/ci#running-headed xvfb-run yarn test:playwright
70
+
71
+ # Not needed for Vercel-hosted projects
72
+ build:
73
+ stage: build
30
74
  script:
31
- - yarn --immutable
32
- - yarn prepare # Add this if Yarn 2+ is used and package is NOT private
33
75
  - yarn build
34
76
  only:
35
77
  - master
@@ -37,3 +79,12 @@ build:
37
79
  paths:
38
80
  - web/build
39
81
  ```
82
+
83
+ Cache `.yarn` individually is possible but not needed:
84
+
85
+ ```yaml
86
+ - .yarn/cache
87
+ - .yarn/unplugged
88
+ - .yarn/build-state.yml
89
+ - .yarn/install-state.gz
90
+ ```
package/rules/npm-yarn.md CHANGED
@@ -30,7 +30,7 @@ description: NPM & Yarn patterns
30
30
 
31
31
  # Consistent versions
32
32
 
33
- In Monorepos pin versions of sub-packages to main.
33
+ In Monorepos pin versions of sub-packages to main. Listed packages were seen to cause issues when versions drift.
34
34
 
35
35
  https://github.com/raineorshine/npm-check-updates/issues/1332#issuecomment-1717862332
36
36
  https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides
@@ -40,9 +40,22 @@ Root `package.json`:
40
40
  ```json
41
41
  {
42
42
  "overrides": {
43
+ "@types/node": "$@types/node",
44
+ "@types/react": "$@types/react",
45
+ "@types/react-dom": "$@types/react-dom",
43
46
  "next": "$next",
44
47
  "eslint": "$eslint",
45
- "typescript": "$typescript"
48
+ "typescript": "$typescript",
49
+ "vite": "$vite"
50
+ },
51
+ "resolutions": {
52
+ "@types/node": "^26",
53
+ "@types/react": "^19",
54
+ "@types/react-dom": "^19",
55
+ "eslint": "^10",
56
+ "next": "^16",
57
+ "typescript": "^6",
58
+ "vite": "^8"
46
59
  }
47
60
  }
48
61
  ```
@@ -58,6 +71,8 @@ All other `package.json`:
58
71
  }
59
72
  ```
60
73
 
74
+ ⚠️ Attention! Yarn does not support `overrides` with `$xxx` syntax, use `resolutions` instead. AI Agent MUST keep versions listed in `resolutions` in sync with real ones from `dependencies` and `devDependencies`, if it breaks anything, drop `resolutions` field and fix by changing actual dependencies in leaves to match root.
75
+
61
76
  # `.yarnrc.yml`
62
77
 
63
78
  Make sure `yarnPath` is not specified, rely on `packageManager` in `package.json` and Corepack.