@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.
Files changed (29) hide show
  1. package/README.md +12 -2
  2. package/dist/cjs/cli.js +2 -0
  3. package/dist/cjs/commands/skills.js +207 -0
  4. package/dist/cjs/lint-config/eslint/flat/common.mjs +0 -2
  5. package/dist/cjs/lint-config/eslint/flat/compat.mjs +20 -0
  6. package/dist/cjs/lint-config/eslint/flat/presets.mjs +2 -12
  7. package/dist/cjs/lint-config/eslint/flat/react.mjs +2 -2
  8. package/dist/cjs/lint-config/eslint/flat/rules.mjs +0 -1
  9. package/dist/cjs/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
  10. package/dist/esm/cli.js +2 -0
  11. package/dist/esm/commands/skills.js +176 -0
  12. package/dist/esm/lint-config/eslint/flat/common.mjs +0 -2
  13. package/dist/esm/lint-config/eslint/flat/compat.mjs +20 -0
  14. package/dist/esm/lint-config/eslint/flat/presets.mjs +2 -12
  15. package/dist/esm/lint-config/eslint/flat/react.mjs +2 -2
  16. package/dist/esm/lint-config/eslint/flat/rules.mjs +0 -1
  17. package/dist/esm/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
  18. package/dist/types/lib/commands/skills.d.ts +11 -0
  19. package/dist/types/lib/lint-config/eslint/flat/compat.d.mts +4 -0
  20. package/dist/types/lib/lint-config/eslint/flat/presets.d.mts +2 -45
  21. package/dist/types/lib/lint-config/eslint/flat/rules.d.mts +0 -4
  22. package/dist/types/tsconfig.tsbuildinfo +1 -1
  23. package/lib/lint-config/eslint/flat/common.mjs +0 -2
  24. package/lib/lint-config/eslint/flat/compat.mjs +20 -0
  25. package/lib/lint-config/eslint/flat/presets.mjs +2 -12
  26. package/lib/lint-config/eslint/flat/react.mjs +2 -2
  27. package/lib/lint-config/eslint/flat/rules.mjs +0 -1
  28. package/lib/skills/migrate-to-pui-cli-9/SKILL.md +140 -0
  29. 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
- const storybookFlat =
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': reduxSaga,
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`
@@ -0,0 +1,11 @@
1
+ import { type CommandModule } from 'yargs';
2
+ type SkillTarget = 'cursor' | 'claude' | 'copilot';
3
+ type TargetOption = SkillTarget | 'all';
4
+ type Arguments = {
5
+ action: 'install' | 'list';
6
+ name?: string;
7
+ force?: boolean;
8
+ target?: TargetOption | TargetOption[];
9
+ };
10
+ export declare const skillsCmd: CommandModule<Record<string, never>, Arguments>;
11
+ export {};
@@ -0,0 +1,4 @@
1
+ /** @type {import('eslint').ESLint.Plugin} */
2
+ export const reduxSagaPlugin: import("eslint").ESLint.Plugin;
3
+ /** Storybook flat presets with ESLint 10 compatibility shims applied. */
4
+ export const storybookFlatConfigs: import("@eslint/compat").FixupConfigArray;
@@ -22,48 +22,5 @@ export const reactPresetRules: import("eslint").Linter.RulesRecord;
22
22
  export const wdioRecommendedRules: import("eslint").Linter.RulesRecord;
23
23
  /** @type {Record<string, boolean>} */
24
24
  export const wdioGlobals: Record<string, boolean>;
25
- /** Normalized once — Storybook flat config may be array or single object. */
26
- export const storybookFlatConfigs: ({
27
- name: string;
28
- plugins: {
29
- readonly storybook: any;
30
- };
31
- files?: undefined;
32
- rules?: undefined;
33
- } | {
34
- name: string;
35
- files: string[];
36
- rules: {
37
- readonly "react-hooks/rules-of-hooks": "off";
38
- readonly "import/no-anonymous-default-export": "off";
39
- readonly "storybook/await-interactions": "error";
40
- readonly "storybook/context-in-play-function": "error";
41
- readonly "storybook/default-exports": "error";
42
- readonly "storybook/hierarchy-separator": "warn";
43
- readonly "storybook/no-redundant-story-name": "warn";
44
- readonly "storybook/prefer-pascal-case": "warn";
45
- readonly "storybook/story-exports": "error";
46
- readonly "storybook/use-storybook-expect": "error";
47
- readonly "storybook/use-storybook-testing-library": "error";
48
- readonly "storybook/no-uninstalled-addons"?: undefined;
49
- };
50
- plugins?: undefined;
51
- } | {
52
- name: string;
53
- files: string[];
54
- rules: {
55
- readonly "storybook/no-uninstalled-addons": "error";
56
- readonly "react-hooks/rules-of-hooks"?: undefined;
57
- readonly "import/no-anonymous-default-export"?: undefined;
58
- readonly "storybook/await-interactions"?: undefined;
59
- readonly "storybook/context-in-play-function"?: undefined;
60
- readonly "storybook/default-exports"?: undefined;
61
- readonly "storybook/hierarchy-separator"?: undefined;
62
- readonly "storybook/no-redundant-story-name"?: undefined;
63
- readonly "storybook/prefer-pascal-case"?: undefined;
64
- readonly "storybook/story-exports"?: undefined;
65
- readonly "storybook/use-storybook-expect"?: undefined;
66
- readonly "storybook/use-storybook-testing-library"?: undefined;
67
- };
68
- plugins?: undefined;
69
- })[];
25
+ export { storybookFlatConfigs };
26
+ import { storybookFlatConfigs } from './compat.mjs';
@@ -44,7 +44,6 @@ export const baseRules: {
44
44
  })[];
45
45
  'prefer-template': string;
46
46
  'require-yield': string;
47
- 'eslint-comments/disable-enable-pair': string;
48
47
  };
49
48
  /** Relaxed type-checked rules for test files (shared by default and strict configs). */
50
49
  export const typescriptTestRelaxedRules: {
@@ -120,7 +119,6 @@ export const jsRules: {
120
119
  })[];
121
120
  'prefer-template': string;
122
121
  'require-yield': string;
123
- 'eslint-comments/disable-enable-pair': string;
124
122
  };
125
123
  export const typescriptRules: {
126
124
  'max-lines': (string | {
@@ -205,7 +203,6 @@ export const typescriptRules: {
205
203
  })[];
206
204
  'prefer-template': string;
207
205
  'require-yield': string;
208
- 'eslint-comments/disable-enable-pair': string;
209
206
  };
210
207
  /** Stricter TypeScript rules (error on unsafe any usage). */
211
208
  export const typescriptStrictRules: {
@@ -291,7 +288,6 @@ export const typescriptStrictRules: {
291
288
  })[];
292
289
  'prefer-template': string;
293
290
  'require-yield': string;
294
- 'eslint-comments/disable-enable-pair': string;
295
291
  };
296
292
  export const reactRules: {
297
293
  'jsx-a11y/aria-props': string;