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

Commit

Permalink
Fix: 'Fix on Save' should run only in valid file types(fixes #541) (#545
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pvamshi authored and Arcanemagus committed Apr 21, 2016
1 parent e99dc13 commit f4cc378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = {
}));
this.subscriptions.add(atom.workspace.observeTextEditors(function (editor) {
editor.onDidSave(function () {
if (atom.config.get('linter-eslint.fixOnSave')) {
if (_this.scopes.indexOf(editor.getGrammar().scopeName) !== -1 && atom.config.get('linter-eslint.fixOnSave')) {
_this.worker.request('job', {
type: 'fix',
config: atom.config.get('linter-eslint'),
Expand Down
3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ module.exports = {
}))
this.subscriptions.add(atom.workspace.observeTextEditors((editor) => {
editor.onDidSave(() => {
if (atom.config.get('linter-eslint.fixOnSave')) {
if (this.scopes.indexOf(editor.getGrammar().scopeName) !== -1 &&
atom.config.get('linter-eslint.fixOnSave')) {
this.worker.request('job', {
type: 'fix',
config: atom.config.get('linter-eslint'),
Expand Down

0 comments on commit f4cc378

Please sign in to comment.