Platform-v2 step 2.99b. - npm update of the advised packages, within their ranges: what ships to browsers is axios 1.15.1 -> 1.21.1 and react-router(-dom) 7.14.1 -> 7.18.5 (both apps); build tools: vite 8.0.9 -> 8.3.8 (rolldown 1.2), postcss 8.5.33, babel 7.29.x, browserslist, js-yaml, zod, brace-expansion, nanoid, source-map-js... 30 -> 11 advisories; the 11 left are build-time only (vite-plugin-pwa/workbox-build chain, @capacitor/cli -> xcode -> uuid) and move to 2.99c. - manager_dashboard/eslint.config.js = the waiter's rules; `npm run lint -w manager-dashboard` checks the v2 code (file list in the script), in run-all.mjs. set-state-in-effect is a warning until phase 6 moves page loading to react-query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
JavaScript
// ESLint for the manager (plan step 2.99b): the waiter's rules (React Hooks 7, react-refresh).
|
|
// `npm run lint` checks the code written or converted in platform v2 (the list in V2 below).
|
|
// Older pages break these rules in places (e.g. setState in effects); phase 6 adds each page
|
|
// to V2 as it converts it. `npx eslint src` shows everything.
|
|
import js from '@eslint/js'
|
|
import globals from 'globals'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
|
|
export default defineConfig([
|
|
globalIgnores(['dist', 'dev-dist']),
|
|
{
|
|
files: ['**/*.{js,jsx}'],
|
|
extends: [
|
|
js.configs.recommended,
|
|
reactHooks.configs.flat.recommended,
|
|
reactRefresh.configs.vite,
|
|
],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
ecmaFeatures: { jsx: true },
|
|
sourceType: 'module',
|
|
},
|
|
},
|
|
rules: {
|
|
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
|
|
// The v2 pages load their data with `useEffect(() => { load() }, [load])` (setState after
|
|
// a fetch). A warning until phase 6 moves page loading to react-query (already a dependency).
|
|
'react-hooks/set-state-in-effect': 'warn',
|
|
},
|
|
},
|
|
{
|
|
files: ['tests/**/*.mjs', '*.config.js'],
|
|
languageOptions: { globals: globals.node },
|
|
},
|
|
])
|