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

Commit

Permalink
🆕 Add showRuleIdInMessage config
Browse files Browse the repository at this point in the history
  • Loading branch information
steelbrain committed Nov 13, 2015
1 parent bb0a1f9 commit 72cc3cb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export default {
description: 'Make sure you have it in your $PATH',
type: 'boolean',
default: false
},
showRuleIdInMessage: {
title: 'Show Rule ID in Messages',
type: 'boolean',
default: true
}
},
activate: function() {
Expand Down Expand Up @@ -52,6 +57,7 @@ export default {
lint: textEditor => {
const filePath = textEditor.getPath()
const fileDir = Path.dirname(filePath)
const showRule = atom.config.get('linter-eslint.showRuleIdInMessage')

return this.worker.request('JOB', {
fileDir: fileDir,
Expand All @@ -64,12 +70,17 @@ export default {
if (column) {
range[0][1] = column - 1
}
return {
const ret = {
filePath: filePath,
text: message,
type: severity === 1 ? 'Warning' : 'Error',
range: range
}
if (showRule) {
ret.html = `<span class="badge badge-flexible">${ruleId || 'Fatal'}</span> ${message}`
} else {
ret.text = message
}
return ret
})
})
}
Expand Down

0 comments on commit 72cc3cb

Please sign in to comment.