Update to ESLint 9

This commit is contained in:
Alejandro Celaya 2024-10-12 20:06:48 +02:00
parent 078c5c8889
commit 94890da48f
8 changed files with 1129 additions and 1323 deletions

2434
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@
"workbox-strategies": "^7.1.0" "workbox-strategies": "^7.1.0"
}, },
"devDependencies": { "devDependencies": {
"@shlinkio/eslint-config-js-coding-standard": "~3.1.0", "@shlinkio/eslint-config-js-coding-standard": "~3.2.0",
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1", "@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
"@stylistic/eslint-plugin": "^2.9.0", "@stylistic/eslint-plugin": "^2.9.0",
"@testing-library/jest-dom": "^6.5.0", "@testing-library/jest-dom": "^6.5.0",
@ -72,10 +72,10 @@
"adm-zip": "^0.5.16", "adm-zip": "^0.5.16",
"axe-core": "^4.10.0", "axe-core": "^4.10.0",
"chalk": "^5.3.0", "chalk": "^5.3.0",
"eslint": "^8.57.0", "eslint": "^9.12.0",
"eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.1", "eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-simple-import-sort": "^12.1.1",
"history": "^5.3.0", "history": "^5.3.0",
"jsdom": "^25.0.1", "jsdom": "^25.0.1",

View file

@ -20,7 +20,6 @@ export function componentFactory<Deps, CompType = Omit<Partial<Deps>, keyof FC>>
console.error(`[Debug] Could not find "${dep as string}" dependency in container`); console.error(`[Debug] Could not find "${dep as string}" dependency in container`);
} }
// eslint-disable-next-line no-param-reassign
Component[dep] = resolvedDependency; Component[dep] = resolvedDependency;
}); });

View file

@ -10,7 +10,7 @@ import './index.scss';
const store = setUpStore(container); const store = setUpStore(container);
const { App, ScrollToTop, ErrorHandler, appUpdateAvailable } = container; const { App, ScrollToTop, ErrorHandler, appUpdateAvailable } = container;
createRoot(document.getElementById('root')!).render( // eslint-disable-line @typescript-eslint/no-non-null-assertion createRoot(document.getElementById('root')!).render(
<Provider store={store}> <Provider store={store}>
<BrowserRouter basename={pack.homepage}> <BrowserRouter basename={pack.homepage}>
<ErrorHandler> <ErrorHandler>

View file

@ -67,7 +67,7 @@ const ImportServersBtn: FCWithDeps<ImportServersBtnConnectProps, ImportServersBt
}) })
.then(() => { .then(() => {
// Reset input after processing file // Reset input after processing file
(target as { value: string | null }).value = null; // eslint-disable-line no-param-reassign (target as { value: string | null }).value = null;
}) })
.catch(onImportError), .catch(onImportError),
[create, onImportError, servers, serversImporter, showModal], [create, onImportError, servers, serversImporter, showModal],

View file

@ -22,7 +22,7 @@ export class ServersExporter {
saveCsv(this.window, csv, SERVERS_FILENAME); saveCsv(this.window, csv, SERVERS_FILENAME);
} catch (e) { } catch (e) {
// FIXME Handle error // FIXME Handle error
console.error(e); // eslint-disable-line no-console console.error(e);
} }
}; };
} }

View file

@ -1,6 +1,5 @@
import type { ShlinkState } from '../../container/types'; import type { ShlinkState } from '../../container/types';
/* eslint-disable no-param-reassign */
export const migrateDeprecatedSettings = (state: Partial<ShlinkState>): Partial<ShlinkState> => { export const migrateDeprecatedSettings = (state: Partial<ShlinkState>): Partial<ShlinkState> => {
if (!state.settings) { if (!state.settings) {
return state; return state;

View file

@ -39,7 +39,7 @@ describe('ShlinkApiClientBuilder', () => {
const apiKey = 'apiKey'; const apiKey = 'apiKey';
const apiClient = buildShlinkApiClient(fromPartial({}))(server({ url, apiKey })); const apiClient = buildShlinkApiClient(fromPartial({}))(server({ url, apiKey }));
expect(apiClient['serverInfo'].baseUrl).toEqual(url); // eslint-disable-line @typescript-eslint/dot-notation expect(apiClient['serverInfo'].baseUrl).toEqual(url);
expect(apiClient['serverInfo'].apiKey).toEqual(apiKey); // eslint-disable-line @typescript-eslint/dot-notation expect(apiClient['serverInfo'].apiKey).toEqual(apiKey);
}); });
}); });