This custom plugin has been superseded with native eslint rules
custom eslint rules for the Open Source Urlaubsverwaltung application.
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";
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')
There are some app specific git hooks to automate stuff like:
- Install NodeJS dependencies after
git pull
whenpackage-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.