Skip to content

Commit

Permalink
Use deep imports for date-fns to improve tree-shaking
Browse files Browse the repository at this point in the history
Change-type: patch
See: https://balena.zulipchat.com/#narrow/stream/346007-balena-io.2FbalenaCloud/topic/moment.20-.3E.20date-fns
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
  • Loading branch information
thgreasi committed Nov 4, 2022
1 parent 6aa14da commit adba24b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/util/date.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatDistance } from 'date-fns';
import formatDistance from 'date-fns/formatDistance';
import memoizee from 'memoizee';

const now = memoizee(() => new Date(), { maxAge: 1000 });
Expand Down
6 changes: 5 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"extends": "./node_modules/@balena/lint/config/tslint-prettier.json",
"rules": {
"import-blacklist": [true, "lodash"]
"import-blacklist": [
true,
"date-fns",
"lodash"
]
}
}

0 comments on commit adba24b

Please sign in to comment.