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

Global .eslintrc breaks when upgrading from eslint v5 to v6 #12266

Closed
kurtextrem opened this issue Sep 13, 2019 · 2 comments
Closed

Global .eslintrc breaks when upgrading from eslint v5 to v6 #12266

kurtextrem opened this issue Sep 13, 2019 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon

Comments

@kurtextrem
Copy link

kurtextrem commented Sep 13, 2019

Tell us about your environment

  • ESLint Version: 6.3.0
  • Node Version: 12.10.0
  • npm Version: 6.10.3

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

Configuration
module.exports = {
	root: true,
	parserOptions: {
		ecmaVersion: 10,
		sourceType: 'module',
		ecmaFeatures: {
			impliedStrict: true,
			jsx: true,
		},
	},
	extends: [
		'airbnb', // @TODO: react config outdated
		'eslint:recommended',
		'plugin:node/recommended',
		'plugin:inferno/recommended',
		'plugin:import/errors',
		'plugin:import/warnings',
		'plugin:promise/recommended',
		'plugin:unicorn/recommended',
		'plugin:flowtype/recommended',
		'plugin:jsdoc/recommended',
		'plugin:security/recommended',
		'xo',
		'xo/browser',
		'xo/esnext',
		'standard',
		'react-app',
		'standard-react',
		'canonical',
		'prettier',
		'prettier/react',
		'prettier/standard',
		'plugin:react-perf/recommended',
	],
	plugins: [
		'compat',
		'security',
		'promise',
		'promise-catch',
		'node',
		'babel',
		'unicorn',
		'jsdoc',
		'dependencies',
		'perf-standard',
		'prototype-chain',
		'inferno',
		'sort-imports-es6-autofix',
		'optimize-regex',
		'react-functional-set-state',
		'react-perf',
		'tree-shaking',
		'no-useless-assign',
		'no-unsafe-regex',
		'lean-imports',
		'dollar-sign',
		'prefer-object-spread',
		'class-prefer-methods',
		'sort-class-members',
	],
	env: {
		browser: true,
		jquery: true,
		node: true,
		webextensions: true,
		serviceworker: true,
		worker: true,
		'shared-node-browser': true,
		commonjs: true,
		es6: true,
	},
	rules: {
	}
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

I'm using the vscode-eslint plugin, however as linting breaks when I upgrade eslint globally, it is an eslint issue.

What did you expect to happen?
Globally installed ESLint loads globally installed eslint plugins/presets.

What actually happened? Please include the actual, raw output from ESLint.
Error message:
Failed to load config "airbnb" to extend from. Referenced from: C:\Users\Jacob.eslintrc.js. Please see the 'ESLint' output channel for details.

Referenced from: C:\Users\Jacob\.eslintrc.js
    at configMissingError (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:233:9)
    at ConfigArrayFactory._loadExtendedShareableConfig (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:712:23)
    at ConfigArrayFactory._loadExtends (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:617:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:547:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:491:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:307:25)
    at ConfigArrayFactory.loadInDirectory (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\config-array-factory.js:400:16)
    at CascadingConfigArrayFactory._finalizeConfigArray (C:\Users\Jacob\AppData\Roaming\npm\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:380:55)

If I comment out airbnb, the error message shows the next (Failed to load plugin 'node')

Are you willing to submit a pull request to fix this bug?
Not sure as I have no idea about the code base.

@kurtextrem kurtextrem added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Sep 13, 2019
@valignatev
Copy link

Have the same issue after upgrading to 6.3.0 from 5.16.0.
Other eslint plugins installed:

    "eslint-config-airbnb": "18.0.1",
    "eslint-import-resolver-webpack": "0.11.1",
    "eslint-loader": "3.0.0",
    "eslint-plugin-import": "2.18.2",
    "eslint-plugin-jsx-a11y": "6.2.3",
    "eslint-plugin-no-only-tests": "2.3.1",
    "eslint-plugin-react": "7.14.3",
    "eslint-plugin-react-hooks": "2.0.1",
    "eslint-scope": "5.0.0",

Node: 12.10.0, yarn 1.17.3, npm 6.11.3
I've checked every eslint release after 5.16.0 (except for alpha and RC releases), they all have this error.
this is the output of eslint if being run directly:

Oops! Something went wrong! :(

ESLint: 6.3.0.

ESLint couldn't find the config "airbnb" to extend from. Please check that the name of the config is correct.

The config "airbnb" was referenced from the config file in "/path/to/.eslintrc.json".

If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.

@mysticatea
Copy link
Member

Thank you for your report.

But this is intentional change that the migration guide explains. We strongly recommend to not use global installations. See that for details.

I'm closing as a duplicate of #11914.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Mar 12, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants