ace-linters 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Globals.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare module "*.css";
2
+ declare module "*.module.scss";
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Ace Linters
2
+
3
+ Ace linters is a library that brings language-aware features to the Ace editor. It includes a number of language services, each of which provides support for a specific language, such as JSON, HTML, CSS, and Typescript.
4
+
5
+ ## Features
6
+
7
+ With Ace linters, you can easily add the following language-aware features to your Ace editor:
8
+ - Error checking
9
+ - Code completion
10
+ - Type checking
11
+ - Code formatting
12
+ - Additional information about token on hover
13
+
14
+ ## Supported languages
15
+
16
+ Ace linters supports the following languages:
17
+ - JSON, JSON5 (with JsonService)
18
+ - HTML (with HtmlService)
19
+ - CSS, SCSS, LESS (with CssService)
20
+ - Typescript, Javascript, JSX, TSX (with TypescriptService)
21
+
22
+ ## Installation
23
+
24
+ To install Ace linters, you can use the following command:
25
+
26
+ ```bash
27
+ npm install ace-linters
28
+
29
+ ## Usage
30
+
31
+ To use Ace linters, you will first need to include it in your project and create an instance of the Ace editor and an instance of LanguageProvider. Then, LanguageProvider will use the appropriate language service based on the mode being used:
32
+ ```javascript
33
+ import * as ace from "ace-code";
34
+ import {Mode as TypescriptMode} from "ace-code/src/mode/typescript";
35
+ import {registerStyles, LanguageProvider, setLanguageGlobalOptions, AceLinters} from "ace-linters";
36
+ import { ScriptTarget, JsxEmit } from "ace-linters/type-converters/typescript-converters";
37
+
38
+ //provides better styles for hover tooltip
39
+ registerStyles();
40
+ // set global options for Typescript Service, if haven't called,
41
+ // would use default instead
42
+ setLanguageGlobalOptions("typescript", {
43
+ compilerOptions: {
44
+ allowJs: true,
45
+ target: ScriptTarget.ESNext,
46
+ jsx: JsxEmit.Preserve
47
+ }
48
+ });
49
+
50
+ let editor = ace.edit("container");
51
+ editor.session.setMode(new TypescriptMode());
52
+ // Create Language Provider (you could pass options as second parameter)
53
+ let provider = new LanguageProvider(editor, {});
54
+ ```
55
+
56
+ Once you have created a language provider, you can use the Ace editor as you normally would, and the language-aware features provided by the service will be available.
57
+
58
+ ## License
59
+ Ace linters is released under the [MIT License](https://opensource.org/licenses/MIT).