Skip to content

Commit 6a386b6

Browse files
authored
chore: Upgrade to eslint 9 (#900)
## Description PR introduces migration to eslint@9 ⚠️ Depends on #899 ## Type of change - [x] Other (please describe): chore update ## Screenshots n/a ## Testing All CI tasks should pass ## Related Issues [HOO-379](https://linear.app/solana-fndn/issue/HOO-379) ## Checklist - [x] My code follows the project's style guidelines - [x] I have added tests that prove my fix/feature works - [x] All tests pass locally and in CI - [x] I have run `build:info` script to update build information - [x] CI/CD checks pass
1 parent f8d5ef1 commit 6a386b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1480
-698
lines changed

.eslintrc.json

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

.pnpmfile.cjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// https://github.com/pnpm/pnpm/issues/4214
55
// https://github.com/pnpm/pnpm/issues/5391
66

7-
const rootPkg = require('./package.json');
8-
97
console.log(`Checking for package peerDependency overrides`);
108

119
const remapPeerDependencies = [
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// Mock for @bundlr-network/client to avoid Node.js stream.Transform incompatibility in browser environment
2-
export default {};
2+
const mock = {};
3+
export default mock;
34
export const WebBundlr = class {};

.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'node:path';
22
import { fileURLToPath } from 'node:url';
3+
34
import type { StorybookConfig } from '@storybook/nextjs-vite';
45
import { nodePolyfills } from 'vite-plugin-node-polyfills';
56

.storybook/preview.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import type { Preview } from '@storybook/react';
2-
import React, { useEffect } from 'react';
3-
4-
import { Rubik } from 'next/font/google';
5-
61
import './layout.min.css'; // uncomment this line to see Dashkit styles. TODO: remove upon migrating from Dashkit to Tailwind
72
import './dashkit-polyfill.css';
83
import '@/app/styles.css';
94

5+
import type { Preview } from '@storybook/react';
6+
import { Rubik } from 'next/font/google';
7+
import React, { useEffect } from 'react';
8+
109
// Load font with display: swap for better loading behavior
1110
const rubikFont = Rubik({
1211
display: 'swap',
@@ -29,7 +28,9 @@ const preview: Preview = {
2928
},
3029
controls: {
3130
matchers: {
31+
// eslint-disable-next-line no-restricted-syntax -- Storybook controls matcher requires regex to match arg names
3232
color: /(background|color)$/i,
33+
// eslint-disable-next-line no-restricted-syntax -- Storybook controls matcher requires regex to match arg names
3334
date: /Date$/i,
3435
},
3536
},
@@ -41,7 +42,7 @@ const preview: Preview = {
4142
// Add useEffect to ensure font is properly loaded
4243
useEffect(() => {
4344
document.getElementById('storybook-outer')?.classList.add(rubikFont.className);
44-
}, [rubikFont]);
45+
}, []);
4546

4647
return (
4748
<div id="storybook-outer" className={rubikFont.className}>

.storybook/vitest.setup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { beforeAll } from 'vitest';
2-
import { setProjectAnnotations } from '@storybook/nextjs-vite';
31
import * as a11yAnnotations from '@storybook/addon-a11y/preview';
2+
import { setProjectAnnotations } from '@storybook/nextjs-vite';
3+
import { beforeAll } from 'vitest';
4+
45
import * as projectAnnotations from './preview';
56

67
// This is an important step to apply the right configuration when testing your stories.

app/address/[address]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function AddressLayoutInner({ children, params: { address } }: Props) {
206206

207207
try {
208208
pubkey = new PublicKey(address);
209-
} catch (err) {
209+
} catch (_err) {
210210
/* empty */
211211
}
212212

app/components/ClusterStatusButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function getCustomUrlClusterName(customUrl: string) {
1212
return customUrl;
1313
}
1414
return `${url.protocol}//${url.hostname}`;
15-
} catch (e) {
15+
} catch (_e) {
1616
return customUrl;
1717
}
1818
}

app/components/SearchBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ function buildOptions(rawSearch: string, cluster: Cluster, currentEpoch?: bigint
393393
],
394394
});
395395
}
396-
} catch (err) {
396+
} catch (_err) {
397397
// If bs58 decoding fails, check if it's a valid base64 string
398398
if (isValidBase64(search)) {
399399
const decodedTx = decodeTransactionFromBase64(search);
@@ -469,7 +469,7 @@ function decodeTransactionFromBase64(base64String: string): {
469469
return {
470470
message: base64String,
471471
};
472-
} catch (err) {
472+
} catch (_err) {
473473
return null;
474474
}
475475
}
@@ -478,7 +478,7 @@ function isValidBase64(str: string): boolean {
478478
try {
479479
Buffer.from(str, 'base64');
480480
return true;
481-
} catch (err) {
481+
} catch (_err) {
482482
return false;
483483
}
484484
}

app/components/__tests__/ClusterModal.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ vi.mock('./ClusterModalDeveloperSettings', () => ({
2727
}));
2828

2929
// Must import after mocks
30-
// eslint-disable-next-line simple-import-sort/imports
30+
3131
import { ClusterModal } from '../ClusterModal';
3232

3333
function renderWithStore(initialClusters: SavedCluster[] = []) {

0 commit comments

Comments
 (0)