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

Invalid rule configurations compiled by "eslint --print-config" on eslint-config-airbnb-typescript #2227

Closed
U-4-E-A opened this issue May 16, 2020 · 14 comments
Labels

Comments

@U-4-E-A
Copy link

U-4-E-A commented May 16, 2020

I recently ran eslint --print-config example.js > output.json on my eslint config extending from airbnb-typescript-prettier and some of the rules extracted from packages such as eslint-config-airbnb-base are invalid. Example: -

"import/no-cycle": [
	"error",
	{
		"maxDepth": null
	}
]

Results in the error: -

Error: .eslintrc.js:
Configuration for rule "import/no-cycle" is invalid:
Value null should be integer.

There are a number of other rules that have invalid config: -

"react/destructuring-assignment": [
  "always",
  "error"
],
"react/jsx-closing-bracket-location": [
  "line-aligned",
  "off"
],
"react/jsx-curly-spacing": [
  "never",
  "off",
  {
	"allowMultiline": true
  }
],
"react/jsx-equals-spacing": [
  "never",
  "off"
],
"react/jsx-first-prop-new-line": [
  "multiline-multiprop",
  "off"
],
"react/jsx-space-before-closing": [
  "always",
  "off"
],
"react/prefer-es6-class": [
  "always",
  "error"
],
"react/sort-prop-types": [
  "off",
  {
	"callbacksLast": false,
	"ignoreCase": true,
	"requiredFirst": false,
	"sortShapeProp": true
  }
],
"react/state-in-constructor": [
  "always",
  "error"
],
"array-bracket-newline": [
  "consistent",
  "off"
],
"array-bracket-spacing": [
  "never",
  "off"
],
"arrow-body-style": [
  "as-needed",
  0,
  {
	"requireReturnForObjectLiteral": false
  }
],
"arrow-parens": [
  "always",
  "off"
],
"block-spacing": [
  "always",
  "off"
],
"brace-style": [
  "1tbs",
  "off",
  {
	"allowSingleLine": true
  }
],
"capitalized-comments": [
  "never",
  "off",
  {
	"block": {
	  "ignoreConsecutiveComments": true,
	  "ignoreInlineComments": true,
	  "ignorePattern": ".*"
	},
	"line": {
	  "ignoreConsecutiveComments": true,
	  "ignoreInlineComments": true,
	  "ignorePattern": ".*"
	}
  }
],
"comma-style": [
  "last",
  "off",
  {
	"exceptions": {
	  "ArrayExpression": false,
	  "ArrayPattern": false,
	  "ArrowFunctionExpression": false,
	  "CallExpression": false,
	  "FunctionDeclaration": false,
	  "FunctionExpression": false,
	  "ImportDeclaration": false,
	  "NewExpression": false,
	  "ObjectExpression": false,
	  "ObjectPattern": false,
	  "VariableDeclaration": false
	}
  }
],
"computed-property-spacing": [
  "never",
  "off"
],
"curly": [
  "multi-line",
  0
],
"eol-last": [
  "always",
  "off"
],
"eqeqeq": [
  "always",
  "error",
  {
	"null": "ignore"
  }
],
"func-call-spacing": [
  "never",
  "off"
],
"func-name-matching": [
  "always",
  "off",
  {
	"considerPropertyDescriptor": true,
	"includeCommonJSModuleExports": false
  }
],
"func-style": [
  "expression",
  "off"
],
"function-call-argument-newline": [
  "consistent",
  "off"
],
"function-paren-newline": [
  "consistent",
  "off"
],
"implicit-arrow-linebreak": [
  "beside",
  "off"
],
"lines-between-class-members": [
  "always",
  "error",
  {
	"exceptAfterSingleLine": false
  }
],
"multiline-ternary": [
  "never",
  "off"
],
"no-cond-assign": [
  "always",
  "error"
],
"no-extra-parens": [
  "all",
  "off",
  {
	"conditionalAssign": true,
	"enforceForArrowConditionals": false,
	"ignoreJSX": "all",
	"nestedBinaryExpressions": false,
	"returnAssign": false
  }
],
"no-restricted-globals": [
  "addEventListener",
  "blur",
  "close",
  "closed",
  "confirm",
  "defaultStatus",
  "defaultstatus",
  "error",
  "event",
  "external",
  "find",
  "focus",
  "frameElement",
  "frames",
  "history",
  "innerHeight",
  "innerWidth",
  "isFinite",
  "isNaN",
  "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",
  "scrollBy",
  "scrollTo",
  "scrollX",
  "scrollY",
  "scrollbars",
  "self",
  "status",
  "statusbar",
  "stop",
  "toolbar",
  "top"
],
"no-return-assign": [
  "always",
  "error"
],
"nonblock-statement-body-position": [
  "beside",
  "off",
  {
	"overrides": {}
  }
],
"object-curly-newline": [
  "off",
  {
	"ExportDeclaration": {
	  "consistent": true,
	  "minProperties": 4,
	  "multiline": true
	},
	"ImportDeclaration": {
	  "consistent": true,
	  "minProperties": 4,
	  "multiline": true
	},
	"ObjectExpression": {
	  "consistent": true,
	  "minProperties": 4,
	  "multiline": true
	},
	"ObjectPattern": {
	  "consistent": true,
	  "minProperties": 4,
	  "multiline": true
	}
  }
],
"object-curly-spacing": [
  "always",
  "off"
],
"object-shorthand": [
  "always",
  "error",
  {
	"avoidQuotes": true,
	"ignoreConstructors": false
  }
],
"one-var-declaration-per-line": [
  "always",
  "off"
],
"operator-assignment": [
  "always",
  "error"
],
"operator-linebreak": [
  "before",
  "off",
  {
	"overrides": {
	  "=": "none"
	}
  }
],
"quote-props": [
  "as-needed",
  "off",
  {
	"keywords": false,
	"numbers": false,
	"unnecessary": true
  }
],
"quotes": [
  "single",
  0,
  {
	"avoidEscape": true
  }
],
"rest-spread-spacing": [
  "never",
  "off"
],
"semi": [
  "always",
  "off"
],
"semi-style": [
  "last",
  "off"
],
"sort-keys": [
  "asc",
  "off",
  {
	"caseSensitive": false,
	"natural": true
  }
],
"space-in-parens": [
  "never",
  "off"
],
"spaced-comment": [
  "always",
  "error",
  {
	"block": {
	  "balanced": true,
	  "exceptions": [
		"+",
		"-"
	  ],
	  "markers": [
		"!",
		":",
		"::",
		"="
	  ]
	},
	"line": {
	  "exceptions": [
		"+",
		"-"
	  ],
	  "markers": [
		"!",
		"="
	  ]
	}
  }
],
"template-tag-spacing": [
  "never",
  "off"
],
"unicode-bom": [
  "never",
  "off"
],
"yield-star-spacing": [
  "after",
  "off"
],
@U-4-E-A U-4-E-A changed the title Invalid rule configurations compiled by "eslint --print-config" on Invalid rule configurations compiled by "eslint --print-config" on eslint-config-airbnb-typescript May 16, 2020
@ljharb
Copy link
Collaborator

