Skip to content

Commit 7d7a55b

Browse files
committed
chore(ui): upgrade dependencies and migrate to ESLint 9 flat config
1 parent d76c640 commit 7d7a55b

36 files changed

Lines changed: 3812 additions & 5346 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ SPDX-License-Identifier: MIT-0
1818

1919
### Changed
2020

21+
- **UI dependency cleanup — eliminated 11 of 12 npm deprecation warnings** — Replaced deprecated `@aws-sdk/*` packages with `@smithy/*` equivalents, removed unused Babel plugins, migrated ESLint 8→9 (flat config), upgraded Prettier 2→3, and upgraded jsdom 26→29. Added `"type": "module"` to `package.json`. Also added `caughtErrors: 'none'` to ESLint config to stop flagging unused catch clause variables (reduces UI lint warnings from 39 → 21). Added `FORCE=1` arg to `make ui-lint` to force re-run despite checksum match.
22+
2123
- **Headless deployment documentation generalized** — headless mode is no longer documented as a GovCloud-only capability. New `docs/headless-deployment.md` is the canonical guide covering headless deployment for both Commercial and GovCloud regions (API-only / pipeline integrations, organizational restrictions on UI-layer services, cost optimization, and required for GovCloud).
2224

2325
## Templates

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,21 @@ endif
255255
@echo "Starting UI development server..."
256256
cd src/ui && npm run start
257257

258-
ui-lint: ## Run UI linting with checksum caching (skips if unchanged)
258+
ui-lint: ## Run UI linting with checksum caching (skips if unchanged). Use FORCE=1 to force re-run.
259259
@echo "Checking if UI lint is needed..."
260260
@CURRENT_HASH=$$($(PYTHON) -c "from publish import IDPPublisher; p = IDPPublisher(); print(p.get_directory_checksum('src/ui'))"); \
261261
STORED_HASH=$$(test -f src/ui/.checksum && cat src/ui/.checksum || echo ""); \
262-
if [ "$$CURRENT_HASH" != "$$STORED_HASH" ]; then \
263-
echo "UI code checksum changed - running lint..."; \
262+
if [ -n "$(FORCE)" ] || [ "$$CURRENT_HASH" != "$$STORED_HASH" ]; then \
263+
if [ -n "$(FORCE)" ]; then \
264+
echo "FORCE=1 set - running lint..."; \
265+
else \
266+
echo "UI code checksum changed - running lint..."; \
267+
fi; \
264268
cd src/ui && npm ci --prefer-offline --no-audit && npm run lint -- --fix && npm run typecheck || exit 1; \
265269
echo "$$CURRENT_HASH" > .checksum; \
266270
echo -e "$(GREEN)✅ UI lint and typecheck completed and checksum updated$(NC)"; \
267271
else \
268-
echo -e "$(GREEN)✅ UI code checksum unchanged - skipping lint$(NC)"; \
272+
echo -e "$(GREEN)✅ UI code checksum unchanged - skipping lint (use FORCE=1 to force re-run)$(NC)"; \
269273
fi
270274

271275
ui-build: ## Build UI for production

src/ui/.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/ui/.eslintrc.json

Lines changed: 0 additions & 119 deletions
This file was deleted.

