Skip to content

Conversation

@ota-meshi
Copy link
Owner

@ota-meshi ota-meshi commented Jun 8, 2021

  • The no-unused-capturing-group rule, the no-useless-flag rule, and the rules using getUsageOfPattern, have been changed to handle the exported directive.
  • Variables were tracked by the no-unused-capturing-group rule, the no-useless-flag rule, and the getUsageOfPattern function. In this PR, variable tracking is shared with the extractExpressionReferences function, and it has been changed to use this function.
  • The no-unused-capturing-group rule has improved iteration tracking.
  • The tracking of used properties that the no-unused-capturing-group rule was handling has been separated by the extractPropertyReferences function. This can also be used to detect the d flag, which is probably unused.

close #227

@ota-meshi ota-meshi marked this pull request as ready for review June 9, 2021 05:42
@RunDevelopment
Copy link
Collaborator

Good work @ota-meshi! Apart from my above comment, I don't have much to say about this PR. Merge this anytime you think it's ready.

@ota-meshi ota-meshi requested a review from RunDevelopment June 9, 2021 11:05
Copy link
Collaborator

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Two nits

/**
* Find function node
*/
function findFunction(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function should probably be placed and exported in the same file as findVariable.

ObjectPattern,
Pattern,
} from "estree"
import { findVariable, getParent } from "."
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a circular dependency and I really don't like those.

I suggest moving the code (without the export ... from "..."s) in ast-util/index.ts into its own file ast-util/something.ts. By simply doing an export * from "./something" in ast-util/index.ts and changing the import here to ./something, we can get rid of the circular dependency.

@ota-meshi
Copy link
Owner Author

Thank you for checking! I changed this PR.

@ota-meshi ota-meshi requested a review from RunDevelopment June 9, 2021 23:05
@RunDevelopment RunDevelopment merged commit 3bdde2d into master Jun 10, 2021
@RunDevelopment RunDevelopment deleted the support-eslint-exported branch June 10, 2021 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support exported directive

3 participants