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

object-curly-spacing warns on trailing comments, fixer deletes #11656

Closed
Slayer95 opened this issue Apr 27, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@Slayer95
Copy link

commented Apr 27, 2019

Tell us about your environment

  • ESLint Version: v5.15.1
  • Node Version: v10.15.3
  • npm Version: v6.4.1

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

Please show your full configuration:

Configuration
{
	"root": true,
	"parserOptions": {
		"ecmaVersion": 9,
		"sourceType": "script",
		"ecmaFeatures": {
			"globalReturn": true
		}
	},
	"env": {
		"es6": true,
		"node": true
	},
	"rules": {
		"object-curly-spacing": ["error", "never"]
	}
}

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

"use strict";

function foo(data) {
	const {bar /* number */} = data;
}
eslint eslint-testcase.js

What did you expect to happen?
Lint passes.

What actually happened? Please include the actual, raw output from ESLint.
Rule object-curly-spacing detected a false positive.

C:\Users\W7\Desktop\osu-accuracy\eslint-testcase.js
4:25 error There should be no space before '}' object-curly-spacing

✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the --fix option.

Note that running with --fix deletes the comment /* number */:

4c4
< 	const {bar /* number */} = data;
---
> 	const {bar} = data;

Are you willing to submit a pull request to fix this bug?
No

@g-plane

This comment has been minimized.

Copy link
Member

commented Apr 27, 2019

Hi @Slayer95 , thanks for this issue.

I can reproduce this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.