Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Fix false positive in prefer-for-of when array is in parentheses #1986

Merged
merged 2 commits into from Jan 5, 2017

Conversation

nchen63
Copy link
Contributor

@nchen63 nchen63 commented Jan 5, 2017

fixes #1931

@@ -17,7 +17,7 @@

import * as ts from "typescript";
import * as Lint from "../index";
import { isAssignment } from "../language/utils";
import { isAssignment, unwrapParentheses } from "../language/utils";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't know if this is a requirement, but all other rules use the functions from the Lint namespace. for consistency you could use Lint.isAssignment and Lint.unwrapParentheses here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, but that was mainly done for expediency when transitioning the codebase from namespaces to modules -- it was easiest to reference things on the Lint object. Now that we have modules, it would be nice to slowly move to more granular imports.

@adidahiya adidahiya merged commit b20dfce into master Jan 5, 2017
@adidahiya adidahiya deleted the prefer-for-of-fix branch January 5, 2017 16:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prefer-for-of rule false positive
3 participants