npm i -D @ackee/styleguide-backend-config
.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
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\pre-commit
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
.lintstagedrc
{
"*.ts": ["prettier --write", "eslint --fix"],
"*.{ts,js,json,md}": "prettier --write"
}
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 */
}
)
This project is licensed under MIT.