@ackee/styleguide-backend-config

0.5.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @ackee/styleguide-backend-config

Weekly Downloads

635

Version

0.5.0

License

MIT

Unpacked Size

62.8 kB

Total Files

15

Last publish

Collaborators

  • pivl
  • hofp37
  • grissius
  • ackeecz
  • horaklukas
  • borecekbaji
  • davidbilik