Skip to content

Commit 3a3d156

Browse files
chore: fix depreciate lint command
1 parent c7b8e77 commit 3a3d156

File tree

5 files changed

+134
-109
lines changed

5 files changed

+134
-109
lines changed

apps/app/eslint.config.js

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,45 @@
1-
import { FlatCompat } from '@eslint/eslintrc';
21
import js from '@eslint/js';
3-
import { fileURLToPath } from 'url';
4-
import { dirname } from 'path';
5-
6-
const __filename = fileURLToPath(import.meta.url);
7-
const __dirname = dirname(__filename);
8-
9-
const compat = new FlatCompat({
10-
baseDirectory: __dirname,
11-
recommendedConfig: js.configs.recommended,
12-
});
13-
14-
const config = [
15-
// Extend Next.js config using compat
16-
...compat.extends('next/core-web-vitals', 'next/typescript'),
2+
import nextPlugin from '@next/eslint-plugin-next';
3+
import reactPlugin from 'eslint-plugin-react';
4+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
5+
import tsParser from '@typescript-eslint/parser';
6+
import tsPlugin from '@typescript-eslint/eslint-plugin';
7+
import globals from 'globals';
178

9+
export default [
10+
js.configs.recommended,
1811
{
1912
files: ['**/*.{js,jsx,ts,tsx}'],
13+
languageOptions: {
14+
parser: tsParser,
15+
parserOptions: {
16+
ecmaVersion: 'latest',
17+
sourceType: 'module',
18+
ecmaFeatures: { jsx: true },
19+
},
20+
globals: {
21+
...globals.browser,
22+
...globals.node,
23+
React: 'readonly',
24+
},
25+
},
26+
plugins: {
27+
'@next/next': nextPlugin,
28+
react: reactPlugin,
29+
'react-hooks': reactHooksPlugin,
30+
'@typescript-eslint': tsPlugin,
31+
},
2032
rules: {
33+
// Next.js rules
34+
...nextPlugin.configs.recommended.rules,
35+
...nextPlugin.configs['core-web-vitals'].rules,
36+
37+
// React rules
38+
'react/react-in-jsx-scope': 'off',
39+
'react/prop-types': 'off',
40+
'react-hooks/rules-of-hooks': 'error',
41+
'react-hooks/exhaustive-deps': 'warn',
42+
2143
// TypeScript specific rules
2244
'@typescript-eslint/no-unused-vars': [
2345
'error',
@@ -27,6 +49,7 @@ const config = [
2749
},
2850
],
2951
'@typescript-eslint/no-explicit-any': 'warn',
52+
'no-unused-vars': 'off', // Use TypeScript version instead
3053

3154
// General JavaScript rules
3255
'prefer-const': 'error',
@@ -41,10 +64,7 @@ const config = [
4164
},
4265
},
4366
},
44-
4567
{
4668
ignores: ['node_modules/', '.next/', 'out/', 'build/', 'dist/'],
4769
},
4870
];
49-
50-
export default config;

apps/app/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import './.next/types/routes.d.ts';
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/app/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "next dev --turbopack",
88
"build": "next build --turbopack",
99
"start": "next start",
10-
"lint": "next lint",
10+
"lint": "eslint src",
1111
"type-check": "tsc --noEmit"
1212
},
1313
"dependencies": {
@@ -57,16 +57,20 @@
5757
"devDependencies": {
5858
"@eslint/eslintrc": "^3.2.0",
5959
"@eslint/js": "^9.32.0",
60+
"@next/eslint-plugin-next": "^16.1.0",
6061
"@tailwindcss/postcss": "^4.1.17",
6162
"@types/node": "^20.10.0",
6263
"@types/react": "^19.0.0",
6364
"@types/react-dom": "^19.0.0",
6465
"@typescript-eslint/eslint-plugin": "^8.34.0",
65-
"@typescript-eslint/parser": "^8.34.0",
66+
"@typescript-eslint/parser": "^8.46.3",
6667
"autoprefixer": "^10.4.21",
6768
"eslint": "^9.32.0",
6869
"eslint-config-next": "16.1.0",
6970
"eslint-plugin-import": "^2.32.0",
71+
"eslint-plugin-react": "^7.37.5",
72+
"eslint-plugin-react-hooks": "^7.0.1",
73+
"globals": "^16.5.0",
7074
"postcss": "^8.5.6",
7175
"tailwindcss": "^4.1.17",
7276
"typescript": "^5.3.2"

apps/app/src/lib/solana/rpc.ts

Lines changed: 68 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -120,77 +120,71 @@ export function createRpcSubscriptions(rpcUrl?: string): RpcSubscriptions<Solana
120120
* @returns Promise with current authorities
121121
*/
122122
export async function getTokenAuthorities(mintAddress: string, rpcUrl?: string): Promise<TokenAuthorities> {
123-
try {
124-
const rpc = createRpcClient(rpcUrl);
123+
const rpc = createRpcClient(rpcUrl);
125124

126-
// Fetch account using @solana/kit like inspect-mint does
127-
const mintAddressTyped = mintAddress as Address;
128-
const encodedAccount = await fetchEncodedAccount(rpc, mintAddressTyped);
125+
// Fetch account using @solana/kit like inspect-mint does
126+
const mintAddressTyped = mintAddress as Address;
127+
const encodedAccount = await fetchEncodedAccount(rpc, mintAddressTyped);
129128

130-
if (!encodedAccount.exists) {
131-
throw new Error('Mint account not found');
132-
}
129+
if (!encodedAccount.exists) {
130+
throw new Error('Mint account not found');
131+
}
133132

134-
// Check if this is a Token-2022 mint
135-
if (encodedAccount.programAddress !== TOKEN_2022_PROGRAM_ADDRESS) {
136-
throw new Error(`Not a Token-2022 mint (owner: ${encodedAccount.programAddress})`);
137-
}
133+
// Check if this is a Token-2022 mint
134+
if (encodedAccount.programAddress !== TOKEN_2022_PROGRAM_ADDRESS) {
135+
throw new Error(`Not a Token-2022 mint (owner: ${encodedAccount.programAddress})`);
136+
}
138137

139-
// Decode mint data using gill's decodeMint
140-
const decodedMint = decodeMint(encodedAccount);
141-
142-
// Extract basic authorities
143-
const authorities: TokenAuthorities = {
144-
mintAuthority:
145-
decodedMint.data.mintAuthority?.__option === 'Some' ? decodedMint.data.mintAuthority.value : undefined,
146-
freezeAuthority:
147-
decodedMint.data.freezeAuthority?.__option === 'Some'
148-
? decodedMint.data.freezeAuthority.value
149-
: undefined,
150-
};
151-
152-
// Extract extension authorities
153-
if (decodedMint.data.extensions && decodedMint.data.extensions.__option === 'Some') {
154-
for (const ext of decodedMint.data.extensions.value) {
155-
if (!ext.__kind) continue;
156-
157-
switch (ext.__kind) {
158-
case 'TokenMetadata':
159-
if ('updateAuthority' in ext && ext.updateAuthority) {
160-
authorities.metadataAuthority =
161-
ext.updateAuthority.__option === 'Some' ? ext.updateAuthority.value : undefined;
162-
}
163-
break;
164-
case 'PermanentDelegate':
165-
if ('delegate' in ext) {
166-
authorities.permanentDelegateAuthority = ext.delegate;
167-
}
168-
break;
169-
case 'ConfidentialTransferMint':
170-
if ('authority' in ext && ext.authority) {
171-
authorities.confidentialBalancesAuthority =
172-
ext.authority.__option === 'Some' ? ext.authority.value : undefined;
173-
}
174-
break;
175-
case 'PausableConfig':
176-
if ('authority' in ext && ext.authority) {
177-
authorities.pausableAuthority =
178-
ext.authority.__option === 'Some' ? ext.authority.value : undefined;
179-
}
180-
break;
181-
case 'ScaledUiAmountConfig':
182-
if ('authority' in ext && ext.authority) {
183-
authorities.scaledUiAmountAuthority = ext.authority;
184-
}
185-
break;
186-
}
138+
// Decode mint data using gill's decodeMint
139+
const decodedMint = decodeMint(encodedAccount);
140+
141+
// Extract basic authorities
142+
const authorities: TokenAuthorities = {
143+
mintAuthority:
144+
decodedMint.data.mintAuthority?.__option === 'Some' ? decodedMint.data.mintAuthority.value : undefined,
145+
freezeAuthority:
146+
decodedMint.data.freezeAuthority?.__option === 'Some' ? decodedMint.data.freezeAuthority.value : undefined,
147+
};
148+
149+
// Extract extension authorities
150+
if (decodedMint.data.extensions && decodedMint.data.extensions.__option === 'Some') {
151+
for (const ext of decodedMint.data.extensions.value) {
152+
if (!ext.__kind) continue;
153+
154+
switch (ext.__kind) {
155+
case 'TokenMetadata':
156+
if ('updateAuthority' in ext && ext.updateAuthority) {
157+
authorities.metadataAuthority =
158+
ext.updateAuthority.__option === 'Some' ? ext.updateAuthority.value : undefined;
159+
}
160+
break;
161+
case 'PermanentDelegate':
162+
if ('delegate' in ext) {
163+
authorities.permanentDelegateAuthority = ext.delegate;
164+
}
165+
break;
166+
case 'ConfidentialTransferMint':
167+
if ('authority' in ext && ext.authority) {
168+
authorities.confidentialBalancesAuthority =
169+
ext.authority.__option === 'Some' ? ext.authority.value : undefined;
170+
}
171+
break;
172+
case 'PausableConfig':
173+
if ('authority' in ext && ext.authority) {
174+
authorities.pausableAuthority =
175+
ext.authority.__option === 'Some' ? ext.authority.value : undefined;
176+
}
177+
break;
178+
case 'ScaledUiAmountConfig':
179+
if ('authority' in ext && ext.authority) {
180+
authorities.scaledUiAmountAuthority = ext.authority;
181+
}
182+
break;
187183
}
188184
}
189-
190-
return authorities;
191-
} catch (error) {
192-
throw error;
193185
}
186+
187+
return authorities;
194188
}
195189

196190
/**
@@ -202,18 +196,14 @@ export async function getExtensionAuthorities(
202196
_mintAddress: string,
203197
_rpcUrl?: string,
204198
): Promise<Partial<TokenAuthorities>> {
205-
try {
206-
// TODO: Implement extension-specific authority fetching
207-
// This would require fetching each extension's account data
208-
// For now, return empty object as placeholder
209-
210-
return {
211-
metadataAuthority: undefined,
212-
pausableAuthority: undefined,
213-
confidentialBalancesAuthority: undefined,
214-
permanentDelegateAuthority: undefined,
215-
};
216-
} catch (error) {
217-
throw error;
218-
}
199+
// TODO: Implement extension-specific authority fetching
200+
// This would require fetching each extension's account data
201+
// For now, return empty object as placeholder
202+
203+
return {
204+
metadataAuthority: undefined,
205+
pausableAuthority: undefined,
206+
confidentialBalancesAuthority: undefined,
207+
permanentDelegateAuthority: undefined,
208+
};
219209
}

pnpm-lock.yaml

Lines changed: 21 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)