Description
1. Summary
I want to use 1 tab indentation in my CoffeeScript files, but coffeelint.json
schema check that it’s non-valid. It would be nice if the schema will support indentation with 1 tab.
2. MCVE
2.1. Files
KiraCoffee.coffee
with 1 tab indentation:
kira = (goddess) ->
console.log goddess
coffeelint.json
:
{
"indentation": {
"value": 1
},
"no_spaces": {
"level": "error"
},
"no_tabs": {
"level": "ignore"
}
}
As CoffeeLint documentation said:
no_spaces
— “This rule forbids spaces in indentation. It is disabled by default.”no_tabs
— “This rule forbids tabs in indentation. Enough said. It is enabled by default.”
I have to use both options for using tabs in my .coffee
files.
2.2. CoffeeLint command
D:\SashaDebugging\KiraCoffeelintSchema>coffeelint KiraCoffee.coffee
✓ KiraCoffee.coffee
✓ Ok! » 0 errors and 0 warnings in 1 file
I can’t remove the indentation
key from coffeelint.json
. If:
{
- "indentation": {
- "value": 1
- },
"no_spaces": {
"level": "error"
},
"no_tabs": {
"level": "ignore"
}
}
I get the error:
D:\SashaDebugging\KiraCoffeelintSchema>coffeelint KiraCoffee.coffee
✗ KiraCoffee.coffee
✗ #2-2: Line contains inconsistent indentation. (indentation) Expected 2 got 1.
✗ Lint! » 1 error and 0 warnings in 1 file
2.3. v8r command
I validate my coffeelint.json
via v8r:
D:\SashaDebugging\KiraCoffeelintSchema>v8r coffeelint.json
ℹ No config file found
ℹ Processing .\coffeelint.json
ℹ Found schema in https://www.schemastore.org/api/json/catalog.json …
ℹ Validating .\coffeelint.json against schema from https://json.schemastore.org/coffeelint.json …
✖ .\coffeelint.json is invalid
.\coffeelint.json#/indentation/value must be equal to one of the allowed values
"indentation": {"value": 1},
isn’t valid in the current version of coffeelint.json
. According to coffeelint.json
schema, available values is 2
and 4
.
3. Desired behavior
Indentation with 1 tab is standard for programming languages. I can’t find that CoffeeScript and/or CoffeeLint disallow it. I think it would be nice if coffeelint.json
schema will support this behavior:
- If user use indentation with tabs (
"no_spaces": {"level": "error"}, "no_tabs": {"level": "ignore"}
), available values for theindentation
key will be1
and2
. I don’t think that indentation with 4 tabs is good. - Else user use indentation with spaces (
"no_spaces": {"level": "ignore"}, "no_tabs": {"level": "error"}
), available values for theindentation
key will be2
and4
as now. I don’t think that indentation with 1 space is good.
Thanks.