src/ui/.eslintrc.security.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/ui/.eslintrc.temp.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/ui/eslint.config.js

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
// @ts-check
2+
import js from '@eslint/js';
3+
import globals from 'globals';
4+
import tseslint from 'typescript-eslint';
5+
import reactPlugin from 'eslint-plugin-react';
6+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
7+
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
8+
import importXPlugin from 'eslint-plugin-import-x';
9+
import jestPlugin from 'eslint-plugin-jest';
10+
import prettierPlugin from 'eslint-plugin-prettier';
11+
import prettierConfig from 'eslint-config-prettier';
12+
13+
export default tseslint.config(
14+
// Global ignores (replaces .eslintignore)
15+
{
16+
ignores: [
17+
'node_modules/**',
18+
'build/**',
19+
'delete/**',
20+
'tmp/**',
21+
'src/graphql/generated/**',
22+
'vite.config.js',
23+
],
24+
},
25+
26+
// Base JS recommended rules
27+
js.configs.recommended,
28+
29+
// Base config for all JS/JSX/TS/TSX files
30+
{
31+
files: ['src/**/*.{js,jsx,ts,tsx}'],
32+
plugins: {
33+
react: reactPlugin,
34+
'react-hooks': reactHooksPlugin,
35+
'jsx-a11y': jsxA11yPlugin,
36+
'import-x': importXPlugin,
37+
jest: jestPlugin,
38+
prettier: prettierPlugin,
39+
},
40+
languageOptions: {
41+
ecmaVersion: 'latest',
42+
sourceType: 'module',
43+
globals: {
44+
...globals.browser,
45+
...globals.es2021,
46+
...globals.jest,
47+
},
48+
parserOptions: {
49+
ecmaFeatures: {
50+
jsx: true,
51+
},
52+
},
53+
},
54+
settings: {
55+
react: {
56+
version: 'detect',
57+
},
58+
'import-x/resolver': {
59+
node: {
60+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
61+
},
62+
},
63+
},
64+
rules: {
65+
// React recommended rules (manually included since flat config)
66+
...reactPlugin.configs.recommended.rules,
67+
...jsxA11yPlugin.configs.recommended.rules,
68+
69+
// Prettier
70+
'prettier/prettier': [
71+
'error',
72+
{
73+
printWidth: 140,
74+
singleQuote: true,
75+
trailingComma: 'all',
76+
},
77+
],
78+
79+
// General rules
80+
'no-console': 'off',
81+
'no-alert': 'off',
82+
'max-len': [
83+
'error',
84+
{
85+
code: 140,
86+
ignoreUrls: true,
87+
ignoreTemplateLiterals: true,
88+
ignoreComments: true,
89+
ignoreStrings: true,
90+
ignoreRegExpLiterals: true,
91+
},
92+
],
93+
'linebreak-style': ['error', 'unix'],
94+
'object-curly-newline': ['error', { consistent: true }],
95+
96+
// React rules
97+
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.tsx'] }],
98+
'react/jsx-wrap-multilines': ['off', { prop: 'parens-new-line' }],
99+
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
100+
'react/require-default-props': 'off',
101+
'react/no-array-index-key': 'warn',
102+
'react-hooks/exhaustive-deps': 'off',
103+
104+
// Import rules
105+
'import-x/no-unresolved': ['error', { ignore: ['\\.css$'] }],
106+
'import-x/extensions': [
107+
'error',
108+
'ignorePackages',
109+
{
110+
js: 'never',
111+
jsx: 'never',
112+
ts: 'never',
113+
tsx: 'never',
114+
},
115+
],
116+
'import-x/prefer-default-export': 'off',
117+
118+
// Misc
119+
'no-shadow': 'warn',
120+
},
121+
},
122+
123+
// TypeScript-specific overrides
124+
...tseslint.configs.recommended.map((config) => ({
125+
...config,
126+
files: ['src/**/*.ts', 'src/**/*.tsx'],
127+
})),
128+
{
129+
files: ['src/**/*.ts', 'src/**/*.tsx'],
130+
rules: {
131+
'no-unused-vars': 'off',
132+
'@typescript-eslint/no-unused-vars': [
133+
'warn',
134+
{
135+
argsIgnorePattern: '^_',
136+
varsIgnorePattern: '^_',
137+
destructuredArrayIgnorePattern: '^_',
138+
caughtErrors: 'none',
139+
},
140+
],
141+
'no-shadow': 'off',
142+
'@typescript-eslint/no-shadow': 'warn',
143+
'@typescript-eslint/no-explicit-any': 'warn',
144+
'react/react-in-jsx-scope': 'off',
145+
'react/prop-types': 'off',
146+
},
147+
},
148+
149+
// Prettier config last (disables conflicting rules)
150+
prettierConfig,
151+
);

0 commit comments

Comments
 (0)