localStorage
or window.localStorage
or LocalStorage
, (2) sessionStorage
or window.sessionStorage
or SessionStorage
, (3) Cookie
, (4) ExpirableLocalStorage
, (5) ExpirableIDBStore
, and extract the keys to @traveloka/app-meta
core
or flight
) to the enforcedPackages
variable in packages/ci/eslint-plugin-www/lib/rules/use-app-meta-constants.js
, then run command like this to lint the entire package folder: yarn lint /Users/ferdinand.antonius/github/tvlk/www/packages/core/**/*.(js|ts|tsx)
@traveloka/app-meta
, e.g. const lsAcdBookingId = (bookingId: string) => `hotel-${bookingId}`
LocalStorage
etc., you can bypass the lint by placing /* eslint www/use-app-meta-constants: 0 */
at the top of the file (but try to use this sparingly). You might even want to consider using the storage/cookie util from core instead.
@traveloka/app-meta
. You can remove/delete the constants outside @traveloka/app-meta
when you have done this, then update all occurrence of such cookie/storage key so they import from the @traveloka/app-meta
package
@traveloka/app-meta
is like this: lsFprSomethingSomething
(ls
refers to the storage type, Fpr
is your team's abbreviation, and SomethingSomething
is the name of the key)
@traveloka/app-meta
like so: storage-ls/fpr-general.ts
, storage-ls/fpr-booking.ts
tam
to insert import {} from '@traveloka/app-meta';
to the code.
@traveloka/app-meta
. I have provided the template (you can just replace my ???
's), and you can refer to flight codes inside @traveloka/app-meta
for examples.
Purpose
: Why we need this cookie/local storage? What does it do? On what page?
Contract
: Explain what does this storage/cookie stores. You can refer to an existing type definition, or gives a semantic description on what the value stores
See usage here:
: Describe where this is mainly used (you don't have to include all the usages), this is just to give the readers a reference to look further if they want to tinker with the variable.