Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import/no-extraneous-dependencies complains about querystring #1374

Closed
spalger opened this issue May 30, 2019 · 3 comments
Closed

import/no-extraneous-dependencies complains about querystring #1374

spalger opened this issue May 30, 2019 · 3 comments
Labels

Comments

@spalger
Copy link
Contributor

spalger commented May 30, 2019

I just updated from 2.16.0 to 2.17.3 and am now seeing import/no-extraneous-dependencies errors caused by imports for the querystring core module. I'm a little suspicious of #1297 since it's the only changelog item I could find related to core/builtin modules, but it's unclear how it would be causing this.

Any ideas? Happy to submit a fix if someone can help point me in the right direction.

@ljharb
Copy link
Member

ljharb commented May 30, 2019

Can you provide your eslint config (and webpack config, if relevant), and your node version?

@spalger
Copy link
Contributor Author

spalger commented May 30, 2019

Sure thing, I'm using node v10.15.2. Trying to work out a reproduction.

output of `--print-config` for the relevant file (sorry for the size)
{
  "globals": {...},
  "env": {
    "es6": true,
    "node": true,
    "mocha": true,
    "browser": true
  },
  "rules": {
    "@kbn/eslint/module_migration": [
      "error",
      [
        {
          "from": "expect.js",
          "to": "@kbn/expect"
        },
        {
          "from": "x-pack",
          "toRelative": "x-pack"
        }
      ]
    ],
    "block-scoped-var": "error",
    "camelcase": [
      "error",
      {
        "properties": "never",
        "ignoreDestructuring": false
      }
    ],
    "comma-dangle": "off",
    "comma-spacing": [
      "error",
      {
        "before": false,
        "after": true
      }
    ],
    "comma-style": [
      "error",
      "last"
    ],
    "consistent-return": "off",
    "curly": [
      "error",
      "multi-line"
    ],
    "dot-location": [
      "error",
      "property"
    ],
    "dot-notation": [
      "error",
      {
        "allowKeywords": true,
        "allowPattern": ""
      }
    ],
    "eqeqeq": [
      "error",
      "allow-null"
    ],
    "guard-for-in": "error",
    "indent": [
      "error",
      2,
      {
        "SwitchCase": 1,
        "flatTernaryExpressions": false,
        "ignoreComments": false
      }
    ],
    "key-spacing": [
      "error",
      {
        "beforeColon": false,
        "afterColon": true
      }
    ],
    "max-len": [
      "error",
      140,
      2,
      {
        "ignoreComments": true,
        "ignoreUrls": true,
        "code": 80,
        "tabWidth": 4,
        "ignoreStrings": false,
        "ignoreTemplateLiterals": false,
        "ignoreRegExpLiterals": false,
        "ignoreTrailingComments": false
      }
    ],
    "new-cap": [
      "error",
      {
        "capIsNewExceptions": [
          "Private"
        ],
        "newIsCap": true,
        "capIsNew": true,
        "properties": true
      }
    ],
    "no-bitwise": "off",
    "no-caller": "error",
    "no-cond-assign": "off",
    "no-const-assign": "error",
    "no-debugger": "error",
    "no-empty": "error",
    "no-eval": "error",
    "no-extend-native": "error",
    "no-extra-parens": "off",
    "no-extra-semi": [
      "error"
    ],
    "no-global-assign": "error",
    "no-irregular-whitespace": "error",
    "no-iterator": "error",
    "no-loop-func": "error",
    "no-multi-spaces": "off",
    "no-multi-str": "off",
    "no-nested-ternary": "error",
    "no-new": "off",
    "no-path-concat": "off",
    "no-proto": "error",
    "no-redeclare": "error",
    "no-restricted-globals": [
      "error",
      "addEventListener",
      "blur",
      "close",
      "closed",
      "confirm",
      "defaultStatus",
      "defaultstatus",
      "event",
      "external",
      "find",
      "focus",
      "frameElement",
      "frames",
      "history",
      "innerHeight",
      "innerWidth",
      "length",
      "location",
      "locationbar",
      "menubar",
      "moveBy",
      "moveTo",
      "name",
      "onblur",
      "onerror",
      "onfocus",
      "onload",
      "onresize",
      "onunload",
      "open",
      "opener",
      "opera",
      "outerHeight",
      "outerWidth",
      "pageXOffset",
      "pageYOffset",
      "parent",
      "print",
      "removeEventListener",
      "resizeBy",
      "resizeTo",
      "screen",
      "screenLeft",
      "screenTop",
      "screenX",
      "screenY",
      "scroll",
      "scrollbars",
      "scrollBy",
      "scrollTo",
      "scrollX",
      "scrollY",
      "self",
      "status",
      "statusbar",
      "stop",
      "toolbar",
      "top"
    ],
    "no-restricted-imports": [
      2,
      {
        "paths": [
          "gulp-util"
        ]
      }
    ],
    "no-restricted-modules": [
      2,
      {
        "paths": [
          "gulp-util"
        ]
      }
    ],
    "no-return-assign": "off",
    "no-script-url": "error",
    "no-sequences": "error",
    "no-shadow": "off",
    "no-trailing-spaces": "error",
    "no-undef": "error",
    "no-underscore-dangle": "off",
    "no-unsanitized/method": "error",
    "no-unsanitized/property": "error",
    "no-unused-expressions": "off",
    "no-unused-vars": [
      "error"
    ],
    "no-use-before-define": [
      "error",
      "nofunc"
    ],
    "no-var": "error",
    "no-with": "error",
    "one-var": [
      "error",
      "never"
    ],
    "prefer-const": "error",
    "quotes": [
      "error",
      "single",
      {
        "allowTemplateLiterals": true
      }
    ],
    "semi-spacing": [
      "error",
      {
        "before": false,
        "after": true
      }
    ],
    "semi": [
      "error",
      "always"
    ],
    "space-before-blocks": [
      "error",
      "always"
    ],
    "space-before-function-paren": [
      "error",
      {
        "anonymous": "always",
        "named": "never"
      }
    ],
    "space-in-parens": [
      "error",
      "never"
    ],
    "space-infix-ops": [
      "error",
      {
        "int32Hint": false
      }
    ],
    "space-unary-ops": [
      "error"
    ],
    "strict": [
      "error",
      "never"
    ],
    "valid-typeof": "error",
    "wrap-iife": [
      "error",
      "outside"
    ],
    "eol-last": [
      "error",
      "always"
    ],
    "yoda": "off",
    "object-curly-spacing": "off",
    "babel/object-curly-spacing": [
      "error",
      "always"
    ],
    "jsx-quotes": [
      "error",
      "prefer-double"
    ],
    "react/jsx-uses-react": "error",
    "react/react-in-jsx-scope": "error",
    "react/jsx-uses-vars": "error",
    "react/jsx-no-undef": "error",
    "react/jsx-pascal-case": "error",
    "react/jsx-closing-bracket-location": [
      "error",
      "line-aligned"
    ],
    "react/jsx-closing-tag-location": "error",
    "react/jsx-curly-spacing": [
      "error",
      "never",
      {
        "allowMultiline": true
      }
    ],
    "react/jsx-indent-props": [
      "error",
      2
    ],
    "react/jsx-max-props-per-line": [
      "error",
      {
        "maximum": 1,
        "when": "multiline"
      }
    ],
    "react/jsx-no-duplicate-props": [
      "error",
      {
        "ignoreCase": true
      }
    ],
    "react/no-danger": "error",
    "react/self-closing-comp": "error",
    "react/jsx-wrap-multilines": [
      "error",
      {
        "declaration": true,
        "assignment": true,
        "return": true,
        "arrow": true
      }
    ],
    "react/jsx-first-prop-new-line": [
      "error",
      "multiline-multiprop"
    ],
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "jsx-a11y/accessible-emoji": "error",
    "jsx-a11y/alt-text": "error",
    "jsx-a11y/anchor-has-content": "error",
    "jsx-a11y/aria-activedescendant-has-tabindex": "error",
    "jsx-a11y/aria-props": "error",
    "jsx-a11y/aria-proptypes": "error",
    "jsx-a11y/aria-role": "error",
    "jsx-a11y/aria-unsupported-elements": "error",
    "jsx-a11y/heading-has-content": "error",
    "jsx-a11y/html-has-lang": "error",
    "jsx-a11y/iframe-has-title": "error",
    "jsx-a11y/interactive-supports-focus": "error",
    "jsx-a11y/media-has-caption": "error",
    "jsx-a11y/mouse-events-have-key-events": "error",
    "jsx-a11y/no-access-key": "error",
    "jsx-a11y/no-distracting-elements": "error",
    "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
    "jsx-a11y/no-noninteractive-element-interactions": "error",
    "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
    "jsx-a11y/no-redundant-roles": "error",
    "jsx-a11y/role-has-required-aria-props": "error",
    "jsx-a11y/role-supports-aria-props": "error",
    "jsx-a11y/scope": "error",
    "jsx-a11y/tabindex-no-positive": "error",
    "jsx-a11y/label-has-associated-control": "error",
    "react/jsx-equals-spacing": [
      "error",
      "never"
    ],
    "react/jsx-indent": [
      "error",
      2
    ],
    "react/no-will-update-set-state": "error",
    "react/no-is-mounted": "error",
    "react/no-multi-comp": [
      "error",
      {
        "ignoreStateless": true
      }
    ],
    "react/no-unknown-property": "error",
    "react/prefer-es6-class": [
      "error",
      "always"
    ],
    "react/prefer-stateless-function": [
      "error",
      {
        "ignorePureComponents": true
      }
    ],
    "react/no-unescaped-entities": "error",
    "mocha/handle-done-callback": "error",
    "mocha/no-exclusive-tests": "error",
    "import/no-unresolved": [
      "error",
      {
        "amd": true,
        "commonjs": true
      }
    ],
    "import/named": "error",
    "import/namespace": "error",
    "import/default": "error",
    "import/export": "error",
    "import/no-named-as-default": "error",
    "import/no-named-as-default-member": "error",
    "import/no-duplicates": "error",
    "import/no-dynamic-require": "error",
    "prefer-object-spread/prefer-object-spread": "error",
    "@kbn/eslint/require-license-header": [
      "error",
      {
        "license": "\n/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License;\n * you may not use this file except in compliance with the Elastic License.\n */\n"
      }
    ],
    "@kbn/eslint/disallow-license-headers": [
      "error",
      {
        "licenses": [
          "\n/*\n * Licensed to Elasticsearch B.V. under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch B.V. licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n"
        ]
      }
    ],
    "@kbn/eslint/no-restricted-paths": [
      "error",
      {
        "basePath": "/Users/spalger/kbn-dev/master/kibana",
        "zones": [
          {
            "target": [
              "src/legacy/**/*",
              "x-pack/**/*",
              "!x-pack/**/*.test.*",
              "src/plugins/**/(public|server)/**/*",
              "src/core/(public|server)/**/*"
            ],
            "from": [
              "src/core/public/**/*",
              "!src/core/public/index.ts",
              "!src/core/public/mocks.ts",
              "!src/core/public/utils/**/*",
              "src/core/server/**/*",
              "!src/core/server/index.ts",
              "!src/core/server/mocks.ts",
              "src/plugins/**/public/**/*",
              "!src/plugins/**/public/index*",
              "src/plugins/**/server/**/*",
              "!src/plugins/**/server/index*"
            ],
            "allowSameFolder": true
          }
        ]
      }
    ],
    "import/no-extraneous-dependencies": [
      "error",
      {
        "devDependencies": false,
        "peerDependencies": true
      }
    ]
  },
  "parserOptions": {
    "ecmaVersion": 6,
    "ecmaFeatures": {
      "globalReturn": true,
      "experimentalObjectRestSpread": true
    },
    "sourceType": "module"
  },
  "extends": [
    "./javascript.js",
    "./typescript.js",
    "./jest.js",
    "@elastic/eslint-config-kibana"
  ],
  "plugins": [
    "@kbn/eslint-plugin-eslint",
    "mocha",
    "babel",
    "react",
    "react-hooks",
    "import",
    "no-unsanitized",
    "prefer-object-spread",
    "jsx-a11y"
  ],
  "files": [
    "packages/kbn-ui-framework/**/*.js",
    "x-pack/**/*.js",
    "packages/kbn-interpreter/**/*.js",
    "src/fixtures/**/*.js"
  ],
  "parser": "babel-eslint",
  "settings": {
    "react": {
      "version": "16.8.0"
    },
    "import/resolver": {
      "@kbn/eslint-import-resolver-kibana": {
        "forceNode": false,
        "rootPackageName": "kibana",
        "kibanaPath": ".",
        "pluginMap": {
          ".DS_Store": "x-pack/plugins/.DS_Store",
          "apm": "x-pack/plugins/apm",
          "beats_management": "x-pack/plugins/beats_management",
          "canvas": "x-pack/plugins/canvas",
          "cloud": "x-pack/plugins/cloud",
          "code": "x-pack/plugins/code",
          "console_extensions": "x-pack/plugins/console_extensions",
          "cross_cluster_replication": "x-pack/plugins/cross_cluster_replication",
          "dashboard_mode": "x-pack/plugins/dashboard_mode",
          "encrypted_saved_objects": "x-pack/plugins/encrypted_saved_objects",
          "graph": "x-pack/plugins/graph",
          "grokdebugger": "x-pack/plugins/grokdebugger",
          "index_lifecycle_management": "x-pack/plugins/index_lifecycle_management",
          "index_management": "x-pack/plugins/index_management",
          "infra": "x-pack/plugins/infra",
          "kuery_autocomplete": "x-pack/plugins/kuery_autocomplete",
          "license_management": "x-pack/plugins/license_management",
          "logstash": "x-pack/plugins/logstash",
          "maps": "x-pack/plugins/maps",
          "ml": "x-pack/plugins/ml",
          "monitoring": "x-pack/plugins/monitoring",
          "notifications": "x-pack/plugins/notifications",
          "oss_telemetry": "x-pack/plugins/oss_telemetry",
          "remote_clusters": "x-pack/plugins/remote_clusters",
          "reporting": "x-pack/plugins/reporting",
          "rollup": "x-pack/plugins/rollup",
          "searchprofiler": "x-pack/plugins/searchprofiler",
          "security": "x-pack/plugins/security",
          "siem": "x-pack/plugins/siem",
          "snapshot_restore": "x-pack/plugins/snapshot_restore",
          "spaces": "x-pack/plugins/spaces",
          "task_manager": "x-pack/plugins/task_manager",
          "tilemap": "x-pack/plugins/tilemap",
          "translations": "x-pack/plugins/translations",
          "upgrade_assistant": "x-pack/plugins/upgrade_assistant",
          "uptime": "x-pack/plugins/uptime",
          "watcher": "x-pack/plugins/watcher",
          "xpack_main": "x-pack/plugins/xpack_main"
        }
      }
    },
    "import/core-modules": [
      "plugins",
      "legacy/ui",
      "uiExports"
    ]
  }
}

@spalger
Copy link
Contributor Author

spalger commented May 30, 2019

Crap, I just realized while reading through this that we're using a custom resolver, and that by removing it things start working again... My mistake!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants