@ackee/styleguide-backend-config
v0.5.0
Published
styleguide-backend-config
Downloads
2,658
Keywords
Readme
Ackee styleguide: Backend config
Configuration files for styleguide enforcement tools
Setup
npm i -D @ackee/styleguide-backend-config
ESLint
.eslintrc.js
module.exports = require('@ackee/styleguide-backend-config/eslint')
{
// npm tasks
"eslint:check": "eslint --ignore-path .gitignore '**/*.ts' -f codeframe",
"eslint:fix": "npm run eslint:check -- --fix",
}
For detailed rules description, see eslint
Prettier
npm install -D prettier
prettier.config.js
module.exports = require('@ackee/styleguide-backend-config/prettier')
{
// npm tasks
"prettier:check": "prettier --ignore-path .gitignore --check '**/*.{ts,js,json,md}'",
"prettier:fix": "npm run prettier:check -- --write '**/*.{ts,js,json,md}'",
}
Husky
.husky\pre-commit
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
.lintstagedrc
{
"*.ts": ["prettier --write", "eslint --fix"],
"*.{ts,js,json,md}": "prettier --write"
}
Danger
dangerfile.ts
import {
danger,
warn,
message,
fail,
markdown,
schedule,
peril,
results,
} from 'danger'
import { runDangerRules } from '@ackee/styleguide-backend-config/danger'
void runDangerRules(
{ danger, warn, message, fail, markdown, schedule, peril, results },
{
/* pass options */
}
)
License
This project is licensed under MIT.