@elliemae/pui-cli 9.0.0-alpha.4 → 9.0.0-alpha.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 +12 -2
- package/dist/cjs/cli.js +2 -0
- package/dist/cjs/commands/skills.js +207 -0
- package/dist/cjs/lint-config/eslint/flat/common.mjs +0 -2
- package/dist/cjs/lint-config/eslint/flat/compat.mjs +20 -0
- package/dist/cjs/lint-config/eslint/flat/presets.mjs +2 -12
- package/dist/cjs/lint-config/eslint/flat/react.mjs +2 -2
- package/dist/cjs/lint-config/eslint/flat/rules.mjs +0 -1
- package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
- package/dist/esm/cli.js +2 -0
- package/dist/esm/commands/skills.js +176 -0
- package/dist/esm/lint-config/eslint/flat/common.mjs +0 -2
- package/dist/esm/lint-config/eslint/flat/compat.mjs +20 -0
- package/dist/esm/lint-config/eslint/flat/presets.mjs +2 -12
- package/dist/esm/lint-config/eslint/flat/react.mjs +2 -2
- package/dist/esm/lint-config/eslint/flat/rules.mjs +0 -1
- package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
- package/dist/types/lib/commands/skills.d.ts +11 -0
- package/dist/types/lib/lint-config/eslint/flat/compat.d.mts +4 -0
- package/dist/types/lib/lint-config/eslint/flat/presets.d.mts +2 -45
- package/dist/types/lib/lint-config/eslint/flat/rules.d.mts +0 -4
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/lib/lint-config/eslint/flat/common.mjs +0 -2
- package/lib/lint-config/eslint/flat/compat.mjs +20 -0
- package/lib/lint-config/eslint/flat/presets.mjs +2 -12
- package/lib/lint-config/eslint/flat/react.mjs +2 -2
- package/lib/lint-config/eslint/flat/rules.mjs +0 -1
- package/lib/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
- package/package.json +18 -18
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import eslint from '@eslint/js';
|
|
2
2
|
import { defineConfig } from 'eslint/config';
|
|
3
3
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
4
|
-
import eslintComments from 'eslint-plugin-eslint-comments';
|
|
5
4
|
import importX from 'eslint-plugin-import-x';
|
|
6
5
|
import jest from 'eslint-plugin-jest';
|
|
7
6
|
import testingLibrary from 'eslint-plugin-testing-library';
|
|
@@ -51,7 +50,6 @@ export function createBaseFlatConfigs(tsRules) {
|
|
|
51
50
|
eslintConfigPrettier,
|
|
52
51
|
{
|
|
53
52
|
plugins: {
|
|
54
|
-
'eslint-comments': eslintComments,
|
|
55
53
|
'import-x': importX,
|
|
56
54
|
},
|
|
57
55
|
languageOptions: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESLint 10 removed deprecated context APIs (e.g. getSourceCode).
|
|
3
|
+
* Wrap legacy plugins until their maintainers publish compatible releases.
|
|
4
|
+
*/
|
|
5
|
+
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
|
|
6
|
+
import reduxSaga from 'eslint-plugin-redux-saga';
|
|
7
|
+
import storybook from 'eslint-plugin-storybook';
|
|
8
|
+
|
|
9
|
+
const storybookFlat =
|
|
10
|
+
storybook.configs['flat/recommended'] ??
|
|
11
|
+
storybook.configs.recommended ??
|
|
12
|
+
[];
|
|
13
|
+
|
|
14
|
+
/** @type {import('eslint').ESLint.Plugin} */
|
|
15
|
+
export const reduxSagaPlugin = fixupPluginRules(reduxSaga);
|
|
16
|
+
|
|
17
|
+
/** Storybook flat presets with ESLint 10 compatibility shims applied. */
|
|
18
|
+
export const storybookFlatConfigs = fixupConfigRules(
|
|
19
|
+
Array.isArray(storybookFlat) ? storybookFlat : [storybookFlat],
|
|
20
|
+
);
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Preset rule bundles and file globs computed once at module load (not per config factory call).
|
|
3
3
|
*/
|
|
4
|
-
import eslintComments from 'eslint-plugin-eslint-comments';
|
|
5
4
|
import importX from 'eslint-plugin-import-x';
|
|
6
5
|
import jest from 'eslint-plugin-jest';
|
|
7
6
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
8
7
|
import react from 'eslint-plugin-react';
|
|
9
8
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
10
9
|
import reduxSaga from 'eslint-plugin-redux-saga';
|
|
11
|
-
import storybook from 'eslint-plugin-storybook';
|
|
12
10
|
import testingLibrary from 'eslint-plugin-testing-library';
|
|
13
11
|
import wdio from 'eslint-plugin-wdio';
|
|
12
|
+
import { storybookFlatConfigs } from './compat.mjs';
|
|
14
13
|
|
|
15
14
|
/** Application and integration tests (Jest + relaxed type-checked rules). */
|
|
16
15
|
export const testFiles = [
|
|
@@ -50,7 +49,6 @@ export const storybookFiles = [
|
|
|
50
49
|
|
|
51
50
|
/** @type {import('eslint').Linter.RulesRecord} */
|
|
52
51
|
export const sharedCoreRules = {
|
|
53
|
-
...eslintComments.configs.recommended.rules,
|
|
54
52
|
...importX.configs.recommended.rules,
|
|
55
53
|
'import-x/named': 'off',
|
|
56
54
|
};
|
|
@@ -83,12 +81,4 @@ export const wdioRecommendedRules = wdio.configs.recommended.rules ?? {};
|
|
|
83
81
|
/** @type {Record<string, boolean>} */
|
|
84
82
|
export const wdioGlobals = wdio.configs.recommended.globals ?? {};
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
storybook.configs['flat/recommended'] ??
|
|
88
|
-
storybook.configs.recommended ??
|
|
89
|
-
[];
|
|
90
|
-
|
|
91
|
-
/** Normalized once — Storybook flat config may be array or single object. */
|
|
92
|
-
export const storybookFlatConfigs = Array.isArray(storybookFlat)
|
|
93
|
-
? storybookFlat
|
|
94
|
-
: [storybookFlat];
|
|
84
|
+
export { storybookFlatConfigs };
|
|
@@ -2,8 +2,8 @@ import { defineConfig } from 'eslint/config';
|
|
|
2
2
|
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
3
3
|
import react from 'eslint-plugin-react';
|
|
4
4
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
5
|
-
import reduxSaga from 'eslint-plugin-redux-saga';
|
|
6
5
|
import { baseFlatConfigs, baseFlatConfigsStrict } from './common.mjs';
|
|
6
|
+
import { reduxSagaPlugin } from './compat.mjs';
|
|
7
7
|
import {
|
|
8
8
|
reactPresetRules,
|
|
9
9
|
storybookFiles,
|
|
@@ -16,7 +16,7 @@ const reactPluginBlock = {
|
|
|
16
16
|
react,
|
|
17
17
|
'react-hooks': reactHooks,
|
|
18
18
|
'jsx-a11y': jsxA11y,
|
|
19
|
-
'redux-saga':
|
|
19
|
+
'redux-saga': reduxSagaPlugin,
|
|
20
20
|
},
|
|
21
21
|
settings: {
|
|
22
22
|
react: { version: 'detect' },
|
|
@@ -38,7 +38,6 @@ export const baseRules = {
|
|
|
38
38
|
'no-param-reassign': ['error', { props: false }],
|
|
39
39
|
'prefer-template': 'error',
|
|
40
40
|
'require-yield': 'off',
|
|
41
|
-
'eslint-comments/disable-enable-pair': 'off',
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
/** Relaxed type-checked rules for test files (shared by default and strict configs). */
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate-to-pui-cli-9
|
|
3
|
+
description: >-
|
|
4
|
+
Migrate a PUI app or library to pui-cli 9 (Node 24, pnpm 11, ESLint 9 flat config).
|
|
5
|
+
Use when upgrading @elliemae/pui-cli, migrating from .eslintrc.cjs to eslint.config.mjs,
|
|
6
|
+
fixing ESLint 9 lint failures, or adopting the shared flat config from pui-cli.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Migrate to pui-cli 9
|
|
10
|
+
|
|
11
|
+
Upgrades a PUI repo from pui-cli 8 (ESLint 8 + `.eslintrc.cjs`) to pui-cli 9
|
|
12
|
+
(ESLint 9 + `eslint.config.mjs` + Node 24 + pnpm 11).
|
|
13
|
+
|
|
14
|
+
## Pre-flight: Toolchain
|
|
15
|
+
|
|
16
|
+
| Requirement | Version |
|
|
17
|
+
| ------------------- | --------------------------------- |
|
|
18
|
+
| Node.js | **24** (see repo `.node-version`) |
|
|
19
|
+
| pnpm | **11** |
|
|
20
|
+
| `@elliemae/pui-cli` | **9.x** (alpha/beta until GA) |
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
fnm use 24 # or nvm/volta equivalent
|
|
24
|
+
corepack enable
|
|
25
|
+
pnpm install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Migration steps (phased PRs recommended)
|
|
29
|
+
|
|
30
|
+
### Phase 1 — Toolchain only
|
|
31
|
+
|
|
32
|
+
1. Update `.node-version` to `24` if needed.
|
|
33
|
+
2. Ensure CI Jenkins/docker images use Node 24.
|
|
34
|
+
3. Upgrade pnpm to 11 (`packageManager` field in root `package.json`).
|
|
35
|
+
4. Run `pnpm install`, `pnpm test`, `pnpm run build` — fix any Node/pnpm breakages only.
|
|
36
|
+
|
|
37
|
+
### Phase 2 — Bump pui-cli
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pnpm add -D @elliemae/pui-cli@9
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Re-run install and smoke-test build/test without ESLint changes yet if the bump is large.
|
|
44
|
+
|
|
45
|
+
### Phase 3 — ESLint 9 flat config
|
|
46
|
+
|
|
47
|
+
**React apps and libraries:**
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
// eslint.config.mjs
|
|
51
|
+
import { eslintFlatConfig } from '@elliemae/pui-cli/eslint';
|
|
52
|
+
|
|
53
|
+
export default eslintFlatConfig;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Node / TS services (non-React):**
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
// eslint.config.mjs
|
|
60
|
+
import { eslintFlatBaseConfig } from '@elliemae/pui-cli/eslint';
|
|
61
|
+
|
|
62
|
+
export default eslintFlatBaseConfig;
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then:
|
|
66
|
+
|
|
67
|
+
1. Delete `.eslintrc.cjs` and `.eslintignore` (ignores are in the shared config).
|
|
68
|
+
2. Run `pnpm exec pui-cli lint --fix`.
|
|
69
|
+
3. Run `pnpm exec pui-cli lint` until **zero errors** (warnings may remain).
|
|
70
|
+
|
|
71
|
+
**Strict mode** (only after default config is clean):
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { eslintFlatConfigStrict } from '@elliemae/pui-cli/eslint';
|
|
75
|
+
export default eslintFlatConfigStrict;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Phase 4 — Repo-specific overrides (if needed)
|
|
79
|
+
|
|
80
|
+
Add overrides **after** importing the shared config only when lint debt blocks the migration:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import { eslintFlatConfig } from '@elliemae/pui-cli/eslint';
|
|
84
|
+
|
|
85
|
+
export default [
|
|
86
|
+
...eslintFlatConfig,
|
|
87
|
+
{
|
|
88
|
+
rules: {
|
|
89
|
+
// Temporary: legacy had ~100 no-explicit-any warnings via @typescript-eslint v5
|
|
90
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Remove overrides in a follow-up debt PR. Do not copy Airbnb or legacy `.eslintrc` rules.
|
|
97
|
+
|
|
98
|
+
### Phase 5 — Verify
|
|
99
|
+
|
|
100
|
+
- [ ] `pnpm exec pui-cli lint` — 0 errors
|
|
101
|
+
- [ ] `pnpm exec pui-cli tscheck --files`
|
|
102
|
+
- [ ] `pnpm test`
|
|
103
|
+
- [ ] `pnpm run build` (or `pui-cli build`)
|
|
104
|
+
- [ ] Pre-commit / lint-staged passes
|
|
105
|
+
- [ ] CI green on the target branch
|
|
106
|
+
|
|
107
|
+
## Common lint fixes after upgrade
|
|
108
|
+
|
|
109
|
+
| Symptom | Fix |
|
|
110
|
+
| ------------------------------------ | ---------------------------------------------------------------------- |
|
|
111
|
+
| `import-x/no-unresolved` | Use `import type` for type-only imports |
|
|
112
|
+
| `@typescript-eslint/no-explicit-any` | Type the value or add targeted override (warn) during transition |
|
|
113
|
+
| `@typescript-eslint/no-unused-vars` | Remove or prefix with `_` |
|
|
114
|
+
| Stale `eslint-disable` comments | Remove disables for rules no longer in config |
|
|
115
|
+
| Test/fixture files flagged | Shared config includes `lib/**/tests/**` globs — ensure pui-cli 9.0.0+ |
|
|
116
|
+
| `.d.ts` files | pui-cli turns off `no-explicit-any` for `**/*.d.ts` |
|
|
117
|
+
|
|
118
|
+
Full rule comparison: [eslint-rules-migration.md](https://docs.pui.mortgagetech.q1.ice.com/cli/eslint-rules-migration) (also at `docs/eslint-rules-migration.md` in pui-cli).
|
|
119
|
+
|
|
120
|
+
## Install this skill in Cursor
|
|
121
|
+
|
|
122
|
+
From the consumer repo (after `@elliemae/pui-cli` is installed):
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pnpm exec pui-cli skills install migrate-to-pui-cli-9 --target all
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Skills are copied to `.cursor/skills/`, `.claude/skills/`, and `.github/skills/` for Cursor, Claude Code, and GitHub Copilot.
|
|
129
|
+
|
|
130
|
+
## What NOT to change
|
|
131
|
+
|
|
132
|
+
- Application business logic — migration is tooling/config only
|
|
133
|
+
- Webpack/babel config unless pui-cli 9 release notes require it
|
|
134
|
+
- Prettier / Stylelint / commitlint configs unless pui-cli 9 bumps those presets
|
|
135
|
+
|
|
136
|
+
## Additional resources
|
|
137
|
+
|
|
138
|
+
- [pui-cli 9 migration guide](https://docs.pui.mortgagetech.q1.ice.com/cli/pui-cli-9-migration)
|
|
139
|
+
- [ESLint rules migration guide](https://docs.pui.mortgagetech.q1.ice.com/cli/eslint-rules-migration)
|
|
140
|
+
- Reference one-liner: `pui-react-boilerplate/eslint.config.mjs`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.6",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"dist",
|
|
38
38
|
"build",
|
|
39
39
|
"lib/lint-config",
|
|
40
|
+
"lib/skills",
|
|
40
41
|
"./app.tsconfig.json",
|
|
41
42
|
"./library.tsconfig.json"
|
|
42
43
|
],
|
|
@@ -77,10 +78,11 @@
|
|
|
77
78
|
"@babel/preset-react": "~7.28.5",
|
|
78
79
|
"@babel/preset-typescript": "~7.28.5",
|
|
79
80
|
"@babel/runtime": "~7.29.2",
|
|
80
|
-
"@commitlint/cli": "~
|
|
81
|
-
"@commitlint/config-conventional": "~
|
|
81
|
+
"@commitlint/cli": "~21.0.1",
|
|
82
|
+
"@commitlint/config-conventional": "~21.0.1",
|
|
82
83
|
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.14.4",
|
|
83
|
-
"@eslint/
|
|
84
|
+
"@eslint/compat": "~1.4.1",
|
|
85
|
+
"@eslint/js": "~10.0.1",
|
|
84
86
|
"@faker-js/faker": "~7.6.0",
|
|
85
87
|
"@nrwl/cli": "~15.9.7",
|
|
86
88
|
"@nrwl/tao": "~15.9.7",
|
|
@@ -170,21 +172,19 @@
|
|
|
170
172
|
"esbuild": "~0.28.0",
|
|
171
173
|
"esbuild-loader": "~3.2.0",
|
|
172
174
|
"esbuild-plugin-svgr": "~1.1.0",
|
|
173
|
-
"eslint": "~
|
|
175
|
+
"eslint": "~10.4.0",
|
|
174
176
|
"eslint-config-prettier": "~10.1.8",
|
|
175
177
|
"eslint-import-resolver-typescript": "~4.4.4",
|
|
176
|
-
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
177
178
|
"eslint-plugin-import-x": "~4.16.1",
|
|
178
|
-
"eslint-plugin-jest": "~29.
|
|
179
|
-
"eslint-plugin-jsdoc": "~50.8.0",
|
|
179
|
+
"eslint-plugin-jest": "~29.15.2",
|
|
180
180
|
"eslint-plugin-jsx-a11y": "~6.10.2",
|
|
181
|
-
"eslint-plugin-mdx": "~3.
|
|
181
|
+
"eslint-plugin-mdx": "~3.7.0",
|
|
182
182
|
"eslint-plugin-react": "~7.37.5",
|
|
183
|
-
"eslint-plugin-react-hooks": "~
|
|
183
|
+
"eslint-plugin-react-hooks": "~7.1.1",
|
|
184
184
|
"eslint-plugin-redux-saga": "~1.3.2",
|
|
185
185
|
"eslint-plugin-storybook": "~0.12.0",
|
|
186
|
-
"eslint-plugin-testing-library": "~7.
|
|
187
|
-
"eslint-plugin-wdio": "~
|
|
186
|
+
"eslint-plugin-testing-library": "~7.16.2",
|
|
187
|
+
"eslint-plugin-wdio": "~9.27.1",
|
|
188
188
|
"execa": "~7.2.0",
|
|
189
189
|
"express": "~4.22.1",
|
|
190
190
|
"express-static-gzip": "~2.2.0",
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"find-up": "~6.3.0",
|
|
195
195
|
"find-up-cli": "~5.0.0",
|
|
196
196
|
"glob": "~11.1.0",
|
|
197
|
-
"globals": "~
|
|
197
|
+
"globals": "~17.6.0",
|
|
198
198
|
"happy-dom": "~12.10.3",
|
|
199
199
|
"helmet": "~8.1.0",
|
|
200
200
|
"html-loader": "~4.2.0",
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
"jscodeshift": "~0.16.1",
|
|
214
214
|
"jsdoc": "~4.0.5",
|
|
215
215
|
"lerna": "~6.6.2",
|
|
216
|
-
"lint-staged": "~
|
|
216
|
+
"lint-staged": "~17.0.5",
|
|
217
217
|
"lodash": "~4.18.1",
|
|
218
218
|
"mini-css-extract-plugin": "~2.10.2",
|
|
219
219
|
"minimist": "~1.2.8",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"postcss-loader": "~7.3.4",
|
|
236
236
|
"postcss-preset-env": "9.6.0",
|
|
237
237
|
"postcss-styled-syntax": "~0.7.1",
|
|
238
|
-
"prettier": "~
|
|
238
|
+
"prettier": "~3.8.3",
|
|
239
239
|
"prisma": "~4.16.2",
|
|
240
240
|
"pug": "~3.0.4",
|
|
241
241
|
"pug-loader": "~2.4.0",
|
|
@@ -253,8 +253,8 @@
|
|
|
253
253
|
"storybook-addon-turbo-build": "~1.1.0",
|
|
254
254
|
"storybook-react-router": "~1.0.8",
|
|
255
255
|
"style-loader": "~3.3.4",
|
|
256
|
-
"stylelint": "~
|
|
257
|
-
"stylelint-config-recommended": "~
|
|
256
|
+
"stylelint": "~17.12.0",
|
|
257
|
+
"stylelint-config-recommended": "~18.0.0",
|
|
258
258
|
"stylelint-config-styled-components": "~0.1.1",
|
|
259
259
|
"supertest": "~6.3.4",
|
|
260
260
|
"swc-loader": "~0.2.7",
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
"tsx": "~4.21.0",
|
|
265
265
|
"typedoc": "~0.28.19",
|
|
266
266
|
"typescript": "5.9.3",
|
|
267
|
-
"typescript-eslint": "~8.
|
|
267
|
+
"typescript-eslint": "~8.59.4",
|
|
268
268
|
"update-notifier": "~6.0.2",
|
|
269
269
|
"url-loader": "~4.1.1",
|
|
270
270
|
"uuid": "~9.0.1",
|