Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit a7dafdc

Browse files
committed
package: run lint:fix
All of these changes we're made by `prettier` automatically
1 parent bca4e24 commit a7dafdc

19 files changed

+1978
-1436
lines changed

ISSUE_TEMPLATE.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Do you want to ask a question? Are you looking for support? The Atom message boa
88

99
### Prerequisites
1010

11-
* [ ] Put an X between the brackets on this line if you have done all of the following:
12-
* Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
13-
* Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
14-
* Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
15-
* Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
16-
* Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
11+
- [ ] Put an X between the brackets on this line if you have done all of the following:
12+
- Reproduced the problem in Safe Mode: http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
13+
- Followed all applicable steps in the debugging guide: http://flight-manual.atom.io/hacking-atom/sections/debugging/
14+
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
15+
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
16+
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
1717

1818
### Description
1919

PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Requirements
22

3-
* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
4-
* All new code requires tests to ensure against regressions
3+
- Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
4+
- All new code requires tests to ensure against regressions
55

66
### Description of the Change
77

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Snippets package
2+
23
[![macOS Build Status](https://travis-ci.org/atom/snippets.svg?branch=master)](https://travis-ci.org/atom/snippets) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/8hlc0onofkgbxw53/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/snippets/branch/master) [![Dependency Status](https://david-dm.org/atom/snippets.svg)](https://david-dm.org/atom/snippets)
34

45
Expand snippets matching the current prefix with <kbd>tab</kbd> in Atom.
@@ -27,23 +28,25 @@ Under each snippet name is a `prefix` that should trigger the snippet and a `bod
2728
The above example adds a `log` snippet to JavaScript files that would expand to.
2829

2930
```js
30-
console.log("crash");
31+
console.log('crash');
3132
```
3233

3334
The string `"crash"` would be initially selected and pressing tab again would place the cursor after the `;`
3435

3536
### Optional parameters
37+
3638
These parameters are meant to provide extra information about your snippet to [autocomplete-plus](https://github.com/atom/autocomplete-plus/wiki/Provider-API).
3739

38-
* `leftLabel` will add text to the left part of the autocomplete results box.
39-
* `leftLabelHTML` will overwrite what's in `leftLabel` and allow you to use a bit of CSS such as `color`.
40-
* `rightLabelHTML`. By default, in the right part of the results box you will see the name of the snippet. When using `rightLabelHTML` the name of the snippet will no longer be displayed, and you will be able to use a bit of CSS.
41-
* `description` will add text to a description box under the autocomplete results list.
42-
* `descriptionMoreURL` URL to the documentation of the snippet.
40+
- `leftLabel` will add text to the left part of the autocomplete results box.
41+
- `leftLabelHTML` will overwrite what's in `leftLabel` and allow you to use a bit of CSS such as `color`.
42+
- `rightLabelHTML`. By default, in the right part of the results box you will see the name of the snippet. When using `rightLabelHTML` the name of the snippet will no longer be displayed, and you will be able to use a bit of CSS.
43+
- `description` will add text to a description box under the autocomplete results list.
44+
- `descriptionMoreURL` URL to the documentation of the snippet.
4345

4446
![autocomplete-description](http://i.imgur.com/cvI2lOq.png)
4547

4648
Example:
49+
4750
```coffee
4851
'.source.js':
4952
'console.log':
@@ -55,7 +58,7 @@ Example:
5558

5659
### Determining the correct scope for a snippet
5760

58-
The outmost key of a snippet is the "scope" that you want the descendent snippets to be available in. The key should be prefixed with a period (`text.html.basic` => `.text.html.basic`). You can find out the correct scope by opening the Settings (<kbd>cmd-,</kbd> on macOS) and selecting the corresponding *Language [xxx]* package, e.g. for *Language Html*:
61+
The outmost key of a snippet is the "scope" that you want the descendent snippets to be available in. The key should be prefixed with a period (`text.html.basic` => `.text.html.basic`). You can find out the correct scope by opening the Settings (<kbd>cmd-,</kbd> on macOS) and selecting the corresponding _Language [xxx]_ package, e.g. for _Language Html_:
5962

6063
![Screenshot of Language Html settings](https://cloud.githubusercontent.com/assets/1038121/5137632/126beb66-70f2-11e4-839b-bc7e84103f67.png)
6164

@@ -68,9 +71,9 @@ This package supports a subset of the features of TextMate snippets, [documented
6871

6972
The following features are not yet supported:
7073

71-
* Variables
72-
* Interpolated shell code
73-
* Conditional insertions in transformations
74+
- Variables
75+
- Interpolated shell code
76+
- Conditional insertions in transformations
7477

7578
### Multi-line Snippet Body
7679

appveyor.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
version: "{build}"
1+
version: '{build}'
22

33
platform: x64
44

55
branches:
6-
only:
7-
- master
6+
only:
7+
- master
88

99
clone_depth: 10
1010

@@ -14,8 +14,8 @@ environment:
1414
APM_TEST_PACKAGES:
1515

1616
matrix:
17-
- ATOM_CHANNEL: stable
18-
- ATOM_CHANNEL: beta
17+
- ATOM_CHANNEL: stable
18+
- ATOM_CHANNEL: beta
1919

2020
install:
2121
- ps: Install-Product node 4

lib/editor-store.js

+50-41
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,82 @@
1-
const SnippetHistoryProvider = require('./snippet-history-provider')
1+
const SnippetHistoryProvider = require('./snippet-history-provider');
22

33
class EditorStore {
4-
constructor (editor) {
5-
this.editor = editor
6-
this.buffer = this.editor.getBuffer()
7-
this.observer = null
8-
this.checkpoint = null
9-
this.expansions = []
10-
this.existingHistoryProvider = null
4+
constructor(editor) {
5+
this.editor = editor;
6+
this.buffer = this.editor.getBuffer();
7+
this.observer = null;
8+
this.checkpoint = null;
9+
this.expansions = [];
10+
this.existingHistoryProvider = null;
1111
}
1212

13-
getExpansions () {
14-
return this.expansions
13+
getExpansions() {
14+
return this.expansions;
1515
}
1616

17-
setExpansions (list) {
18-
this.expansions = list
17+
setExpansions(list) {
18+
this.expansions = list;
1919
}
2020

21-
clearExpansions () {
22-
this.expansions = []
21+
clearExpansions() {
22+
this.expansions = [];
2323
}
2424

25-
addExpansion (snippetExpansion) {
26-
this.expansions.push(snippetExpansion)
25+
addExpansion(snippetExpansion) {
26+
this.expansions.push(snippetExpansion);
2727
}
2828

29-
observeHistory (delegates) {
29+
observeHistory(delegates) {
3030
if (this.existingHistoryProvider == null) {
31-
this.existingHistoryProvider = this.buffer.historyProvider
31+
this.existingHistoryProvider = this.buffer.historyProvider;
3232
}
3333

34-
const newProvider = SnippetHistoryProvider(this.existingHistoryProvider, delegates)
35-
this.buffer.setHistoryProvider(newProvider)
34+
const newProvider = SnippetHistoryProvider(
35+
this.existingHistoryProvider,
36+
delegates
37+
);
38+
this.buffer.setHistoryProvider(newProvider);
3639
}
3740

38-
stopObservingHistory (editor) {
39-
if (this.existingHistoryProvider == null) { return }
40-
this.buffer.setHistoryProvider(this.existingHistoryProvider)
41-
this.existingHistoryProvider = null
41+
stopObservingHistory(editor) {
42+
if (this.existingHistoryProvider == null) {
43+
return;
44+
}
45+
this.buffer.setHistoryProvider(this.existingHistoryProvider);
46+
this.existingHistoryProvider = null;
4247
}
4348

44-
observe (callback) {
45-
if (this.observer != null) { this.observer.dispose() }
46-
this.observer = this.buffer.onDidChangeText(callback)
49+
observe(callback) {
50+
if (this.observer != null) {
51+
this.observer.dispose();
52+
}
53+
this.observer = this.buffer.onDidChangeText(callback);
4754
}
4855

49-
stopObserving () {
50-
if (this.observer == null) { return false }
51-
this.observer.dispose()
52-
this.observer = null
53-
return true
56+
stopObserving() {
57+
if (this.observer == null) {
58+
return false;
59+
}
60+
this.observer.dispose();
61+
this.observer = null;
62+
return true;
5463
}
5564

56-
makeCheckpoint () {
57-
const existing = this.checkpoint
65+
makeCheckpoint() {
66+
const existing = this.checkpoint;
5867
if (existing) {
59-
this.buffer.groupChangesSinceCheckpoint(existing)
68+
this.buffer.groupChangesSinceCheckpoint(existing);
6069
}
61-
this.checkpoint = this.buffer.createCheckpoint()
70+
this.checkpoint = this.buffer.createCheckpoint();
6271
}
6372
}
6473

65-
EditorStore.store = new WeakMap()
74+
EditorStore.store = new WeakMap();
6675
EditorStore.findOrCreate = function (editor) {
6776
if (!this.store.has(editor)) {
68-
this.store.set(editor, new EditorStore(editor))
77+
this.store.set(editor, new EditorStore(editor));
6978
}
70-
return this.store.get(editor)
71-
}
79+
return this.store.get(editor);
80+
};
7281

73-
module.exports = EditorStore
82+
module.exports = EditorStore;

lib/helpers.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/** @babel */
22

3-
import path from 'path'
3+
import path from 'path';
44

55
export function getPackageRoot() {
6-
const {resourcePath} = atom.getLoadSettings()
7-
const currentFileWasRequiredFromSnapshot = !path.isAbsolute(__dirname)
6+
const { resourcePath } = atom.getLoadSettings();
7+
const currentFileWasRequiredFromSnapshot = !path.isAbsolute(__dirname);
88
if (currentFileWasRequiredFromSnapshot) {
9-
return path.join(resourcePath, 'node_modules', 'snippets')
9+
return path.join(resourcePath, 'node_modules', 'snippets');
1010
} else {
11-
return path.resolve(__dirname, '..')
11+
return path.resolve(__dirname, '..');
1212
}
1313
}

0 commit comments

Comments
 (0)