Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Add an ESLint Fix right click command #963

Merged
merged 1 commit into from
Jul 24, 2017

Conversation

Arcanemagus
Copy link
Member

@Arcanemagus Arcanemagus commented Jul 22, 2017

Add an "ESLint Fix" command to the right click menu when it is the active editor and is listed as a valid scope according to the current settings.

Fixes #955.

@Arcanemagus
Copy link
Member Author

Arcanemagus commented Jul 22, 2017

@IanVS Do we want to take on this "black magic", or is there a better way?

Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

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

I'm not too concerned about the "black magic". I see this as a minor nice-to-have feature, and if it breaks at some point in the future we can either fix it at that point, or drop it. No sense stressing about the private methods right now, in my mind. If it works (which it seems to), then :shipit:

src/main.js Outdated
// Compares the private component property of the active TextEditor
// against the components of the elements
const evtIsActiveEditor = evt.path.some(elem =>
elem.component && elem.component === activeEditor.component)
Copy link
Member

Choose a reason for hiding this comment

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

Note: it seems that activeEditor does not have a component prop in atom 1.18.0, so this only works in 1.19.0 and up. I think that's fine, personally.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed for Atom v1.18.0 😉.

@Arcanemagus Arcanemagus force-pushed the arcanemagus/fix-right-click branch from 8ee4be5 to dd3e260 Compare July 22, 2017 01:42
Add an "ESLint Fix" command to the right click menu when it is the
active editor and is listed as a valid scope according to the current
settings.
@Arcanemagus Arcanemagus force-pushed the arcanemagus/fix-right-click branch from dd3e260 to 95bad33 Compare July 24, 2017 18:52
@Arcanemagus Arcanemagus merged commit cd7de8d into master Jul 24, 2017
@Arcanemagus Arcanemagus deleted the arcanemagus/fix-right-click branch July 24, 2017 19:06
@fluxsauce
Copy link

Awesome, thank you!

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.

3 participants