azure-rest-api-specs/eng
James Suplizio 15b1bdb73e
Update CodeownersLinter for net6 to net8 update (#30612)
2024-09-18 08:16:53 -07:00
..
.vscode Add stub `specs-model` tool (#29820) 2024-07-16 06:06:31 +00:00
pipelines Update CodeownersLinter for net6 to net8 update (#30612) 2024-09-18 08:16:53 -07:00
scripts [TypeSpecValidation] Enable -All pipeline in RPSaaSMaster (#30328) 2024-08-26 18:03:57 -07:00
tools [dependency upgrade] prettier, typescript, vitest (#30421) 2024-09-04 11:16:39 -07:00
README.md Add stub `specs-model` tool (#29820) 2024-07-16 06:06:31 +00:00

README.md

eng directory

The eng directory contains source code for automated tooling running on this repository pull requests.

For context on this directory, see Design guidelines for spec repos validation tooling (Microsoft-internal).

Code conventions

Below are code convention we strive to follow in eng directory:

package.json

  • We align package.json dependencies versions across all package.json files.
  • We align package.json dependencies numbers with microsoft/typespec package.json. In few cases we allow more frequent update cadence.
  • We avoid doing package overrides. For example, we use v8 of eslint instead of v9 to avoid an override. See this comment for details.
  • We order package.json keys as follows: name private type main bin scripts engines dependencies devDependencies.

package-lock.json

  • We maintain only top-level package-lock.json file. Running npm install from top-level dir removes the need to ever have other files.
  • We ensure the lock file remains clean by ensuring that a PR that adds or modifies any package.json dependencies, makes changes equivalent to following protocol:
    • cd <local-specs-clone-root>
    • git clean -xdf to remove all untracked files.
    • Copy-over package-lock.json from main to local clone.
    • npm install to reflect the added or modified dependencies.
  • In case any dependencies have been removed from any package.json, we do rm package-lock.json and npm install.
    This way we ensure the lock file remains free of unused dependencies.
  • We do npm update only in stand-alone PRs.
  • To avoid conflicting changes when updating package-lock.json, only use the latest LTS version of Node, and the bundled version of npm (but no newer). You can use nvm install --lts (Linux) or nvm install lts (Windows).

Linting and prettier

  • We make eslint-based linting rules and prettier mandatory in CI for all projects.
  • We use strict rulesets as baseline.
  • We discuss any desired rule divergences from the strict ruleset and apply rule modifications to the configs with explanation for our decision.
  • We align prettier rules with microsoft/typespec .prettierrc.json.