Skip to content

Commit aa64129

Browse files
committed
Edit readme
1 parent cf10a53 commit aa64129

File tree

2 files changed

+57
-4
lines changed

2 files changed

+57
-4
lines changed

README.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,58 @@
11
# Modern JavaScript Snippets ⚡
22

3-
*Work in progress*
3+
> Short and memorable JavaScript & TypeScript snippets for the modern-day developer.
4+
5+
🚧 *Work in progress*
46

57
---
8+
![JavaScript](https://img.shields.io/badge/javascript-%23F7DF1C.svg?style=for-the-badge&logo=javascript&logoColor=%23323330)
9+
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
10+
11+
12+
13+
## Support
14+
Only JavaScript and TypeScript will be supported.
15+
Specific frameworks will get their own extensions. No bloat.
16+
17+
Supported file extensions:
18+
- `.js`
19+
- `.ts`
20+
- `.jsx`
21+
- `.tsx`
22+
23+
24+
## Setup
25+
The following is not mandatory, but provides a nicer experience.
26+
27+
Search for `editor.snippetSuggestions` and `editor.snippetSuggestions` in user settings, or edit the settings.json directly:
28+
```json
29+
// Show snippet suggestions on top of other suggestions.
30+
"editor.snippetSuggestions": "top",
31+
32+
// Tab complete will insert the best matching suggestion when pressing tab.
33+
"editor.snippetSuggestions": "on"
34+
```
35+
36+
## Style
37+
All code snippets are without semicolons (`;`).
38+
39+
You can use these snippets along with Prettier/ESLint to have your code automatically formatted to your preference.
40+
41+
## Snippet syntax
42+
43+
### Tabstops
44+
- With tabstops you can make the editor cursor move inside a snippet
45+
- `$1`, `$2`, `$3` specify cursor locations, in order in which tabstops will be visited
46+
- `$0` denotes the final cursor position
47+
- Multiple occurrences of the same tabstop are linked and updated in sync
48+
49+
### Placeholders
50+
- Placeholders are tabstops with values, such as `${1:name}`
51+
- Placeholder text will be inserted and selected such that it can be easily changed
52+
- Can be nested, like `${1:another ${2:placeholder}}`.
53+
54+
55+
## Snippets
656

757
### Declarations
858

@@ -111,7 +161,7 @@ const ${1:name} = ($2) => {$0}
111161

112162
#### `enfn`   -   export named arrow function
113163
```js
114-
const ${1:name} = ($2) => {$0}
164+
export const ${1:name} = ($2) => {$0}
115165
```
116166

117167
#### `af`   -   arrow function
@@ -142,7 +192,7 @@ console.log($0)
142192

143193
#### `clm`   -   console.log message
144194
```js
145-
console.log($0)
195+
console.log('$0')
146196
```
147197

148198
#### `clo`   -   console.log object
@@ -179,3 +229,5 @@ console.error('$1 ->', ${2:$1})
179229
```js
180230
console.warn('$1 ->', ${2:$1})
181231
```
232+
233+
*...and many more (evertyhing will be documented)*

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"description": "Code snippets for modern JavaScript & TypeScript ⚡",
66
"license": "MIT",
77
"categories": [
8-
"Snippets"
8+
"Snippets",
9+
"Programming Languages"
910
],
1011
"scripts": {
1112
"publish": "vsce package && vsce publish"

0 commit comments

Comments
 (0)