Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

custom eslint rules for the open source urlaubsverwaltung application

License

Notifications You must be signed in to change notification settings

urlaubsverwaltung/eslint-plugin-urlaubsverwaltung

Repository files navigation

Build Status

This custom plugin has been superseded with native eslint rules

eslint-plugin-urlaubsverwaltung

custom eslint rules for the Open Source Urlaubsverwaltung application.

Rules

@urlaubsverwaltung/no-date-fns

some date-fns functions like format are wrapped by the application with special behaviour.
(e.g. internationalisation or date patterns)

valid:

import format from "../lib/date-fns/format";
import startOfWeek from "../lib/date-fns/startOfWeek";

invaild:

import { format } from "date-fns";
import { startOfWeek } from "date-fns";
import DateFns from "date-fns";

@urlaubsverwaltung/no-global-fetch

global fetch api should not be used in favor of an abstraction layer. this layer could handle JSON serialisation for instance, or authorization and common error handling.

valid:

import * as fetch from "../lib/http";

fetch.json('/api');
import fetch from "fetch";

fetch('/api');
function fetch() {
  // ...
}

fetch('/api');

invaild:

fetch('/api')
window.fetch('/api')
global.fetch('/api')

Development

git hooks (optional)

There are some app specific git hooks to automate stuff like:

  • Install NodeJS dependencies after git pull when package-lock.json has changed
  • Format files on commit

If you want to take advantage of this automation you can run:

git config core.hooksPath '.githooks' 

The Githooks can be found in the .githooks directory.

About

custom eslint rules for the open source urlaubsverwaltung application

Resources

License

Stars

Watchers

Forks

Packages

No packages published