CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-snazzy

Format JavaScript Standard Style as Stylish (i.e. snazzy) output

94

1.18x
Overview
Eval results
Files

task.mdevals/scenario-2/

Linter Results Processor

Build a tool that processes structured linter output data and generates summary statistics. The tool should parse JSON input containing linter results and calculate key metrics about the findings.

Capabilities

Parse and normalize linter data

  • Given JSON input with an array of file results, parse it successfully @test
  • Given a result with filePath: "src/app.js" and messages: [{line: 10, column: 5, message: "Error", ruleId: "no-unused"}], extract all fields correctly @test
  • Given a message with missing line field, default it to 0 @test
  • Given a message with missing column field, default it to 0 @test
  • Given a message with missing ruleId field, default it to empty string @test

Calculate statistics

  • Given input with 3 messages across 2 files, return total count of 3 @test
  • Given input with 2 files having messages and 1 file with empty messages array, count 3 total files @test
  • Given input [{filePath: "a.js", messages: []}, {filePath: "b.js", messages: [{line: 1}]}], output "1 problem in 2 files" @test

Implementation

@generates

API

/**
 * Processes linter JSON data and returns statistics
 *
 * @param {string} jsonInput - JSON string with linter results
 * @returns {Object} Object with { problemCount: number, fileCount: number, summary: string }
 */
function processLinterData(jsonInput) {
  // Implementation
}

module.exports = {
  processLinterData
};

Dependencies { .dependencies }

snazzy { .dependency }

Provides utilities for parsing and normalizing linter output data.

Install with Tessl CLI

npx tessl i tessl/npm-snazzy

tile.json