Code Linting
FreshESLint Configuration
Installation
bash
npm install @elgato/eslint-config --save-devPreset Levels
| Preset | Description |
|---|---|
| Recommended | Standard enforcement |
| Strict | Enhanced type validation |
Core Rules
- Tab indentation (warnings)
- JSDoc validation (tags, types, completeness)
- TypeScript explicit return types (warning in strict mode)
- Member ordering by type and access level
Member Ordering
Fields > Constructors > Signatures > Properties > MethodsAccess order: public > protected > private
Ignored Paths
.github/, bin/, dist/, node_modules/
Configuration
Create eslint.config.js in project root:
javascript
import elgato from "@elgato/eslint-config";
export default [
...elgato.recommended,
// your overrides
];Prettier Configuration
Installation
bash
npm install @elgato/prettier-config --save-devKey Settings
| Setting | Value |
|---|---|
| Print width | 120 characters |
| Quotes | Double |
| Semicolons | Yes |
| Tab width | 4 spaces (2 for YAML) |
| Indentation | Tabs (except JSON/Markdown) |
| Line endings | LF |
Usage
bash
# Check formatting
npx prettier --check .
# Apply formatting
npx prettier --write .Configuration
Add to package.json:
json
{
"prettier": "@elgato/prettier-config"
}EditorConfig
Create .editorconfig in project root for consistent editor settings.