Просмотр исходного кода

ignore app pages dir from eslint

Futa Arai 6 месяцев назад
Родитель
Сommit
2bd62b88e2
2 измененных файлов с 88 добавлено и 90 удалено
  1. 81 84
      apps/app/.eslintrc.js
  2. 7 6
      apps/app/src/pages/login/error/[message].page.tsx

+ 81 - 84
apps/app/.eslintrc.js

@@ -2,89 +2,86 @@
  * @type {import('eslint').Linter.Config}
  */
 module.exports = {
-  extends: [
-    'next/core-web-vitals',
-    'weseek/react',
-  ],
-  plugins: [
-  ],
-  ignorePatterns: [
-    'dist/**',
-    '**/dist/**',
-    'transpiled/**',
-    'public/**',
-    'src/linter-checker/**',
-    'tmp/**',
-    'next-env.d.ts',
-    'next.config.js',
-    'playwright.config.ts',
-    'test/integration/global-setup.js',
-    'test/integration/global-teardown.js',
-    'test/integration/setup-crowi.ts',
-    'test/integration/crowi/**',
-    'test/integration/middlewares/**',
-    'test/integration/migrations/**',
-    'test/integration/models/**',
-    'test/integration/service/**',
-    'test/integration/setup.js',
-    'test-with-vite/**',
-    'public/**',
-    'bin/**',
-    'config/**',
-    'src/styles/**',
-    'src/linter-checker/**',
-    'src/migrations/**',
-    'src/models/**',
-    'src/features/callout/**',
-    'src/features/comment/**',
-    'src/features/templates/**',
-    'src/features/mermaid/**',
-    'src/features/search/**',
-    'src/features/plantuml/**',
-    'src/features/external-user-group/**',
-    'src/features/page-bulk-export/**',
-    'src/features/growi-plugin/**',
-    'src/features/opentelemetry/**',
-    'src/features/rate-limiter/**',
-    'src/stores-universal/**',
-    'src/interfaces/**',
-    'src/utils/**',
-    'src/services/**',
-  ],
-  settings: {
-    // resolve path aliases by eslint-import-resolver-typescript
-    'import/resolver': {
-      typescript: {},
-    },
-  },
-  rules: {
-    '@typescript-eslint/no-var-requires': 'off',
+	extends: ["next/core-web-vitals", "weseek/react"],
+	plugins: [],
+	ignorePatterns: [
+		"dist/**",
+		"**/dist/**",
+		"transpiled/**",
+		"public/**",
+		"src/linter-checker/**",
+		"tmp/**",
+		"next-env.d.ts",
+		"next.config.js",
+		"playwright.config.ts",
+		"test/integration/global-setup.js",
+		"test/integration/global-teardown.js",
+		"test/integration/setup-crowi.ts",
+		"test/integration/crowi/**",
+		"test/integration/middlewares/**",
+		"test/integration/migrations/**",
+		"test/integration/models/**",
+		"test/integration/service/**",
+		"test/integration/setup.js",
+		"test-with-vite/**",
+		"public/**",
+		"bin/**",
+		"config/**",
+		"src/styles/**",
+		"src/linter-checker/**",
+		"src/migrations/**",
+		"src/models/**",
+		"src/features/callout/**",
+		"src/features/comment/**",
+		"src/features/templates/**",
+		"src/features/mermaid/**",
+		"src/features/search/**",
+		"src/features/plantuml/**",
+		"src/features/external-user-group/**",
+		"src/features/page-bulk-export/**",
+		"src/features/growi-plugin/**",
+		"src/features/opentelemetry/**",
+		"src/features/rate-limiter/**",
+		"src/stores-universal/**",
+		"src/interfaces/**",
+		"src/utils/**",
+		"src/services/**",
+		"src/pages/**",
+	],
+	settings: {
+		// resolve path aliases by eslint-import-resolver-typescript
+		"import/resolver": {
+			typescript: {},
+		},
+	},
+	rules: {
+		"@typescript-eslint/no-var-requires": "off",
 
-    // set 'warn' temporarily -- 2021.08.02 Yuki Takei
-    '@typescript-eslint/no-use-before-define': ['warn'],
-    '@typescript-eslint/no-this-alias': ['warn'],
-  },
-  overrides: [
-    {
-      // enable the rule specifically for JavaScript files
-      files: ['*.js', '*.mjs', '*.jsx'],
-      rules: {
-        // set 'warn' temporarily -- 2023.08.14 Yuki Takei
-        'react/prop-types': 'warn',
-        // set 'warn' temporarily -- 2023.08.14 Yuki Takei
-        'no-unused-vars': ['warn'],
-      },
-    },
-    {
-      // enable the rule specifically for TypeScript files
-      files: ['*.ts', '*.mts', '*.tsx'],
-      rules: {
-        'no-unused-vars': 'off',
-        // set 'warn' temporarily -- 2023.08.14 Yuki Takei
-        'react/prop-types': 'warn',
-        // set 'warn' temporarily -- 2022.07.25 Yuki Takei
-        '@typescript-eslint/explicit-module-boundary-types': ['warn'],
-      },
-    },
-  ],
+		// set 'warn' temporarily -- 2021.08.02 Yuki Takei
+		"@typescript-eslint/no-use-before-define": ["warn"],
+		"@typescript-eslint/no-this-alias": ["warn"],
+	},
+	overrides: [
+		{
+			// enable the rule specifically for JavaScript files
+			files: ["*.js", "*.mjs", "*.jsx"],
+			rules: {
+				// set 'warn' temporarily -- 2023.08.14 Yuki Takei
+				"react/prop-types": "warn",
+				// set 'warn' temporarily -- 2023.08.14 Yuki Takei
+				"no-unused-vars": ["warn"],
+			},
+		},
+		{
+			// enable the rule specifically for TypeScript files
+			files: ["*.ts", "*.mts", "*.tsx"],
+			rules: {
+				"no-unused-vars": "off",
+				// set 'warn' temporarily -- 2023.08.14 Yuki Takei
+				"react/prop-types": "warn",
+				// set 'warn' temporarily -- 2022.07.25 Yuki Takei
+				"@typescript-eslint/explicit-module-boundary-types": ["warn"],
+			},
+		},
+	],
 };

