liveBook · Manning

Linter rule

Also called linting rule, custom rules

A linter rule is a condition or constraint that a linter checks against code or another structured artifact to detect or report patterns or violations.

How 6 Manning books explain it

The Design of Web APIs, Second Edition

A linting rule is a statically evaluated constraint that detects or enforces a specified pattern in an API description or other structured artifact.

How it is used
Automates API design guidelines by finding design and OpenAPI authoring problems in API descriptions.
How deep it goes
Develops rules through purpose, targeting, checks, feedback, organization, and local customization, while acknowledging design judgments beyond linting.
Examples
Uses camel-cased query parameters, search pagination, shared error responses, and a faulty semantic version as concrete checks.
What you can do after
Build it from scratch in Spectral, test its target, provide actionable feedback, and adapt shared rules to an API.

Read how The Design of Web APIs, Second Edition explains linter rule →

Automating API Delivery

A custom linting rule is a user-defined validation rule that specifies where and how an API definition is checked.

How it is used
Checks static API definitions against executable API style-guide guidelines during design and CI/CD.
How deep it goes
Works through Spectral selectors, validation functions, severity, CLI testing, and custom-function escalation; leaves semantic judgment beyond simple rules.
Examples
Uses a missing `info.description`, versioned URI paths, and GET `operationId` naming conventions as rule targets.
What you can do after
Build it from scratch with Spectral selectors and functions, test violations, and apply organizational severity and pipeline policy.

Read how Automating API Delivery explains linter rule →

"Looks Good to Me"

A linting rule is a configured criterion that a linter applies to source code to detect a particular pattern or violation.

How it is used
Uses configured checks to automate team style and catch code concerns before review.
How deep it goes
Defines rule scope, granularity, and severity with practical configurations, but does not explain linter internals.
Examples
Uses Stroustrup braces, no-var, duplicate-import, equality, console, and unnecessary-ternary checks as concrete examples.
What you can do after
Apply it via ESLint to enforce selected checks, tune warning or error severity, and reduce recurring review issues.

Read how "Looks Good to Me" explains linter rule →

Secrets of the JavaScript Ninja, Third Edition

A configurable static-analysis condition that determines when a linter reports a source-code construct.

How it is used
Uses configurable rules to catch potential errors and enforce consistent coding style.
How deep it goes
Explains rule effects through code examples, project configuration, and inline exceptions.
Examples
Uses unreachable code, shadowing, non-null assertions, and comment capitalization as rule examples.
What you can do after
Configure ESLint rules at project or line level, or rewrite code to satisfy them.

Read how Secrets of the JavaScript Ninja, Third Edition explains linter rule →

Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu

A linter rule is a configurable static-analysis check that specifies a condition source or configuration must satisfy.

How it is used
Applies static checks to Terraform configuration during quality and continuous-integration workflows.
How deep it goes
Explains rule selection, plugin configuration, diagnostics, disabling, and inline exceptions, but not rule implementation internals.
Examples
Uses Terraform plugin presets, required_version and unused-provider diagnostics, cloud plugins, Makefile commands, and inline ignore comments.
What you can do after
Operate TFLint by enabling plugins, selecting presets, interpreting findings, customizing rules, and recording narrow exceptions.

Read how Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu explains linter rule →

Essential TypeScript 5, Third Edition

A linting rule is a configurable condition that determines whether a linter reports a particular source-code pattern or violation.

How it is used
Configures lint feedback so warnings remain relevant to project-wide standards and temporary debugging needs.
How deep it goes
Explains numeric configuration values and statement-level suppression, but does not detail rule implementation internals.
Examples
Uses prefer-const in .eslintrc and no-debugger with an eslint-disable-line comment.
What you can do after
Operate ESLint by enabling or disabling rules globally and suppressing selected violations on individual statements.

Read how Essential TypeScript 5, Third Edition explains linter rule →

Also covered in

What to know first

Related concepts

Questions about linter rule

What is linter rule?

A linter rule is a condition or constraint that a linter checks against code or another structured artifact to detect or report patterns or violations.

Which Manning books explain linter rule?

The Design of Web APIs, Second Edition, Automating API Delivery, "Looks Good to Me", Secrets of the JavaScript Ninja, Third Edition, Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu and Essential TypeScript 5, Third Edition.

What should I know before learning linter rule?

Manning books that teach linter rule usually introduce artificial intelligence, JavaScript, JSON Pointer and OpenAPI specification first.

What kinds of linter rule are there?

Kinds of linter rule include no-shadow.

What is linter rule part of?

Linter rule is part of ruleset. A ruleset is an organized collection of rules applied together to evaluate inputs, guide decisions, or govern behavior.

What is linter rule also called?

Linter rule is also called linting rule or custom rules.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.