CtrlK
BlogDocsLog inGet started
Tessl Logo

simon/skills

Auto-generated tile from GitHub (10 skills)

92

1.16x
Quality

94%

Does it follow best practices?

Impact

92%

1.16x

Average score across 44 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-28/

Add Linting to the Inventory Service

Problem/Feature Description

The inventory service is a small Node.js library that's been growing fast. There are now several contributors and nobody agrees on indentation, semicolons, or spacing conventions. Code review is full of style comments that slow down meaningful feedback, and a couple of subtle bugs slipped through recently that a linter would have caught.

The team lead has decided it's time to add proper linting. They want a modern ESLint setup that enforces Standard-like code style as a baseline, with optional TypeScript support. The project has both .js and .ts source files, and already has a .gitignore so the team is particular about not linting build artifacts and node_modules.

Your task is to add linting to the project by creating the configuration and updating the project metadata so that any contributor can run linting with a single command.

Output Specification

Produce the following files in your working directory, starting from the provided project skeleton:

  • package.json — updated with linting devDependencies and lint scripts
  • eslint.config.js — the ESLint configuration file
  • setup-lint.sh — a short shell script that installs dependencies and verifies the linter runs without crashing (i.e. npx eslint . exits 0 or only reports lint violations, not config errors)

The shell script should be executable and should work from a fresh environment where npm install has not yet been run.

Input Files

The following files are provided as inputs. Extract them before beginning.

=============== FILE: package.json =============== { "name": "inventory-service", "version": "1.0.0", "description": "A Node.js inventory management library", "main": "index.js", "type": "module", "scripts": { "test": "node --test" }, "devDependencies": {} }

=============== FILE: index.js =============== export function getItem(id) { return { id, name: 'Widget', stock: 42 } }

export function updateStock(id,qty) { if(qty < 0) throw new Error('negative stock') return { id, qty } }

=============== FILE: index.ts =============== export interface Item { id: string name: string stock: number }

export function getItem(id: string): Item { return { id, name: 'Widget', stock: 42 } }

=============== FILE: .gitignore =============== node_modules/ dist/ coverage/ *.log

evals

README.md

tile.json