|
1 | | -# Lightning Blits VS Code extension |
| 1 | +# Blits Development Tools |
2 | 2 |
|
3 | | -This is the official VSCode extension for the Lightning Blits framework. |
| 3 | +This repo contains official development tools for the [Lightning Blits](https://lightningjs.io/) framework, mainly the Lightning Blits VSCode extension and support packages for linting and formatting. |
4 | 4 |
|
5 | | -Blits is a **lightweight, high-performance frontend framework** for **Lightning 3 applications**. This VSCode extension enhances the development experience by providing **rich language support** for Blits templates, components, and the `.blits` file format. |
| 5 | +## Packages |
6 | 6 |
|
7 | | -## Usage |
| 7 | +### [VSCode Extension](./vscode-extension) |
8 | 8 |
|
9 | | -Once installed, the extension will automatically detect and provide **language support** for: |
10 | | -- `.blits` files. |
11 | | -- Blits templates inside JavaScript and TypeScript files in Blits apps. |
| 9 | +The official VSCode extension for Lightning Blits provides essential IDE features for developing Blits applications: |
12 | 10 |
|
13 | | -### **Commands & Shortcuts** |
| 11 | +- Template syntax highlighting for `.blits` files and template strings |
| 12 | +- Code completion for components and attributes |
| 13 | +- IntelliSense for Blits APIs |
14 | 14 |
|
15 | | -- **Toggle Comment** (`Ctrl + /` / `Cmd + /` on Mac): Comment/uncomment Blits template sections. |
| 15 | +### [ESLint Plugin](./eslint-plugin-blits) |
16 | 16 |
|
17 | | -## Features |
| 17 | +ESLint plugin for Blits framework applications: |
| 18 | +- Linting support for `.blits` files |
| 19 | +- Analysis for JS/TS template literals |
| 20 | +- Custom rules optimized for Blits development |
18 | 21 |
|
19 | | -### **1. Syntax Highlighting** |
| 22 | +### [Prettier Plugin](./prettier-plugin-blits) |
20 | 23 |
|
21 | | -- Full support for Blits template syntax inside JavaScript and TypeScript files. |
22 | | -- Dedicated syntax highlighting for `.blits` files, including **script and template sections**. |
| 24 | +Prettier formatting plugin for Blits templates: |
| 25 | +- Consistent formatting for `.blits` files |
| 26 | +- Template string formatting in JS/TS files |
| 27 | +- Configurable formatting options |
23 | 28 |
|
24 | | -### **2. Code Completion (IntelliSense)** |
25 | | - |
26 | | -- Auto-suggestions for Blits **component names, attributes, and built-in directives**. |
27 | | -- Supports both built-in and custom components inside **template strings and `.blits` files**. |
28 | | -- Provides **context-aware** suggestions based on cursor position. |
29 | | - |
30 | | -### **3. Commenting Support** |
31 | | - |
32 | | -- Enables **HTML-style commenting/uncommenting** for template sections. |
33 | | -- Uses `<!-- -->` for templates and `//` for script sections. |
34 | | - |
35 | | -### **4. Custom `.blits` File Support** |
36 | | - |
37 | | -- Full **language support** for `.blits` files: |
38 | | - - **Syntax highlighting** |
39 | | - - **IntelliSense** for template and script sections |
40 | | - - **Signature help** for component methods |
41 | | - - **Hover information** for component props and attributes |
42 | | - - **Error diagnostics** for template syntax |
43 | | - |
44 | | -### **5. Code Snippets** |
45 | | - |
46 | | -Enhance your coding efficiency with built-in snippets for Blits development. These snippets provide templates for common structures and patterns in Blits applications, helping you write code more quickly and consistently across JavaScript, TypeScript, and `.blits` files. |
47 | | - |
48 | | -| Snippet Prefix | Description | |
49 | | -|----------------|-------------| |
50 | | -| `blits-file` | Creates a basic `.blits` file structure with template and script sections | |
51 | | -| `blits-component` | Scaffolds a complete Blits component structure in JS/TS files | |
52 | | -| `blits-input` | Adds customizable input handler methods with selectable key options | |
53 | | -| `blits-input-block` | Inserts a complete input object with handlers for all common keys | |
54 | | -| `blits-hooks` | Adds individual lifecycle hook methods with method selection | |
55 | | -| `blits-hooks-block` | Inserts all major lifecycle hooks at once (init, ready, focus, unfocus, destroy) | |
56 | | -| `blits-attribute-transition` | Creates attribute transition syntax for animations in template strings | |
57 | | - |
58 | | -### **6. Code Formatting** |
59 | | - |
60 | | -- Automatic formatting of **Blits template strings** inside JS/TS files. |
61 | | -- Auto-formats **entire `.blits` files on save**. |
62 | | -- Configurable **Prettier-based** formatting settings. |
63 | | - |
64 | | -You can disable the auto-formatting feature by setting the `blits.autoFormat` configuration option to `false`. |
65 | | - |
66 | | -#### Available Settings |
67 | | - |
68 | | -The extension provides several configuration options to customize the formatting experience: |
69 | | - |
70 | | -| Setting | Default | Description | |
71 | | -|---------|---------|-------------| |
72 | | -| `blits.format.printWidth` | `120` | The line length that the printer will wrap on | |
73 | | -| `blits.format.tabWidth` | `2` | Indentation size | |
74 | | -| `blits.format.useTabs` | `false` | When `true`, indents with tabs instead of spaces | |
75 | | -| `blits.format.semi` | `false` | Print semicolons at the ends of statements | |
76 | | -| `blits.format.singleQuote` | `true` | Use single quotes instead of double quotes | |
77 | | -| `blits.format.quoteProps` | `as-needed` | Controls when to quote object properties:<br>• `as-needed`: Only when required<br>• `consistent`: If any property requires quotes<br>• `preserve`: Respects original formatting | |
78 | | -| `blits.format.trailingComma` | `all` | Controls trailing commas:<br>• `all`: Add wherever possible<br>• `none`: Remove all trailing commas<br>• `es5`: Add except in function parameters | |
79 | | -| `blits.format.bracketSpacing` | `true` | Print spaces between brackets in object literals | |
80 | | -| `blits.format.bracketSameLine` | `false` | Put the `>` of a multi-line tag at the end of the last line | |
81 | | - |
82 | | -#### Customizing Settings |
83 | | - |
84 | | -To customize these settings: |
85 | | - |
86 | | -1. Open VSCode settings (File > Preferences > Settings or `Ctrl+,` / `Cmd+,` on Mac) |
87 | | -2. Search for `Blits` to find all relevant settings |
88 | | -3. Modify as needed - changes will be applied immediately |
89 | | - |
90 | | -You can also edit the `.vscode/settings.json` file directly to configure these options. |
91 | | - |
92 | | -## Feedback & Contributions |
93 | | - |
94 | | -This extension is **open-source**. If you encounter issues or have feature requests, please visit the [GitHub Repository](https://github.com/lightning-js/blits-vscode-extension) and submit an issue or contribute to the codebase. |
95 | | - |
96 | | ---- |
97 | | - |
98 | | -**Enhance your Blits development experience today! 🚀** |
0 commit comments