TypeScript

Path aliases (@/...)

Në shqip: Shkurtesat e rrugëve

ShpjegimiSQ

Në vend të import { Butoni } from "../../../components/Butoni", me "paths" në tsconfig shkruan import { Butoni } from "@/components/Butoni". Kodi lexohet më mirë dhe s'prishet kur i lëviz skedarët.

EnglishEN

Instead of import { Button } from "../../../components/Button", with "paths" in tsconfig you write import { Button } from "@/components/Button". Code reads better and doesn't break when you move files.

Si ta mendosh

Si ta ruash një adresë në GPS si „Shtëpia“ në vend që ta shkruash të plotë çdo herë.

Lexoje në anglisht

Like saving an address in the GPS as “Home” instead of typing it in full every time.

Shembull kodijson

{ "compilerOptions": { "paths": { "@/*": ["./src/*"] } } }

Terma të lidhur