Code Quality Help

Linting and Formatting

Shared Configuration Packages

All libraries must use the company‑provided shared configurations for ESLint, Prettier, and Stylelint. These packages are versioned, distributed via the private npm registry, and ensure a consistent coding style across the whole front‑end ecosystem.

  • @company/eslint-config – base ESLint configuration with Angular, TypeScript, and RxJS rules.

  • @company/prettier-config – centralized Prettier settings.

  • @company/stylelint-config – Stylelint configuration for SCSS and CSS custom properties.

Each library extends these configurations in its local config files, avoiding divergent or ad‑hoc rule overrides.

ESLint

The ESLint setup enforces code quality, best practices, and strict typing conventions. The shared configuration (@company/eslint-config) includes the following plugins and rulesets:

  • @typescript-eslint: strict type‑aware rules.

  • @angular-eslint: component and template rules.

  • eslint-plugin-rxjs: appropriate operator usage.

  • eslint-plugin-import: ordered imports and no unresolved paths.

  • eslint-config-prettier: disables formatting rules that conflict with Prettier.

Core Rules (strictness)

  • @typescript-eslint/explicit-function-return-type: warn for public functions and methods; optional for internal helpers to avoid noise.

  • @typescript-eslint/consistent-type-assertions: enforce as Type syntax, disallow <Type> assertions.

  • @angular-eslint/no-input-rename: error – prevents renaming inputs (keeps API predictable).

  • @angular-eslint/no-output-rename: error.

  • @angular-eslint/use-lifecycle-interface: error.

  • @angular-eslint/no-empty-lifecycle-method: error.

  • @typescript-eslint/no-unused-vars: error (TypeScript variant), disallowing unused imports and variables.

  • @angular-eslint/prefer-signals: error

  • no-console: warn – console logs may be used during development but must be removed before merging.

Prettier

Prettier is the single source of truth for code formatting. The shared configuration @company/prettier-config defines:

{ "semi": true, "singleQuote": true, "trailingComma": "all", "printWidth": 100, "tabWidth": 2, "useTabs": false, "bracketSpacing": true, "arrowParens": "always", "endOfLine": "lf" }

All libraries add a .prettierrc.js that simply references the shared config:

Prettier runs automatically:

  • in the developer’s IDE (recommended setup via .vscode/extensions.json and settings).

  • as a pre‑commit hook.

  • in CI with prettier --check to ensure no unformatted files are merged.

Stylelint

Stylelint validates SCSS files and enforces the theming variable conventions. The shared configuration @company/stylelint-config includes:

  • stylelint-config-standard-scss as the baseline.

  • stylelint-order for consistent property ordering.

  • Custom rules that verify the two‑level variable cascade (global → component‑specific → default).

Mandatory Rules

  • declaration-no-important: error!important is banned. Exceptions require a comment and team approval.

Integration

  • Stylelint runs on all *.scss files.

  • In pre‑commit, stylelint --fix automatically corrects order violations where possible.

  • CI runs stylelint --max-warnings=0 and blocks the build on any error.

03 July 2026