Skip to content

Commit 1063a09

Browse files
committed
Refactor ESLint configurations and clean up code
- Updated ESLint configurations across multiple packages to use the new format and removed deprecated files. - Removed unnecessary ESLint disable comments for better code clarity. - Enhanced error handling in various services by ignoring caught errors without logging. - Cleaned up unused imports and improved code readability in several files. - Adjusted TypeScript configurations to include additional files for better type checking. - Refactored storage utility functions for improved performance and readability. - Removed redundant code and comments to streamline the codebase.
1 parent f4e04a2 commit 1063a09

File tree

200 files changed

+1181
-968
lines changed

Some content is hidden

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

200 files changed

+1181
-968
lines changed

packages/apps/dashboard/server/.eslintrc.js

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import globals from 'globals';
4+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
5+
import jestPlugin from 'eslint-plugin-jest';
6+
import tseslint from 'typescript-eslint';
7+
8+
export default tseslint.config(
9+
{
10+
ignores: ['dist', 'node_modules'],
11+
},
12+
eslint.configs.recommended,
13+
tseslint.configs.recommended,
14+
eslintPluginPrettierRecommended,
15+
{
16+
files: ['**/*.ts', '**/*.js'],
17+
languageOptions: {
18+
globals: {
19+
...globals.node,
20+
...globals.es2022,
21+
},
22+
ecmaVersion: 2022,
23+
sourceType: 'module',
24+
parserOptions: {
25+
projectService: true,
26+
tsconfigRootDir: import.meta.dirname,
27+
},
28+
},
29+
plugins: {
30+
jest: jestPlugin,
31+
},
32+
rules: {
33+
'@typescript-eslint/interface-name-prefix': 'off',
34+
'@typescript-eslint/explicit-function-return-type': 'off',
35+
'@typescript-eslint/explicit-module-boundary-types': 'off',
36+
'@typescript-eslint/no-explicit-any': 'off',
37+
'@typescript-eslint/no-empty-function': 'off',
38+
'@typescript-eslint/no-non-null-assertion': 'off',
39+
},
40+
},
41+
{
42+
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx'],
43+
languageOptions: {
44+
globals: {
45+
...globals.jest,
46+
},
47+
},
48+
plugins: {
49+
jest: jestPlugin,
50+
},
51+
},
52+
);

packages/apps/faucet/client/.eslintrc.json

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import globals from 'globals';
4+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
5+
import jestPlugin from 'eslint-plugin-jest';
6+
import tseslint from 'typescript-eslint';
7+
import { fileURLToPath } from 'node:url';
8+
import path from 'node:path';
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
13+
export default tseslint.config(
14+
{
15+
ignores: ['dist', 'node_modules'],
16+
},
17+
eslint.configs.recommended,
18+
tseslint.configs.recommended,
19+
eslintPluginPrettierRecommended,
20+
{
21+
files: ['**/*.ts', '**/*.js'],
22+
languageOptions: {
23+
globals: {
24+
...globals.node,
25+
...globals.es2022,
26+
},
27+
ecmaVersion: 2022,
28+
sourceType: 'module',
29+
parserOptions: {
30+
projectService: true,
31+
tsconfigRootDir: __dirname,
32+
},
33+
},
34+
plugins: {
35+
jest: jestPlugin,
36+
},
37+
rules: {
38+
'@typescript-eslint/interface-name-prefix': 'off',
39+
'@typescript-eslint/explicit-function-return-type': 'off',
40+
'@typescript-eslint/explicit-module-boundary-types': 'off',
41+
'@typescript-eslint/no-explicit-any': 'off',
42+
},
43+
},
44+
{
45+
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx'],
46+
languageOptions: {
47+
globals: {
48+
...globals.jest,
49+
},
50+
},
51+
plugins: {
52+
jest: jestPlugin,
53+
},
54+
}
55+
);

packages/apps/faucet/client/src/components/Layout/Layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { FC, PropsWithChildren } from 'react';
44
import { Footer } from '../Footer';
55
import { Header } from '../Header';
66

7-
export const Layout: FC<PropsWithChildren<{}>> = ({ children }) => (
7+
type LayoutProps = PropsWithChildren<Record<string, never>>;
8+
9+
export const Layout: FC<LayoutProps> = ({ children }) => (
810
<Box
911
sx={{
1012
marginTop: '88px',

packages/apps/faucet/client/src/components/PageWrapper/PageWrapper.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import Box from '@mui/material/Box';
22
import { FC, PropsWithChildren } from 'react';
33

4-
export const PageWrapper: FC<PropsWithChildren<{}>> = ({ children }) => (
4+
type PageWrapperProps = PropsWithChildren<Record<string, never>>;
5+
6+
export const PageWrapper: FC<PageWrapperProps> = ({ children }) => (
57
<Box sx={{ px: { xs: 0, md: 3, lg: 5, xl: 7 } }}>
68
<Box
79
sx={{

packages/apps/faucet/client/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
"baseUrl": "./",
2121
"types": ["node"]
2222
},
23-
"include": ["src"]
23+
"include": ["src", "vite.config.ts"]
2424
}

packages/apps/faucet/client/vite.config.ts

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,29 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';
99
dotenv.config();
1010

1111
// https://vitejs.dev/config/
12-
export default defineConfig(({ mode }) => {
13-
return {
14-
plugins: [
15-
react(),
16-
nodePolyfills({
17-
// Whether to polyfill `node:` protocol imports.
18-
protocolImports: true,
19-
}),
20-
],
21-
worker: {
22-
plugins: () => react(),
12+
export default defineConfig({
13+
plugins: [
14+
react(),
15+
nodePolyfills({
16+
// Whether to polyfill `node:` protocol imports.
17+
protocolImports: true,
18+
}),
19+
],
20+
worker: {
21+
plugins: () => react(),
22+
},
23+
resolve: {
24+
alias: [{ find: 'src', replacement: path.resolve(__dirname, 'src') }],
25+
},
26+
optimizeDeps: {
27+
include: ['@human-protocol/sdk'],
28+
},
29+
build: {
30+
commonjsOptions: {
31+
include: [/human-protocol-sdk/, /node_modules/],
2332
},
24-
resolve: {
25-
alias: [{ find: 'src', replacement: path.resolve(__dirname, 'src') }],
26-
},
27-
optimizeDeps: {
28-
include: ['@human-protocol/sdk'],
29-
},
30-
build: {
31-
commonjsOptions: {
32-
include: [/human-protocol-sdk/, /node_modules/],
33-
},
34-
},
35-
server: {
36-
port: 3006,
37-
},
38-
};
33+
},
34+
server: {
35+
port: 3006,
36+
},
3937
});

packages/apps/faucet/server/.eslintignore

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

packages/apps/faucet/server/.eslintrc

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

0 commit comments

Comments
 (0)