Skip to content

Commit

Permalink
changing to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
TeroFrondelius committed Jan 24, 2017
1 parent e646923 commit bc98406
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 44 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# linter-example package

A short description of your package.
Just testing to see an update.

![A screenshot of your package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif)
30 changes: 7 additions & 23 deletions lib/linter-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,25 @@ export function activate() {
}

export function deactivate() {
// Fill something here, optional
// Fill something here, opti onal
}

export function provideLinter() {
return {
name: 'Example',
scope: 'file', // or 'project'
lintsOnChange: true, // or true
grammarScopes: ['*'],
grammarScopes: ['source.js'],
lint(textEditor) {
const editorPath = textEditor.getPath()

// Do something sync
// Note, a Promise may be returned as well!
return [{
severity: 'info',
location: {
file: editorPath,
position: [[0, 0], [0, 1]],
},
excerpt: `A random value is ${Math.random()}`,
description: `### What is this?\nThis is a randomly generated value`
type: 'Error',
text: 'Something went wrong',
range: [[0,0], [0,1]],
filePath: editorPath
}]

// Do something async
return new Promise(function(resolve) {
resolve([{
severity: 'info',
location: {
file: editorPath,
position: [[0, 0], [0, 1]],
},
excerpt: `A random value is ${Math.random()}`,
description: `### What is this?\nThis is a randomly generated value`
}])
})
}
}
}
30 changes: 9 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
{
"name": "linter-example",
"main": "./lib/linter-example",
"main": "index.js",
"version": "0.0.0",
"description": "A short description of your package",
"keywords": [
],
"activationCommands": {
"atom-workspace": "linter-example:provideLinter"
},
"repository": "https://github.com/atom/linter-example",
"license": "MIT",
"private": true,
"description": "My Linter Package",
"keywords": ["linter-example", "example"],
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"atom-linter": "^8.0.0",
"atom-package-deps": "^4.0.1"
"atom": ">=1.4.0 <2.0.0"
},
"activationHooks": [
"language-c:grammar-used"
],
"providedServices": {
"linter": {
"versions": {
"2.0.0": "provideLinter"
"linter": {
"versions": {
"1.0.0": "provideLinter"
}
}
}
}
}

0 comments on commit bc98406

Please sign in to comment.