瀏覽代碼

@uppy/companion: harden lint rules (#4641)

Antoine du Hamel 1 年之前
父節點
當前提交
8bc1c2cd0e

+ 0 - 12
.eslintrc.js

@@ -335,18 +335,6 @@ module.exports = {
       files: ['./packages/@uppy/companion/**/*.js'],
       rules: {
         'no-underscore-dangle': 'off',
-
-        // transloadit rules we would like to enforce in the future
-        // but will require separate PRs to gradually get there
-        // and so the meantime: just warn
-        'class-methods-use-this': 'warn',
-        'consistent-return': 'warn',
-        'global-require': 'warn',
-        'import/order': 'warn',
-        'no-param-reassign': 'warn',
-        'no-redeclare': 'warn',
-        'no-shadow': 'warn',
-        'no-use-before-define': 'warn',
       },
     },
     {

+ 1 - 1
packages/@uppy/companion/src/server/Uploader.js

@@ -24,7 +24,7 @@ const { stat, unlink } = fs.promises
 // @ts-ignore - typescript resolves this this to a hoisted version of
 // serialize-error that ships with a declaration file, we are using a version
 // here that does not have a declaration file
-const serializeError = require('serialize-error')
+const serializeError = require('serialize-error') // eslint-disable-line import/order
 const emitter = require('./emitter')
 const { jsonStringify, hasMatch } = require('./helpers/utils')
 const logger = require('./logger')

+ 0 - 1
packages/@uppy/companion/src/server/controllers/deauth-callback.js

@@ -8,7 +8,6 @@ async function deauthCallback ({ body, companion, headers }, res, next) {
   try {
     const { data, status } = await companion.provider.deauthorizationCallback({ companion, body, headers })
     res.status(status || 200).json(data)
-    return
   } catch (err) {
     if (respondWithError(err, res)) return
     next(err)