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

Add autocorrect to Rails/LinkToBlank #6604

Merged
merged 2 commits into from Jan 14, 2019

Conversation

Intrepidd
Copy link

Adding an autocorrect for the Rails/LinkToBlank cop, which will either add rel: 'noopener' to the link_to, or append noopener to the existing rel if any.

private

def append_to_rel(rel_node, corrector)
existing_rel = rel_node.children.last.value
str_range = rel_node.children.last.loc.expression.adjust(
Copy link
Author

Choose a reason for hiding this comment

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

really not fond about this but I didn't find a way to edit a string value, WDYT ?

@bbatsov bbatsov merged commit cd87b1d into rubocop:master Jan 14, 2019
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.

None yet

2 participants