README
Setup
npm i -D @ackee/styleguide-backend-config
ESLint
.eslintrc.js
module.exports = require('@ackee/styleguide-backend-config/eslint')
{
// npm tasks
"cs:eslint:check": "eslint --ignore-path .gitignore '**/*.ts' -f codeframe",
"cs:eslint:fix": "npm run cs: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
"cs:prettier:check": "prettier --ignore-path .gitignore --check '**/*.{ts,js,json,md}'",
"cs:prettier:fix": "npm run cs:prettier:check -- --write '**/*.{ts,js,json,md}'"
}
Editorconfig
npm install -D eclint
Copy .editorconfig
from this project
{
// npm tasks
"cs:eclint:check": "eclint check '**/*'",
"cs:eclint:fix": "eclint fix '**/*'"
}
Husky
.huskyrc.json
{
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
.lintstagedrc
{
"*.ts": ["prettier --write", "eslint --fix"],
"*.{ts,js,json,md}": "prettier --write",
"*": ["eclint fix", "eclint check"]
}
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.