linter

linter is a cursor rule for Cursor from sunra-ai/sunra-clients. It costs 0 tokens per session (1,081 once invoked), scanned A, original, Apache-2.0.

A set of code-formatting and linting rules for keeping source files consistent and catching common mistakes. Linting is automated checking that finds style problems and some likely coding errors.

In plain words
What is it for?
Use it to configure or guide automated formatting and lint checks for JavaScript, TypeScript, Python, Java, Kotlin, and other supported code.
Why use it?
It gives a project shared standards for spacing, line length, imports, and language-specific checks instead of leaving style decisions to each contributor.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sunra-ai/sunra-clients/linter
Clone the repo
git clone --depth 1 https://github.com/sunra-ai/sunra-clients

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for linter

README.md
[![agentmods](https://agentmods.dev/badge/rules/sunra-ai/sunra-clients/linter.svg)](https://agentmods.dev/rules/sunra-ai/sunra-clients/linter)
Your own site
<a href="https://agentmods.dev/rules/sunra-ai/sunra-clients/linter"><img src="https://agentmods.dev/badge/rules/sunra-ai/sunra-clients/linter.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,081 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01081
Opus 5 $0.00000 $0.00541
Sonnet 5 $0.00000 $0.00216
Haiku 4.5 $0.00000 $0.00108

Measured yesterday against content hash 7da370c6ac99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

linter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/roles/linter.mdc · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Formatting and Linting Rules

General Principles

  • Consistency: Maintain consistent code style across all files in the project
  • Readability: Prioritize code readability and maintainability
  • Best Practices: Follow language-specific best practices and conventions
  • Automation: Use automated tools to enforce formatting and catch common issues

Line Length and Formatting

  • Maximum line length: 120 characters for all languages
  • No multiple consecutive blank lines: Maximum of 1 blank line between code blocks
  • Trailing whitespace: Remove all trailing whitespace
  • Indentation: Use consistent indentation (2 spaces for JS/TS, 4 spaces for Python, 2 spaces for Java/Kotlin)

Python Specific Rules

Tools

  • Use ruff for both linting and formatting
  • Configuration is in pyproject.toml under [tool.ruff]

Linting Rules

  • A: flake8-builtins - Avoid shadowing Python built-ins
  • B: flake8-bugbear - Catch common bugs and design problems
  • C4: flake8-comprehensions - Improve list/dict/set comprehensions
  • E: pycodestyle errors - Style guide enforcement
  • F: Pyflakes - Catch undefined names and imports
  • I: isort - Sort imports consistently
  • UP: pyupgrade - Upgrade syntax for newer Python versions

Type Hints

  • Use modern union syntax T | None instead of Optional[T] when possible
  • Always include type hints for function parameters and return values
  • Use from __future__ import annotations for forward references

Naming Conventions

  • Functions and variables: snake_case
  • Classes: PascalCase
  • Constants: UPPER_SNAKE_CASE
  • Avoid single-letter variable names except for short loops

Commands

  • Format: ruff format . or make format
  • Lint: ruff check . or make lint
  • Auto-fix: ruff check --fix .

JavaScript/TypeScript Rules

Tools

  • Use ESLint for linting
  • Use Prettier for formatting (if configured)
  • Follow the project's ESLint configuration

General Rules

  • Use const by default, let when reassignment is needed
  • Prefer arrow functions for callbacks
  • Use template literals for string interpolation
  • Don't use semicolons when possible
  • Prefer === over ==

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 151 lines · 0 tokens per session scan A 7da370c6ac99

Subscribe to this mod's changes

linter is a cursor rule published in the GitHub repository sunra-ai/sunra-clients (7 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,081 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.