Skip to content

Commit

Permalink
fix(prettier): fix prettier (#22187)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored Jan 1, 2025
1 parent 4af2f4a commit cc381d2
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 47 deletions.
10 changes: 3 additions & 7 deletions api-node/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import eslint from '@eslint/js';
import eslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import airbnbBase from 'eslint-config-airbnb-base';
import eslintConfigPrettier from 'eslint-config-prettier';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import jestPlugin from 'eslint-plugin-jest';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
import securityPlugin from 'eslint-plugin-security';
import globals from 'globals';

Expand Down Expand Up @@ -84,7 +82,6 @@ export default [
'@typescript-eslint': eslintPlugin,
import: importPlugin,
jest: jestPlugin,
prettier: prettierPlugin,
security: securityPlugin,
},
settings: {
Expand All @@ -94,7 +91,7 @@ export default [
},
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json'
project: 'tsconfig.json',
},
},
},
Expand All @@ -103,7 +100,6 @@ export default [
...airbnbBase.rules,
...jestPlugin.configs.recommended.rules,
...securityPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
'import/extensions': [
'error',
'ignorePackages',
Expand Down Expand Up @@ -141,5 +137,5 @@ export default [
],
},
},
prettierConfig // Make sure prettierConfig is last
prettierPluginRecommended, // Make sure this is last
];
6 changes: 3 additions & 3 deletions api-node/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { requestID } from "@gfx687/express-request-id";
import { requestID } from '@gfx687/express-request-id';
import * as Sentry from '@sentry/node';
import cookieParser from 'cookie-parser';
import express from 'express';
Expand Down Expand Up @@ -37,7 +37,7 @@ const app = express()
.use('/graphql', graphQLUploadMiddleware, graphQLMiddleware)
.use('/api', apiRouter)
.use(redirectToIndexRouter);
Sentry.setupExpressErrorHandler(app) // Must be after all routes and before any and other error-handling middlewares
app.use(handleError)
Sentry.setupExpressErrorHandler(app); // Must be after all routes and before any and other error-handling middlewares
app.use(handleError);

export default app;
5 changes: 1 addition & 4 deletions api-node/src/graphQL/middlewares/graphQLMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const graphQLMiddleware = createHandler({
dataLoaders: dataLoaders(),
myId: verifyJWTTokenAndExtractMyID((raw as Request).headers.authorization),
}),
validationRules: [
...(isProduction() ? [NoSchemaIntrospectionCustomRule] : []),
depthLimit(5),
],
validationRules: [...(isProduction() ? [NoSchemaIntrospectionCustomRule] : []), depthLimit(5)],
});

export default graphQLMiddleware;
9 changes: 3 additions & 6 deletions ethereum/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import eslint from '@eslint/js';
import eslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import airbnbBase from 'eslint-config-airbnb-base';
import eslintConfigPrettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
import securityPlugin from 'eslint-plugin-security';
import globals from 'globals';

Expand Down Expand Up @@ -75,7 +74,6 @@ export default [
plugins: {
'@typescript-eslint': eslintPlugin,
import: importPlugin,
prettier: prettierPlugin,
security: securityPlugin,
},
settings: {
Expand All @@ -85,15 +83,14 @@ export default [
},
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json'
project: 'tsconfig.json',
},
},
},
rules: {
...eslintPlugin.configs.recommended.rules,
...airbnbBase.rules,
...securityPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
'import/extensions': [
'error',
'ignorePackages',
Expand Down Expand Up @@ -130,5 +127,5 @@ export default [
],
},
},
eslintConfigPrettier, // Make sure prettier config is last
prettierPluginRecommended, // Make sure this is last
];
11 changes: 3 additions & 8 deletions mobile/mobile-react-native/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import eslint from '@eslint/js';
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import airbnb from 'eslint-config-airbnb';
import eslintConfigPrettier from 'eslint-config-prettier';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
import globals from 'globals';

