This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from Arcanemagus/new-linter-api
Update to the new Linter API
- Loading branch information
Showing
7 changed files
with
91 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
.idea | ||
npm-debug.log | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"max_line_length": { | ||
"value": 120, | ||
"level": "warn" | ||
}, | ||
"no_empty_param_list": { | ||
"level": "error" | ||
}, | ||
"arrow_spacing": { | ||
"level": "error" | ||
}, | ||
"no_interpolation_in_single_quotes": { | ||
"level": "error" | ||
}, | ||
"no_debugger": { | ||
"level": "error" | ||
}, | ||
"prefer_english_operator": { | ||
"level": "error" | ||
}, | ||
"colon_assignment_spacing": { | ||
"spacing": { | ||
"left": 0, | ||
"right": 1 | ||
}, | ||
"level": "error" | ||
}, | ||
"braces_spacing": { | ||
"spaces": 0, | ||
"level": "error" | ||
}, | ||
"spacing_after_comma": { | ||
"level": "error" | ||
}, | ||
"no_stand_alone_at": { | ||
"level": "error" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
helpers = require('atom-linter') | ||
path = require('path') | ||
|
||
module.exports = | ||
provideLinter: -> | ||
helpers = require('atom-linter') | ||
provider = | ||
grammarScopes: ['source.css', 'source.html'] | ||
scope: 'file' | ||
lintOnFly: true | ||
lint: (textEditor) -> | ||
filePath = textEditor.getPath() | ||
text = textEditor.getText() | ||
parameters = ['--format=json', '-'] | ||
exec = path.join(__dirname, '..', 'node_modules', 'csslint', 'cli.js') | ||
helpers.execNode(exec, parameters, {stdin: text}).then (output) -> | ||
lintResult = JSON.parse(output) | ||
toReturn = [] | ||
if lintResult.messages.length < 1 | ||
return toReturn | ||
for data in lintResult.messages | ||
line = data.line - 1 | ||
col = data.col - 1 | ||
toReturn.push({ | ||
type: data.type.charAt(0).toUpperCase() + data.type.slice(1), | ||
text: data.message, | ||
filePath: filePath | ||
range: [[line, col], [line, col]], | ||
trace: [{ | ||
type: "Text", | ||
text: '[' + data.rule.id + '] ' + data.rule.desc | ||
}] | ||
}) | ||
return toReturn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters