|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-04/schema#", |
| 3 | + "id": "http://json.schemastore.org/stylua.json", |
| 4 | + "title": "Stylua Config", |
| 5 | + "description": "Configuration files for the Stylua formatter", |
| 6 | + "type": "object", |
| 7 | + "properties": { |
| 8 | + "syntax": { |
| 9 | + "description": "Specify a disambiguation for the style of Lua syntax being formatted.", |
| 10 | + "type": "string", |
| 11 | + "default": "All", |
| 12 | + "enum": ["All", "Lua51", "Lua52", "Lua53", "Lua54", "LuaJIT", "Luau"] |
| 13 | + }, |
| 14 | + "column_width": { |
| 15 | + "description": "Approximate line length for printing.\nUsed as a guide for line wrapping - this is not a hard requirement: lines may fall under or over the limit.", |
| 16 | + "type": "integer", |
| 17 | + "default": 120 |
| 18 | + }, |
| 19 | + "line_endings": { |
| 20 | + "description": "Line endings type.", |
| 21 | + "type": "string", |
| 22 | + "default": "Unix", |
| 23 | + "enum": ["Unix", "Windows"], |
| 24 | + "x-taplo": { |
| 25 | + "docs": { |
| 26 | + "enumValues": ["LF", "CRLF"] |
| 27 | + } |
| 28 | + } |
| 29 | + }, |
| 30 | + "indent_type": { |
| 31 | + "description": "Indent type.", |
| 32 | + "type": "string", |
| 33 | + "default": "Tabs", |
| 34 | + "enum": ["Tabs", "Spaces"] |
| 35 | + }, |
| 36 | + "indent_width": { |
| 37 | + "type": "integer", |
| 38 | + "default": 4, |
| 39 | + "description": "Character size of single indentation.\nIf indent_type is set to Tabs, this option is used as a heuristic to determine column width only." |
| 40 | + }, |
| 41 | + "quote_style": { |
| 42 | + "description": "Quote style for string literals.", |
| 43 | + "type": "string", |
| 44 | + "default": "AutoPreferDouble", |
| 45 | + "enum": [ |
| 46 | + "AutoPreferDouble", |
| 47 | + "AutoPreferSingle", |
| 48 | + "ForceDouble", |
| 49 | + "ForceSingle" |
| 50 | + ], |
| 51 | + "x-taplo": { |
| 52 | + "docs": { |
| 53 | + "enumValues": [ |
| 54 | + "Prefer double, but fallback to single if it has fewer escapes.", |
| 55 | + "Prefer single, but fallback to double if it has fewer escapes.", |
| 56 | + "Force double quotes regardless of escapes.", |
| 57 | + "Force single quotes regardless of escapes." |
| 58 | + ] |
| 59 | + } |
| 60 | + } |
| 61 | + }, |
| 62 | + "call_parentheses": { |
| 63 | + "description": "Whether parentheses should be applied on function calls with a single string/table argument.", |
| 64 | + "type": "string", |
| 65 | + "default": "Always", |
| 66 | + "enum": ["Always", "NoSingleString", "NoSingleTable", "None", "Input"], |
| 67 | + "x-taplo": { |
| 68 | + "docs": { |
| 69 | + "enumValues": [ |
| 70 | + "Applies parentheses in all cases.", |
| 71 | + "Omits parentheses on calls with a single string argument.", |
| 72 | + "Omits parentheses on calls with a single table argument.", |
| 73 | + "Omits parentheses in both cases.\nNote: parentheses are still kept in situations where removal can lead to obscurity (e.g. foo \"bar\".setup -> foo(\"bar\").setup, since the index is on the call result, not the string).", |
| 74 | + "Removes all automation and preserves parentheses only if they were present in input code: consistency is not enforced." |
| 75 | + ] |
| 76 | + } |
| 77 | + } |
| 78 | + }, |
| 79 | + "space_after_function_names": { |
| 80 | + "type": "string", |
| 81 | + "description": "Specify whether to add a space between the function name and parentheses.", |
| 82 | + "default": "Never", |
| 83 | + "enum": ["Never", "Definitions", "Calls", "Always"] |
| 84 | + }, |
| 85 | + "collapse_simple_statement": { |
| 86 | + "default": "Never", |
| 87 | + "description": "Specify whether to collapse simple statements.", |
| 88 | + "type": "string", |
| 89 | + "enum": ["Never", "FunctionOnly", "ConditionalOnly", "Always"] |
| 90 | + }, |
| 91 | + "sort_requires": { |
| 92 | + "type": "object", |
| 93 | + "description": "StyLua has built-in support for sorting require statements. We group consecutive require statements into a single \"block\", and then requires are sorted only within that block. Blocks of requires do not move around the file.\n\nStyLua only considers requires of the form local NAME = require(EXPR), and sorts lexicographically based on NAME. (StyLua can also sort Roblox services of the form local NAME = game:GetService(EXPR))\n\nRequires sorting is off by default.", |
| 94 | + "properties": { |
| 95 | + "enabled": { |
| 96 | + "type": "boolean", |
| 97 | + "default": false |
| 98 | + } |
| 99 | + }, |
| 100 | + "x-taplo": { |
| 101 | + "initKeys": ["enabled"] |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | +} |
0 commit comments