ESLint plugin providing custom rules for JavaScript Standard Style linting
Overall
score
36%
Evaluation — 36%
↓ 0.58xAgent success when using this tile
Create a tiny linting helper that checks spacing inside arrays and objects. Outer collections should use a single space of padding for primitive or mixed values, but when a collection directly wraps another array/object or a single-element array it should tighten spacing around that nested value to avoid double padding. The helper returns a concise report of spacing violations.
[1,2] reports a spacing violation on the outer brackets when padding is missing. @test[{ a: 1 },[2]] passes when outer brackets brace tightly around nested arrays/objects or single-element arrays while still keeping spacing inside the nested structures themselves. @testerrorCount and an ordered messages array with line and column numbers for each spacing issue. @test@generates
/**
* Lints JavaScript source for bracket/brace spacing with nested exceptions.
* @param {string} source - JavaScript source to lint.
* @returns {{ errorCount: number, messages: Array<{ ruleId: string, line: number, column: number }> }}
*/
function lintSpacing(source);Provides even-spacing lint rules with nested structure exceptions.