File tree Expand file tree Collapse file tree 3 files changed +32
-30
lines changed Expand file tree Collapse file tree 3 files changed +32
-30
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,6 @@ void init();
193193[[noreturn]] void run (int argc, char **argv);
194194[[noreturn]] void run (Options o);
195195
196- Linter_Options get_linter_options_from_language (File_Language);
197-
198196void list_debug_apps ();
199197void run_lsp_server ();
200198
@@ -319,34 +317,6 @@ void run(Options o) {
319317 std::exit (EXIT_SUCCESS);
320318}
321319
322- Linter_Options get_linter_options_from_language (File_Language language) {
323- Linter_Options o;
324- switch (language) {
325- case File_Language::javascript:
326- o.jsx = false ;
327- o.typescript = false ;
328- break ;
329- case File_Language::javascript_jsx:
330- o.jsx = true ;
331- o.typescript = false ;
332- break ;
333- case File_Language::typescript:
334- o.jsx = false ;
335- o.typescript = true ;
336- break ;
337- case File_Language::typescript_definition:
338- o.jsx = false ;
339- o.typescript = true ;
340- o.typescript_definition = true ;
341- break ;
342- case File_Language::typescript_jsx:
343- o.jsx = true ;
344- o.typescript = true ;
345- break ;
346- }
347- return o;
348- }
349-
350320void list_debug_apps () {
351321 Monotonic_Allocator temporary_allocator (" list_debug_apps" );
352322
Original file line number Diff line number Diff line change @@ -23,6 +23,34 @@ bool operator!=(Linter_Options lhs, Linter_Options rhs) {
2323 return !(lhs == rhs);
2424}
2525
26+ Linter_Options get_linter_options_from_language (File_Language language) {
27+ Linter_Options o;
28+ switch (language) {
29+ case File_Language::javascript:
30+ o.jsx = false ;
31+ o.typescript = false ;
32+ break ;
33+ case File_Language::javascript_jsx:
34+ o.jsx = true ;
35+ o.typescript = false ;
36+ break ;
37+ case File_Language::typescript:
38+ o.jsx = false ;
39+ o.typescript = true ;
40+ break ;
41+ case File_Language::typescript_definition:
42+ o.jsx = false ;
43+ o.typescript = true ;
44+ o.typescript_definition = true ;
45+ break ;
46+ case File_Language::typescript_jsx:
47+ o.jsx = true ;
48+ o.typescript = true ;
49+ break ;
50+ }
51+ return o;
52+ }
53+
2654void parse_and_lint (Padded_String_View code, Diag_Reporter& reporter,
2755 const Global_Declared_Variable_Set& globals,
2856 Linter_Options options) {
Original file line number Diff line number Diff line change 33
44#pragma once
55
6+ #include < quick-lint-js/fe/language.h>
7+
68namespace quick_lint_js {
79class Diag_Reporter ;
810class Global_Declared_Variable_Set ;
@@ -29,6 +31,8 @@ struct Linter_Options {
2931 friend bool operator !=(Linter_Options, Linter_Options);
3032};
3133
34+ Linter_Options get_linter_options_from_language (File_Language);
35+
3236void parse_and_lint (Padded_String_View code, Diag_Reporter&,
3337 const Global_Declared_Variable_Set&, Linter_Options);
3438}
You can’t perform that action at this time.
0 commit comments