Linting before the first PR
All projects MUST have linting configured and passing before the first pull request. Linting config SHOULD be set up early in the project, but during rapid prototyping, committing without lint-gating every commit is acceptable. Before any PR is opened, lint MUST be clean.
| Platform | Linter | Formatter |
|---|---|---|
| Swift | SwiftLint | swift-format |
| Kotlin | ktlint | ktlint |
| TypeScript | ESLint | Prettier |
| C# / .NET | Roslyn Analyzers + .editorconfig | dotnet format |
Linter config MUST be committed. Linting MUST run as part of the build or pre-commit process. Formatting MUST be auto-fixable.
Swift
- SwiftLint with
.swiftlint.ymlat project root. Enablestrictmode. Add as SPM plugin or Xcode build phase. - swift-format for auto-formatting.
Kotlin
Use ktlint for both linting and formatting. Configure via .editorconfig at project root. Add as a Gradle plugin (org.jlleitschuh.gradle.ktlint).
TypeScript
- ESLint with
eslint.config.js. Useeslint-config-prettierto avoid conflicts with the formatter. - Prettier with
.prettierrcfor auto-formatting. - Stylelint with
.stylelintrc.jsonfor CSS linting. - Add as
package.jsonscripts and pre-commit hooks.
C#
.editorconfigat repo root for all code style rules.- Enable Roslyn analyzers in
.csproj:
<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest-recommended</AnalysisLevel>
</PropertyGroup>
- Use
dotnet formatCLI for auto-fixing. - Supplement with Roslynator or Meziantou.Analyzer for additional rules.