Sfoglia il codice sorgente

remove all of rest eslint suppressions

Yuki Takei 3 mesi fa
parent
commit
2a7fb1b83f

+ 1 - 2
apps/app/config/migrate-mongo-config.js

@@ -9,8 +9,7 @@ const isProduction = process.env.NODE_ENV === 'production';
 const { URL } = require('node:url');
 
 const { getMongoUri, mongoOptions } = isProduction
-  ? // eslint-disable-next-line import/extensions, import/no-unresolved
-    require('../dist/server/util/mongoose-utils')
+  ? require('../dist/server/util/mongoose-utils')
   : require('../src/server/util/mongoose-utils');
 
 // get migrationsDir from env var

+ 0 - 1
apps/app/src/client/components/Admin/ImportData/GrowiArchive/ImportForm.jsx

@@ -110,7 +110,6 @@ class ImportForm extends React.Component {
     const { socket } = this.props;
 
     // websocket event
-    // eslint-disable-next-line object-curly-newline
     socket.on(
       'admin:onProgressForImport',
       ({ collectionName, collectionProgress, appendedErrors }) => {

+ 0 - 1
apps/app/src/features/growi-plugin/server/services/growi-plugin/growi-plugin.ts

@@ -253,7 +253,6 @@ export class GrowiPluginService implements IGrowiPluginService {
         })
         .catch((err) => {
           logger.error(err);
-          // eslint-disable-next-line prefer-promise-reject-errors
           rejects('Failed to download file.');
         });
     });

+ 2 - 2
apps/app/src/server/middlewares/inject-reset-order-by-token-middleware.ts

@@ -13,10 +13,10 @@ export type ReqWithPasswordResetOrder = Request & {
   passwordResetOrder: IPasswordResetOrder;
 };
 