Expand Down Expand Up @@ -78,7 +76,6 @@ export default [
plugins: {
'@typescript-eslint': typescriptEslintPlugin,
import: importPlugin,
prettier: prettierPlugin,
react: reactPlugin,
},
settings: {
Expand All @@ -88,7 +85,7 @@ export default [
},
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json'
project: 'tsconfig.json',
},
},
react: {
Expand All @@ -99,7 +96,6 @@ export default [
...typescriptEslintPlugin.configs.recommended.rules,
...airbnb.rules,
...reactPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
'import/extensions': [
'error',
'ignorePackages',
Expand Down Expand Up @@ -151,9 +147,8 @@ export default [
{
files: ['**/*.{ts,tsx}'],
rules: {
...eslintConfigPrettier.rules,
'prettier/prettier': 'error',
},
},
prettierConfig // Make sure prettierConfig is last
prettierPluginRecommended, // Make sure this is last
];
9 changes: 3 additions & 6 deletions web-cypress/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import eslint from '@eslint/js';
import eslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import airbnbBase from 'eslint-config-airbnb-base';
import prettierConfig from 'eslint-config-prettier';
import cypressPlugin from 'eslint-plugin-cypress';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';

/**
Expand Down Expand Up @@ -81,7 +80,6 @@ export default [
'@typescript-eslint': eslintPlugin,
cypress: cypressPlugin,
import: importPlugin,
prettier: prettierPlugin,
},
settings: {
'import/resolver': {
Expand All @@ -90,15 +88,14 @@ export default [
},
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json'
project: 'tsconfig.json',
},
},
},
rules: {
...eslintPlugin.configs.recommended.rules,
...cypressPlugin.configs.recommended.rules,
...airbnbBase.rules,
...prettierConfig.rules,
'import/extensions': [
'error',
'ignorePackages',
Expand Down Expand Up @@ -134,5 +131,5 @@ export default [
],
},
},
prettierConfig, // Make sure prettierConfig is last
prettierPluginRecommended, // Make sure this is last
];
5 changes: 1 addition & 4 deletions web/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
stories: ['../src/**/*.stories.tsx'],
addons: [
'@storybook/addon-essentials',
'@chromatic-com/storybook',
],
addons: ['@storybook/addon-essentials', '@chromatic-com/storybook'],
framework: {
name: '@storybook/react-vite',
options: {},
Expand Down
10 changes: 4 additions & 6 deletions web/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import tanstackQueryPlugin from '@tanstack/eslint-plugin-query';
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import airbnb from 'eslint-config-airbnb';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import jestPlugin from 'eslint-plugin-jest';
import jestDomPlugin from 'eslint-plugin-jest-dom';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierPluginRecommended from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
import reactRefreshPlugin from 'eslint-plugin-react-refresh';
import securityPlugin from 'eslint-plugin-security';
Expand Down Expand Up @@ -89,7 +88,6 @@ export default [
jest: jestPlugin,
'jest-dom': jestDomPlugin,
'jsx-a11y': jsxA11yPlugin,
prettier: prettierPlugin,
react: reactPlugin,
'react-refresh': reactRefreshPlugin,
security: securityPlugin,
Expand All @@ -102,7 +100,7 @@ export default [
},
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json'
project: 'tsconfig.json',
},
},
react: {
Expand Down Expand Up @@ -155,7 +153,7 @@ export default [
},
],
'react/prop-types': 'off',
'react-refresh/only-export-components': "error",
'react-refresh/only-export-components': 'error',
'security/detect-non-literal-fs-filename': 'off',
'spaced-comment': [
'error',
Expand All @@ -179,5 +177,5 @@ export default [
'import/no-unresolved': 'off',
},
},
prettierConfig, // Make sure prettierConfig is last
prettierPluginRecommended, // Make sure this is last
];
2 changes: 0 additions & 2 deletions web/src/auth/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ const useAuth = (): UseAuth => {
});

if (res?.data?.data?.signUp?.jwtToken === null || res?.data?.data?.signUp?.jwtToken === '') {

console.log('Failed to sign up.');
return;
}

updateMe(res?.data?.data?.signUp);
} catch (err) {

console.error(err);
}
};
Expand Down
2 changes: 1 addition & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export default defineConfig({
reporter: ['text', 'html'],
},
},
})
});

0 comments on commit cc381d2

Please sign in to comment.