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

Indent rule crashes on comment after an array hole #7959

Closed
Slayer95 opened this issue Jan 20, 2017 · 0 comments · Fixed by singapore/lint-condo#218, renovatebot/renovate#64 or SimpliField/sf-preferences#26 · May be fixed by iamhunter/teammates#4
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly indent Relates to the `indent` rule rule Relates to ESLint's core rules

Comments

@Slayer95
Copy link

Slayer95 commented Jan 20, 2017

Tell us about your environment

  • ESLint Version: Found in Eslint 3.13.1. Confirmed to persist in Eslint 3.14.0
  • Node Version: 7.1.0
  • npm Version: 4.1.1

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

Please show your full configuration:

{
	"root": true,
	"parserOptions": {
		"ecmaVersion": 6,
		"sourceType": "script",
		"ecmaFeatures": {
			"globalReturn": true
		}
	},
	"env": {
		"es6": true,
		"node": true
	},
	"rules": {
		"indent": ["error", "tab"]
	}
}

What did you do? Please include the actual source code causing the issue.

eslint eslint-test.js --debug 1> eslint.log 2>&1

"use strict";

module.exports = [
	, /*{
	}, */{
		name: "foo",
	}
];

What did you expect to happen?

No errors

What actually happened? Please include the actual, raw output from ESLint.

ESLint crashed

Fri, 20 Jan 2017 22:37:49 GMT eslint:cli Running on files
Fri, 20 Jan 2017 22:37:49 GMT eslint:glob-util Creating list of files to process.
Fri, 20 Jan 2017 22:37:49 GMT eslint:ignored-paths Looking for ignore file in D:\Apps
Fri, 20 Jan 2017 22:37:49 GMT eslint:ignored-paths Could not find ignore file in cwd
Fri, 20 Jan 2017 22:37:49 GMT eslint:cli-engine Processing D:\Apps\eslint-test.js
Fri, 20 Jan 2017 22:37:49 GMT eslint:cli-engine Linting D:\Apps\eslint-test.js
Fri, 20 Jan 2017 22:37:49 GMT eslint:config Constructing config for D:\Apps\eslint-test.js
Fri, 20 Jan 2017 22:37:49 GMT eslint:config Using .eslintrc and package.json files
Fri, 20 Jan 2017 22:37:49 GMT eslint:config Loading D:\Apps\.eslintrc.json
Fri, 20 Jan 2017 22:37:49 GMT eslint:config-file Loading JSON config file: D:\Apps\.eslintrc.json
Fri, 20 Jan 2017 22:37:49 GMT eslint:config Using D:\Apps\.eslintrc.json
Fri, 20 Jan 2017 22:37:49 GMT eslint:config Merging command line environment settings
Fri, 20 Jan 2017 22:37:49 GMT eslint:config-ops Apply environment settings to config
Fri, 20 Jan 2017 22:37:49 GMT eslint:config-ops Creating config for environment es6
Fri, 20 Jan 2017 22:37:49 GMT eslint:config-ops Creating config for environment node
Cannot read property 'loc' of null
TypeError: Cannot read property 'loc' of null
    at checkIndentInArrayOrObjectBlock (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\lib\rules\indent.js:732:50)
    at EventEmitter.ObjectExpression (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\lib\rules\indent.js:1005:17)
    at emitOne (events.js:96:13)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.enterNode (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\lib\util\node-event-generator.js:39:22)
    at CodePathAnalyzer.enterNode (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\lib\code-path-analysis\code-path-analyzer.js:607:23)
    at CommentEventGenerator.enterNode (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\lib\util\comment-event-generator.js:98:23)
    at Controller.enter (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\lib\eslint.js:928:36)
    at Controller.__execute (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\node_modules\estraverse\estraverse.js:397:31)
    at Controller.traverse (C:\Users\W7\AppData\Roaming\npm\node_modules\eslint\node_modules\estraverse\estraverse.js:501:28)
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jan 20, 2017
@gyandeeps gyandeeps added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules indent Relates to the `indent` rule and removed triage An ESLint team member will look at this issue soon labels Jan 20, 2017
@gyandeeps gyandeeps self-assigned this Jan 21, 2017
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@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 Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly indent Relates to the `indent` rule rule Relates to ESLint's core rules
Projects
None yet
3 participants