+ 7 - 6
apps/app/src/pages/login/error/[message].page.tsx

@@ -1,12 +1,13 @@
 import React from 'react';
+
 import type {
   GetServerSideProps,
   GetServerSidePropsContext,
   NextPage,
 } from 'next';
-import { useRouter } from 'next/router';
 import { useTranslation } from 'next-i18next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
+import { useRouter } from 'next/router';
 
 import { NoLoginLayout } from '~/components/Layout/NoLoginLayout';
 import type { CommonProps } from '~/pages/utils/commons';
@@ -106,9 +107,9 @@ const LoginPage: NextPage<CommonProps> = () => {
  * @param namespacesRequired
  */
 async function injectNextI18NextConfigurations(
-  context: GetServerSidePropsContext,
-  props: Props,
-  namespacesRequired?: string[] | undefined,
+    context: GetServerSidePropsContext,
+    props: Props,
+    namespacesRequired?: string[] | undefined,
 ): Promise<void> {
   const nextI18NextConfig = await getNextI18NextConfig(
     serverSideTranslations,
@@ -118,8 +119,8 @@ async function injectNextI18NextConfigurations(
   props._nextI18Next = nextI18NextConfig._nextI18Next;
 }
 
-export const getServerSideProps: GetServerSideProps = async (
-  context: GetServerSidePropsContext,
+export const getServerSideProps: GetServerSideProps = async(
+    context: GetServerSidePropsContext,
 ) => {
   const result = await getServerSideCommonProps(context);