Scala Style
Lichess uses Scala 3 with automatic formatting via scalafmt.Scalafmt Configuration
The project uses scalafmt version3.10.7 with the following key settings:
.scalafmt.conf
Formatting Rules
Rewrite Rules
Scalafmt automatically applies these transformations:1. Sort Modifiers
2. Avoid Infix Notation
3. String Interpolation
4. Import Cleanup
File-Specific Overrides
Build files use Scala 2.13 dialect:Running Scalafmt
TypeScript Style
Lichess uses oxlint for TypeScript/JavaScript linting.Oxlint Configuration
The project uses oxlint with plugins for promises, TypeScript, and unicorn rules:.oxlintrc.json
Key Rules
Variable Declarations
Imports
Unused Variables
varsIgnorePattern: "^_"argsIgnorePattern: "^_"caughtErrorsIgnorePattern: "^_"
Promises
TypeScript-Specific Rules
Modern Array Methods
Restricted Global Variables
The configuration restricts 200+ window globals likeaddEventListener, focus, blur, etc. to prevent implicit global access.
File-Specific Overrides
Utility scripts have relaxed rules:Running Oxlint
CSS/SCSS Style
Lichess uses stylelint for CSS and SCSS linting.Stylelint Configuration
.stylelintrc.json
Key Rules
Color Notation
Variable Naming
custom-property-patternselector-class-patternselector-id-patternscss/dollar-variable-pattern
SCSS Features
Running Stylelint
Editor Integration
Configure your editor to use these tools automatically:VS Code
VS Code
Install these extensions:
- Scala (Metals)
- oxlint
- Stylelint
IntelliJ IDEA
IntelliJ IDEA
- Enable scalafmt: Settings → Editor → Code Style → Scala → Scalafmt
- Install oxlint plugin from marketplace
- Enable Stylelint: Settings → Languages → Style Sheets → Stylelint
Neovim/Vim
Neovim/Vim
Use formatters via null-ls or conform.nvim:
- scalafmt for Scala
- oxlint for TypeScript
- stylelint for SCSS
Pre-commit Checks
Before committing, ensure:1
Run formatters
2
Check for errors
3
Run tests
CI will automatically check code style on all pull requests. Fix any style violations before requesting review.
Next Steps
Pull Request Guidelines
Learn how to submit your code
Contributing Overview
Back to contributing overview

