Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .eslintrc.json

This file was deleted.

116 changes: 116 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import js from '@eslint/js';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import importXPlugin from 'eslint-plugin-import-x';
import simpleImportSort from 'eslint-plugin-simple-import-sort';

export default [
{ ignores: ['build/', 'dist/', 'node_modules/', 'coverage/'] },

// Shared plugins/rules for src + server
{
files: ['src/**/*.{js,jsx}', 'server/**/*.js'],
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
settings: {
react: { version: '19.0.0' },
},
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
'jsx-a11y': jsxA11yPlugin,
'import-x': importXPlugin,
'simple-import-sort': simpleImportSort,
},
rules: {
...js.configs.recommended.rules,
...reactPlugin.configs.flat.recommended.rules,
...reactHooksPlugin.configs['recommended-latest'].rules,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
...jsxA11yPlugin.flatConfigs.recommended.rules,
...importXPlugin.flatConfigs.recommended.rules,
// Preserved overrides from .eslintrc.json
'react/no-unused-prop-types': ['warn', { skipShapeProps: true }],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'array-bracket-spacing': ['warn', 'never'],
'max-len': ['warn', { code: 120 }],
'no-plusplus': 'error',
'no-undef': 'warn',
'no-unused-vars': 'warn',
'no-useless-assignment': 'off',
'jsx-a11y/no-autofocus': 'off',
'object-curly-spacing': ['warn', 'always'],
'import-x/named': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
},

// src — browser globals
{
files: ['src/**/*.{js,jsx}'],
languageOptions: {
globals: {
...globals.browser,
globalThis: 'readonly',
},
},
},

// server — Node.js globals + build-time injected constants
{
files: ['server/**/*.js'],
languageOptions: {
globals: {
...globals.node,
GIT_TAG: 'readonly',
GIT_COMMIT: 'readonly',
},
},
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.

// test files — vitest globals
{
files: [
'src/**/*.{test,spec}.{js,jsx}',
'src/**/__tests__/**/*.{js,jsx}',
],
languageOptions: {
globals: {
...globals.jest,
vi: 'readonly',
},
},
},

// Files using CommonJS require() — SSR-safe leaflet loading + test bootstrap
{
files: ['src/views/MapView/**/*.js', 'src/setupTests.js'],
languageOptions: {
globals: {
require: 'readonly',
},
},
},

// serviceWorker — dead CRA scaffolding not currently imported anywhere;
// process.env is the CRA-era pattern preserved for potential reactivation.
{
files: ['src/serviceWorker.js'],
languageOptions: {
globals: {
process: 'readonly',
},
},
},
];
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "servicemap-ui",
"version": "2.16.0",
"private": true,
"packageManager": "pnpm@11.1.3",
"packageManager": "pnpm@11.9.0",
"engines": {
"node": ">=22.13.1",
"pnpm": ">=11.1.3"
"pnpm": ">=11.9.0"
},
"dependencies": {
"@emotion/css": "^11.11.2",
Expand All @@ -17,8 +17,8 @@
"@mui/material": "^6.1.4",
"@mui/styles": "^6.1.4",
"@mui/utils": "^6.1.4",
"@sentry/node": "^10.27.0",
"@sentry/react": "^10.20.0",
"@sentry/node": "^10.62.0",
"@sentry/react": "^10.62.0",
"@turf/area": "^6.5.0",
"@turf/boolean-equal": "^6.5.0",
"@turf/boolean-point-in-polygon": "^6.5.0",
Expand Down Expand Up @@ -78,8 +78,8 @@
"dev": "pnpm update-runtime-env && pnpm dev:client:watch & pnpm dev:server:watch & sleep 5 && nodemon dist --watch dist",
"dev:client:watch": "vite build --watch",
"dev:server:watch": "BUILD_TARGET=server vite build --ssr --watch",
"lint": "eslint src/ server/ --ext .js,.jsx && prettier src/ server/ --check",
"lint:fix": "eslint src/ server/ --ext .js,.jsx --fix && prettier src/ server/ --write",
"lint": "eslint src/ server/ && prettier src/ server/ --check",
"lint:fix": "eslint src/ server/ --fix && prettier src/ server/ --write",
"preview": "vite preview",
"start": "node dist",
"test": "NODE_ENV=test pnpm update-runtime-env && vitest --config vitest.config.js",
Expand All @@ -105,18 +105,22 @@
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@emotion/server": "^11.10.0",
"@eslint/js": "^10.0.0",
"@playwright/test": "^1.60.0",
"@sentry/vite-plugin": "^4.6.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@typescript-eslint/parser": "^8.0.0",
"axe-html-reporter": "^2.2.11",
"eslint": "^8.43.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.22.1",
"eslint": "^10.0.0",
"eslint-plugin-import-x": "^4.0.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-vitest-globals": "^1.6.1",
"globals": "^16.0.0",
Comment thread
mikkojamG marked this conversation as resolved.
"identity-obj-proxy": "^3.0.0",
"jsdom": "^27.0.0",
"nodemon": "^2.0.20",
Expand Down
Loading
Loading