Profiles & stacks

A rule written for React is wrong on a NestJS service. A profile is the set of rule sets that fit one kind of repository, so each repository only gets rules that apply to it.

Why profiles exist

React's rules about effects and rendering make no sense on a backend service. Fire them there and every finding is noise, and people learn to skip findings. The problem is that both a React component and a NestJS controller are .tsx or .ts files, so a file pattern alone cannot tell them apart.

Redline makes that choice once per repository instead of once per file. The repository picks a profile, and only that profile's rules are installed.

Stacks and profiles

TermWhat it isExample
StackOne rule set for a language, framework or platform. Each says which files it applies to with a glob. Redline has 20.react, applies to **/*.tsx and **/*.jsx, among others
ProfileA named list of stacks that belong together for one kind of repository.web-react = javascript · typescript · react

The core standard applies to every profile and is not listed. Within one repository the installed stacks never contradict each other, so a plain glob is enough to say which rules apply to which file.

The profiles

ProfileStacks
javascript-typescriptjavascript · typescript (no framework: CLIs, libraries, scripts)
web-reactjavascript · typescript · react
web-nextjsjavascript · typescript · react · nextjs (Next.js App Router)
web-angularjavascript · typescript · angular
web-vuejavascript · typescript · vue
web-sveltejavascript · typescript · svelte (Svelte and SvelteKit)
javascript-typescript-browserjavascript · typescript · dom (browser code with no framework)
mobile-react-nativejavascript · typescript · react · react-native
mobile-androidkotlin
mobile-iosswift
service-javamicroservices · java (Spring Boot)
service-gomicroservices · go
service-nodejavascript · typescript · microservices · nodejs (NestJS)
service-expressjavascript · typescript · microservices · express
service-pythonmicroservices · python
service-dotnetmicroservices · csharp
infra-terraformterraform (Terraform / HCL)
fullstack-react-nodejavascript · typescript · react · microservices · nodejs
typescript-effecteffect (added on top of another profile)

mobile-react-native installs both React and React Native on purpose: the React Native rules extend the React ones, and each file says so.

How a profile is chosen

pnpm redline init proposes a profile from the files and dependencies in the checkout, and you can accept it or name another. Detection tries the more specific frameworks first:

  • Next.js before React. Every Next.js app also depends on React, so checking React first would review a Next.js codebase with nothing covering Server Actions, the client boundary or NEXT_PUBLIC_.
  • Express after every web framework. Many front-end repositories list Express as a dev dependency for a dev server or mock API. A React app with an Express dev server is still a React app. A NestJS service stays service-node, because the Express rules say they do not apply to Nest.
  • Effect is added, not chosen. A repository that depends on effect gets typescript-effect on top of whatever else it is.
  • javascript-typescript-browser is never proposed. Plain browser JavaScript looks the same as a build script from the outside, and guessing wrong would install DOM rules where there is no DOM. Choose it yourself.

Choosing or combining profiles

Name a profile to override detection. A repository that is two kinds of code at once names several, separated by commas, and gets every stack from each:

terminal
$ pnpm redline init --profile javascript-typescript-browser
# a React app with its own Terraform beside it
$ pnpm redline init --profile web-react,infra-terraform

The choice is recorded in .redline.json and kept on every later init. The list is stored sorted, so the order you type it in never changes the result.

Names and aliases

Profiles are named <kind>-<technology> in full words: web-react, service-go, infra-terraform. With no framework, the name lists the languages and platform the rules cover: javascript-typescript, javascript-typescript-browser.

Short and older names such as web, node, infra and tooling still work anywhere a profile is named. They resolve to the full name, and the repository is recorded under that name on its next init or sync. The full list is profileAliases in standards/manifest.json.

Files no stack covers

Shell scripts, Dockerfiles and Gherkin have no stack on purpose: a linter serves them better than a model review. When a change touches a file no installed stack matches, local review says so and applies only the core rules to it:

terminal
$ pnpm redline review --staged

warn  no stack covers 1 changed file(s), so only the core rules applied to them: run.sh

Learn step 02 runs a review bounded to your profile.