ljharb commented May 16, 2020

eslint-config-airbnb-typescript and airbnb-typescript-prettier are different packages that we do not maintain or necessarily endorse. We provide Infinity as the maxDepth value, which is valid: https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/imports.js#L236

Perhaps one of these packages is processing our config incorrectly?

@ljharb ljharb closed this as completed May 16, 2020
@ljharb ljharb added the invalid label May 16, 2020
@waissbluth
Copy link

@U-4-E-A did you get to the bottom of this? we are using eslint-config-airbnb-base directly and this suddenly started happening

@mjeffryes
Copy link

I also ran into this this morning after running eslint.js --init to setup a new package.

@ljharb
Copy link
Collaborator

ljharb commented Jun 19, 2020

Can both of you perhaps file a new issue and provide a bit more information, including your configs?

@mding5692
Copy link

Having issues too with this

@arnarb12
Copy link

eslint 7.3.0 was released only an hour ago. It seems to contain something that causes this error.

I fixed this by re-installing eslint 7.2.0

@eistrati
Copy link
Contributor

Same here. Started to appear this morning. Looks like something related to this package: https://www.npmjs.com/package/eslint ... 7.3.0 • Public • Published an hour ago.

@Enase
Copy link

Enase commented Jun 19, 2020

@ljharb
Copy link
Collaborator

ljharb commented Jun 19, 2020

This is indeed a bug in eslint v7.3.0; downgrade to v7.2 for now.

@mehran-naghizadeh

This comment has been minimized.

@keertipAltair

This comment has been minimized.

@uchar

This comment has been minimized.

zachmullen added a commit to girder/girder_web_components that referenced this issue Jun 20, 2020
@SavkaTaras

This comment has been minimized.

@SavkaTaras

This comment has been minimized.

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

No branches or pull requests