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

Commit

Permalink
Some minor cosmetic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arcanemagus committed Sep 21, 2016
1 parent df69299 commit 8417c30
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lib/main.js
Expand Up @@ -33,6 +33,7 @@ module.exports = {
// Add the current scopes
Array.prototype.push.apply(_this.scopes, scopes);
}));

var embeddedScope = 'source.js.embedded.html';
this.subscriptions.add(atom.config.observe('linter-eslint.lintHtmlFiles', function (lintHtmlFiles) {
if (lintHtmlFiles) {
Expand All @@ -41,6 +42,7 @@ module.exports = {
_this.scopes.splice(_this.scopes.indexOf(embeddedScope), 1);
}
}));

this.subscriptions.add(atom.workspace.observeTextEditors(function (editor) {
editor.onDidSave(function () {
if (_this.scopes.indexOf(editor.getGrammar().scopeName) !== -1 && atom.config.get('linter-eslint.fixOnSave')) {
Expand All @@ -54,6 +56,7 @@ module.exports = {
}
});
}));

this.subscriptions.add(atom.commands.add('atom-text-editor', {
'linter-eslint:fix-file': function linterEslintFixFile() {
var textEditor = atom.workspace.getActiveTextEditor();
Expand Down
1 change: 1 addition & 0 deletions lib/worker.js
Expand Up @@ -39,6 +39,7 @@ function lintJob(argv, contents, eslint, configPath, config) {
return !ignoredMessages.includes(e.message);
});
}

function fixJob(argv, eslint) {
try {
eslint.execute(argv);
Expand Down
6 changes: 0 additions & 6 deletions spec/.eslintrc

This file was deleted.

6 changes: 6 additions & 0 deletions spec/.eslintrc.js
@@ -0,0 +1,6 @@
module.exports = {
env: {
jasmine: true,
atomtest: true
}
}
3 changes: 3 additions & 0 deletions src/main.js
Expand Up @@ -22,6 +22,7 @@ module.exports = {
// Add the current scopes
Array.prototype.push.apply(this.scopes, scopes)
}))

const embeddedScope = 'source.js.embedded.html'
this.subscriptions.add(atom.config.observe('linter-eslint.lintHtmlFiles', (lintHtmlFiles) => {
if (lintHtmlFiles) {
Expand All @@ -30,6 +31,7 @@ module.exports = {
this.scopes.splice(this.scopes.indexOf(embeddedScope), 1)
}
}))

this.subscriptions.add(atom.workspace.observeTextEditors((editor) => {
editor.onDidSave(() => {
if (this.scopes.indexOf(editor.getGrammar().scopeName) !== -1 &&
Expand All @@ -44,6 +46,7 @@ module.exports = {
}
})
}))

this.subscriptions.add(atom.commands.add('atom-text-editor', {
'linter-eslint:fix-file': () => {
const textEditor = atom.workspace.getActiveTextEditor()
Expand Down
1 change: 1 addition & 0 deletions src/worker.js
Expand Up @@ -30,6 +30,7 @@ function lintJob(argv, contents, eslint, configPath, config) {
return global.__LINTER_ESLINT_RESPONSE
.filter(e => !ignoredMessages.includes(e.message))
}

function fixJob(argv, eslint) {
try {
eslint.execute(argv)
Expand Down

0 comments on commit 8417c30

Please sign in to comment.