-// eslint-disable-next-line import/no-anonymous-default-export
+// biome-ignore lint/style/noDefaultExport: ignore
 export default async (
   req: ReqWithPasswordResetOrder,
-  res: Response,
+  _res: Response,
   next: NextFunction,
 ): Promise<void> => {
   const token: string = req.params.token || req.body.token;

+ 2 - 2
apps/app/src/server/middlewares/inject-user-registration-order-by-token-middleware.ts

@@ -13,10 +13,10 @@ export type ReqWithUserRegistrationOrder = Request & {
   userRegistrationOrder: IUserRegistrationOrder;
 };
 
-// eslint-disable-next-line import/no-anonymous-default-export
+// biome-ignore lint/style/noDefaultExport: ignore
 export default async (
   req: ReqWithUserRegistrationOrder,
-  res: Response,
+  _res: Response,
   next: NextFunction,
 ): Promise<void> => {
   const token = req.params.token || req.body.token;

+ 0 - 2
apps/app/src/server/models/obsolete-page.js

@@ -69,7 +69,6 @@ export const extractToAncestorsPaths = (pagePath) => {
  * @param {string} userPublicFields string to set to select
  * @param {boolean} shouldExcludeBody boolean indicating whether to include 'revision.body' or not
  */
-/* eslint-disable object-curly-newline, object-property-newline */
 export const populateDataToShowRevision = (
   page,
   userPublicFields,
@@ -91,7 +90,6 @@ export const populateDataToShowRevision = (
     },
   ]);
 };
-/* eslint-enable object-curly-newline, object-property-newline */
 
 /** @param {import('~/server/crowi').default | null} crowi Crowi instance */
 export const getPageSchema = (crowi) => {

+ 0 - 2
apps/app/src/server/models/user.js

@@ -592,10 +592,8 @@ const factory = (crowi) => {
     const User = this;
     const newUser = new User();
 
-    /* eslint-disable newline-per-chained-call */
     const tmpUsername = `temp_${crypto.randomBytes(8).toString('hex')}`;
     const password = crypto.randomBytes(12).toString('hex');
-    /* eslint-enable newline-per-chained-call */
 
     newUser.username = tmpUsername;
     newUser.email = email;

+ 0 - 1
apps/app/src/server/routes/apiv3/bookmarks.ts

@@ -331,7 +331,6 @@ module.exports = (crowi) => {
             );
           }
         } else {
-          // eslint-disable-next-line no-lonely-if
           if (bool) {
             logger.warn(
               `Adding the bookmark for ${page._id} by ${req.user._id} failed because the bookmark has already exist.`,

+ 0 - 1
apps/app/src/server/service/global-notification/global-notification-slack.js

@@ -114,7 +114,6 @@ class GlobalNotificationSlackService {
             `invalid vars supplied to GlobalNotificationSlackService.generateOption for event ${event}`,
           );
         }
-        // eslint-disable-next-line no-case-declarations
         messageBody = `:bell: ${username} moved ${oldPath} to ${parmaLink}`;
         break;
       case GlobalNotificationSettingEvent.PAGE_LIKE:

+ 1 - 1
apps/app/src/server/service/installer.ts

@@ -83,7 +83,7 @@ export class InstallerService {
     // update createdAt and updatedAt fields of all pages
     if (initialPagesCreatedAt != null) {
       try {
-        // TODO typescriptize models/user.js and remove eslint-disable-next-line
+        // biome-ignore lint/suspicious/noExplicitAny: TODO: typescriptize models/user.js and remove biome suppressions
         const Page = mongoose.model('Page') as any;
 
         // Increment timestamp to avoid difference for order in VRT

+ 0 - 1
apps/app/src/server/service/s2s-messaging/index.ts

@@ -57,7 +57,6 @@ class S2sMessagingServiceFactory {
     const moduleFileName = envToModuleMappings[type];
 
     const modulePath = `./${moduleFileName}`;
-    // eslint-disable-next-line @typescript-eslint/no-var-requires
     this.delegator = require(modulePath)(crowi);
 
     if (this.delegator == null) {

+ 0 - 1
apps/app/src/server/service/slack-command-handler/search.js

@@ -154,7 +154,6 @@ module.exports = (crowi) => {
       action_id: 'search:dismissSearchResults',
     });
     // show "Prev" button if previous page exists
-    // eslint-disable-next-line yoda
     if (0 < offset) {
       actionBlocks.elements.push({
         type: 'button',

+ 0 - 1
apps/app/src/states/page/use-fetch-current-page.spec.tsx

@@ -128,7 +128,6 @@ describe('useFetchCurrentPage - Integration Test', () => {
       statusText: 'OK',
       headers: {},
       // Cast to satisfy AxiosResponse without resorting to explicit any
-      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
       config: {} as AxiosResponse['config'],
     };
   };

+ 4 - 6
apps/app/test/integration/middlewares/login-required.test.js

@@ -1,5 +1,3 @@
-/* eslint-disable arrow-body-style */
-
 const { getInstance } = require('../setup-crowi');
 
 describe('loginRequired', () => {
@@ -35,7 +33,7 @@ describe('loginRequired', () => {
 
       let isGuestAllowedToReadSpy;
 
-      beforeEach(async () => {
+      beforeEach(() => {
         // setup req
         req = {
           originalUrl: 'original url 1',
@@ -109,7 +107,7 @@ describe('loginRequired', () => {
 
       let isGuestAllowedToReadSpy;
 
-      beforeEach(async () => {
+      beforeEach(() => {
         // setup req
         req = {
           originalUrl: 'original url 1',
@@ -189,7 +187,7 @@ describe('loginRequired', () => {
 
     let isGuestAllowedToReadSpy;
 
-    beforeEach(async () => {
+    beforeEach(() => {
       // reset session object
       req.session = {};
       // spy for AclService.isGuestAllowedToRead
@@ -309,7 +307,7 @@ describe('loginRequired', () => {
 
     let isGuestAllowedToReadSpy;
 
-    beforeEach(async () => {
+    beforeEach(() => {
       // reset session object
       req.session = {};
       // spy for AclService.isGuestAllowedToRead

+ 0 - 3
bin/data-migrations/src/index.js

@@ -1,6 +1,3 @@
-/* eslint-disable no-undef, regex/invalid, import/extensions */
-// ignore lint error because this file is js as mongoshell
-
 /**
  * @typedef {import('./types').MigrationModule} MigrationModule
  * @typedef {import('./types').ReplaceLatestRevisions} ReplaceLatestRevisions

+ 2 - 4
packages/pdf-converter-client/src/index.ts

@@ -12,7 +12,6 @@ import type {
 export type PdfCtrlSyncJobStatus202Status = typeof PdfCtrlSyncJobStatus202Status[keyof typeof PdfCtrlSyncJobStatus202Status];
 
 
-// eslint-disable-next-line @typescript-eslint/no-redeclare
 export const PdfCtrlSyncJobStatus202Status = {
   HTML_EXPORT_IN_PROGRESS: 'HTML_EXPORT_IN_PROGRESS',
   HTML_EXPORT_DONE: 'HTML_EXPORT_DONE',
@@ -30,7 +29,6 @@ export type PdfCtrlSyncJobStatus202 = {
 export type PdfCtrlSyncJobStatusBodyStatus = typeof PdfCtrlSyncJobStatusBodyStatus[keyof typeof PdfCtrlSyncJobStatusBodyStatus];
 
 
-// eslint-disable-next-line @typescript-eslint/no-redeclare
 export const PdfCtrlSyncJobStatusBodyStatus = {
   HTML_EXPORT_IN_PROGRESS: 'HTML_EXPORT_IN_PROGRESS',
   HTML_EXPORT_DONE: 'HTML_EXPORT_DONE',
@@ -85,11 +83,11 @@ export interface InternalServerError {
 
 
   /**
- * 
+ *
     Sync job pdf convert status with GROWI.
     Register or update job inside pdf-converter with given jobId, expirationDate, and status.
     Return resulting status of job to GROWI.
-  
+
  */
 export const pdfCtrlSyncJobStatus = <TData = AxiosResponse<PdfCtrlSyncJobStatus202>>(
     pdfCtrlSyncJobStatusBody: PdfCtrlSyncJobStatusBody, options?: AxiosRequestConfig