@urlaubsverwaltung/eslint-plugin
v1.2.0
Published
custom eslint rules for the open source urlaubsverwaltung application
Downloads
26
Maintainers
Readme
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')