403Webshell
Server IP : 185.208.173.17  /  Your IP : 87.236.161.98
Web Server : Microsoft-IIS/10.0
System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64
User : IUSR ( 0)
PHP Version : 7.4.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/parsmega.nuxt/node_modules/eslint-plugin-nuxt/lib/rules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/eslint-plugin-nuxt/lib/rules/no-env-in-context.js
/**
 * @fileoverview disallow `context.isServer/context.isClient` in `asyncData/fetch/nuxtServerInit`
 * @author Xin Du <clark.duxin@gmail.com>
 */
'use strict'

const utils = require('../utils')

// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------

module.exports = {
  meta: {
    docs: {
      description:
        'disallow `context.isServer/context.isClient` in `asyncData/fetch/nuxtServerInit`',
      category: 'base'
    },
    messages: {
      noEnv: 'Unexpected {{env}} in {{funcName}}.'
    }
  },

  create (context) {
    // variables should be defined here
    const forbiddenNodes = []
    const options = context.options[0] || {}

    const ENV = ['isServer', 'isClient']
    const HOOKS = new Set(['asyncData', 'fetch'].concat(options.methods || []))

    // ----------------------------------------------------------------------
    // Public
    // ----------------------------------------------------------------------

    return {
      MemberExpression (node) {
        const propertyName = node.computed ? node.property.value : node.property.name
        if (propertyName && ENV.includes(propertyName)) {
          forbiddenNodes.push({ name: propertyName, node })
        }
      },
      ...utils.executeOnVue(context, obj => {
        for (const funcName of HOOKS) {
          const func = utils.getFunctionWithName(obj, funcName)
          const param = func && func.value ? func.value.params && func.value.params[0] : false
          if (param) {
            if (param.type === 'ObjectPattern') {
              for (const prop of param.properties) {
                if (prop.key && prop.key.name && ENV.includes(prop.key.name)) {
                  context.report({
                    node: prop,
                    messageId: 'noEnv',
                    data: {
                      env: prop.key.name,
                      funcName
                    }
                  })
                }
              }
            } else {
              for (const { name, node: child } of forbiddenNodes) {
                if (utils.isInFunction(func, child)) {
                  if (param.name === child.object.name) {
                    context.report({
                      node: child,
                      messageId: 'noEnv',
                      data: {
                        env: name,
                        funcName
                      }
                    })
                  }
                }
              }
            }
          }
        }
      })
    }
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit