CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-eslint-plugin-standard

ESLint plugin providing custom rules for JavaScript Standard Style linting

Overall
score

36%

Evaluation36%

0.58x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-4/

Computed Bracket Spacing Linter

Build a lint helper that checks JavaScript/TypeScript source for consistent spacing inside computed property brackets using the dependency's computed property spacing rule. The helper should default to the rule's "even" spacing mode, while allowing callers to switch to "always" or "never" spacing when needed.

Capabilities

Enforces even spacing for members

  • Given source const title = record[ 'name' ] in default mode, linting reports errorCount 1 with the message Expected 1 or 0 spaces around "[" and "]". @test
  • Given source const title = record['name'] in default mode, linting reports errorCount 0. @test

Validates multiline and symmetry

  • When brackets for a computed property span multiple lines (e.g., obj[\nkey]), linting reports errorCount 1 with the message Expected "[" and "]" to be on the same line. @test

Supports selectable spacing modes

  • With mode 'always', linting const x = data[foo] reports two spacing errors that indicate a required space after [ and before ]. @test
  • With mode 'never', linting const obj = { [ key ]: 1 } reports two spacing errors that indicate spaces are disallowed after [ and before ], including for computed keys in object literals. @test

Implementation

@generates

API

export type SpacingMode = 'even' | 'always' | 'never';

export interface LintMessage {
  line: number;
  column: number;
  message: string;
}

export interface LintResult {
  errorCount: number;
  messages: LintMessage[];
}

/**
 * Lints a source string for computed property bracket spacing using the provided ESLint plugin rule.
 * @param source JavaScript or TypeScript module contents.
 * @param mode Spacing mode to apply; defaults to 'even'.
 * @returns A lint result containing only messages from the computed property spacing rule.
 */
export async function lintComputedSpacing(source: string, mode?: SpacingMode): Promise<LintResult>;

Dependencies { .dependencies }

eslint { .dependency }

Used to run linting against provided source.

eslint-plugin-standard { .dependency }

Provides the computed property bracket spacing rule.

Install with Tessl CLI

npx tessl i tessl/npm-eslint-plugin-standard@5.0.0
What are skills?

tile.json