<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.bathcs.com/index.php?action=history&amp;feed=atom&amp;title=BOSS%2FLanguages%2FTypeScript</id>
	<title>BOSS/Languages/TypeScript - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bathcs.com/index.php?action=history&amp;feed=atom&amp;title=BOSS%2FLanguages%2FTypeScript"/>
	<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=BOSS/Languages/TypeScript&amp;action=history"/>
	<updated>2026-08-26T06:45:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=BOSS/Languages/TypeScript&amp;diff=120&amp;oldid=prev</id>
		<title>Hw2210: Translate from boss.bathcs.com</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=BOSS/Languages/TypeScript&amp;diff=120&amp;oldid=prev"/>
		<updated>2026-06-04T08:28:29Z</updated>

		<summary type="html">&lt;p&gt;Translate from boss.bathcs.com&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Again, please in most cases use TypeScript over JavaScript.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
This should mostly be done by [https://biomejs.dev/ biome] or [https://prettier.io/ prettier] and [https://eslint.org/ eslint], but so you know&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Try to prioritise readability of code&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;2 spaces as tabs&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Lines should not be longer than 80 characters (install extension)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Trailing commas when the bracket on a new line&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;NO trailing whitespaces! (Install an extension to remove it for you)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Space after comments e.g. &amp;lt;code&amp;gt;// something&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Order imports alphabetically&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Prefer documentation over comments (see below on how you do that)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Comments should only be written when necessary, mainly to describe why something is done the way it is or to example a really unreadable bit of code (however this normally means you should change the code).&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Methods should be ordered alphabetically (with private methods ordered separately and at the bottom of the file)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;export function aFunc() {}&lt;br /&gt;
export function bFunc() {}&lt;br /&gt;
export function zFunc() {}&lt;br /&gt;
function aPrivateFunc() {}&lt;br /&gt;
function bPrivateFunc() {}&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are really strict, if you take anything away remember this:&lt;br /&gt;
&lt;br /&gt;
* Use a formatter and linter: styling should be consistent throughout the project&lt;br /&gt;
* Readability of code takes precedent&lt;br /&gt;
&lt;br /&gt;
=== Use a Linter ===&lt;br /&gt;
&lt;br /&gt;
Linters usually will catch most issues, these can be installed as extensions to your preferred editor. E.g. for TypeScript we will be using [https://biomejs.dev/ biome] or [https://eslint.org/ ESLint].&lt;br /&gt;
&lt;br /&gt;
For Biome, both formatting and linting can be configured with &amp;lt;code&amp;gt;biome.json&amp;lt;/code&amp;gt;:&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://biomejs.dev/schemas/2.4.15/schema.json&amp;quot;,&lt;br /&gt;
  &amp;quot;vcs&amp;quot;: {&lt;br /&gt;
    &amp;quot;enabled&amp;quot;: true,&lt;br /&gt;
    &amp;quot;clientKind&amp;quot;: &amp;quot;git&amp;quot;,&lt;br /&gt;
    &amp;quot;useIgnoreFile&amp;quot;: true&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;files&amp;quot;: {&lt;br /&gt;
    &amp;quot;includes&amp;quot;: [&amp;quot;**&amp;quot;, &amp;quot;!!**/dist&amp;quot;]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;formatter&amp;quot;: {&lt;br /&gt;
    &amp;quot;enabled&amp;quot;: true,&lt;br /&gt;
    &amp;quot;indentWidth&amp;quot;: 2,&lt;br /&gt;
    &amp;quot;indentStyle&amp;quot;: &amp;quot;space&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;linter&amp;quot;: {&lt;br /&gt;
    &amp;quot;enabled&amp;quot;: true,&lt;br /&gt;
    &amp;quot;rules&amp;quot;: {&lt;br /&gt;
      &amp;quot;recommended&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;javascript&amp;quot;: {&lt;br /&gt;
    &amp;quot;formatter&amp;quot;: {&lt;br /&gt;
      &amp;quot;quoteStyle&amp;quot;: &amp;quot;double&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;assist&amp;quot;: {&lt;br /&gt;
    &amp;quot;enabled&amp;quot;: true,&lt;br /&gt;
    &amp;quot;actions&amp;quot;: {&lt;br /&gt;
      &amp;quot;source&amp;quot;: {&lt;br /&gt;
        &amp;quot;organizeImports&amp;quot;: &amp;quot;on&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;css&amp;quot;: {&lt;br /&gt;
    &amp;quot;parser&amp;quot;: {&lt;br /&gt;
      &amp;quot;tailwindDirectives&amp;quot;: true&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;overrides&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;includes&amp;quot;: [&amp;quot;**/*.svelte&amp;quot;, &amp;quot;**/*.astro&amp;quot;, &amp;quot;**/*.vue&amp;quot;],&lt;br /&gt;
      &amp;quot;linter&amp;quot;: {&lt;br /&gt;
        &amp;quot;rules&amp;quot;: {&lt;br /&gt;
          &amp;quot;style&amp;quot;: {&lt;br /&gt;
            &amp;quot;useConst&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
            &amp;quot;useImportType&amp;quot;: &amp;quot;off&amp;quot;&lt;br /&gt;
          },&lt;br /&gt;
          &amp;quot;correctness&amp;quot;: {&lt;br /&gt;
            &amp;quot;noUnusedVariables&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
            &amp;quot;noUnusedImports&amp;quot;: &amp;quot;off&amp;quot;&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Example ESLint config (&amp;lt;code&amp;gt;.estlintrc.cjs&amp;lt;/code&amp;gt;) which supports, react and typescript:&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
You will want to customise this to your projects needs. But this is a good base&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;import js from &amp;quot;@eslint/js&amp;quot;;&lt;br /&gt;
import prettier from &amp;quot;eslint-plugin-prettier&amp;quot;;&lt;br /&gt;
import tsParser from &amp;quot;@typescript-eslint/parser&amp;quot;;&lt;br /&gt;
import eslintJs from &amp;quot;@eslint/js&amp;quot;;&lt;br /&gt;
import eslintReact from &amp;quot;@eslint-react/eslint-plugin&amp;quot;;&lt;br /&gt;
import globals from &amp;quot;globals&amp;quot;;&lt;br /&gt;
import ts from &amp;quot;@typescript-eslint/eslint-plugin&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
export default [&lt;br /&gt;
  {&lt;br /&gt;
    files: [&amp;quot;**/*.{ts,tsx,mjs,js,jsx}&amp;quot;, &amp;quot;astro.config.mjs&amp;quot;],&lt;br /&gt;
    languageOptions: {&lt;br /&gt;
      globals: { ...globals.browser },&lt;br /&gt;
      sourceType: &amp;quot;module&amp;quot;,&lt;br /&gt;
      ecmaVersion: 2022,&lt;br /&gt;
      parser: tsParser,&lt;br /&gt;
      parserOptions: {&lt;br /&gt;
        project: [&amp;quot;./tsconfig.json&amp;quot;],&lt;br /&gt;
        ecmaVersion: &amp;quot;latest&amp;quot;,&lt;br /&gt;
        sourceType: &amp;quot;module&amp;quot;,&lt;br /&gt;
        ecmaFeatures: {&lt;br /&gt;
          jsx: true, // Enable JSX syntax support&lt;br /&gt;
        },&lt;br /&gt;
      },&lt;br /&gt;
    },&lt;br /&gt;
    plugins: {&lt;br /&gt;
      eslintJs: eslintJs.configs.recommended,&lt;br /&gt;
      eslintReact: eslintReact.configs.recommended,&lt;br /&gt;
      prettier: prettier,&lt;br /&gt;
      &amp;quot;@typescript-eslint&amp;quot;: ts,&lt;br /&gt;
    },&lt;br /&gt;
    settings: {&lt;br /&gt;
      &amp;quot;mdx/code-blocks&amp;quot;: true,&lt;br /&gt;
    },&lt;br /&gt;
    rules: {&lt;br /&gt;
      &amp;quot;@typescript-eslint/triple-slash-reference&amp;quot;: &amp;quot;off&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
  },&lt;br /&gt;
  {&lt;br /&gt;
    ...js.configs.recommended,&lt;br /&gt;
    ...ts.configs.recommendedTypeChecked,&lt;br /&gt;
    files: [&amp;quot;**/*.ts&amp;quot;, &amp;quot;**/*.tsx&amp;quot;],&lt;br /&gt;
    rules: {&lt;br /&gt;
      &amp;quot;@typescript-eslint/strict-boolean-expressions&amp;quot;: [&lt;br /&gt;
        2,&lt;br /&gt;
        {&lt;br /&gt;
          allowString: false,&lt;br /&gt;
          allowNumber: false,&lt;br /&gt;
        },&lt;br /&gt;
      ],&lt;br /&gt;
    },&lt;br /&gt;
  },&lt;br /&gt;
];&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Node that you must add the following dependencies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;txt&amp;quot;&amp;gt;@eslint/js&lt;br /&gt;
eslint-plugin-prettier&lt;br /&gt;
@typescript-eslint/parser&lt;br /&gt;
@eslint-react/eslint-plugin&lt;br /&gt;
@typescript-eslint/eslint-plugin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For formatters, we recommend prettier with the following config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;trailingComma&amp;quot;: &amp;quot;all&amp;quot;,&lt;br /&gt;
  &amp;quot;tabWidth&amp;quot;: 2,&lt;br /&gt;
  &amp;quot;semi&amp;quot;: true,&lt;br /&gt;
  &amp;quot;singleQuote&amp;quot;: false,&lt;br /&gt;
  &amp;quot;quoteProps&amp;quot;: &amp;quot;as-needed&amp;quot;,&lt;br /&gt;
  &amp;quot;jsxSingleQuote&amp;quot;: false,&lt;br /&gt;
  &amp;quot;bracketSpacing&amp;quot;: true,&lt;br /&gt;
  &amp;quot;bracketSameLine&amp;quot;: false,&lt;br /&gt;
  &amp;quot;arrowParens&amp;quot;: &amp;quot;always&amp;quot;,&lt;br /&gt;
  &amp;quot;printWidth&amp;quot;: 80,&lt;br /&gt;
  &amp;quot;useTabs&amp;quot;: false&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
(you will need to add &amp;lt;code&amp;gt;prettier&amp;lt;/code&amp;gt; as a dependency).&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
It is also worth noting that people have started to mention moving towards &amp;lt;code&amp;gt;biome&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;prettier&amp;lt;/code&amp;gt; (even the devs behind prettier), so you may want to use that instead&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can then add the following to your deno.jsonc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;tasks&amp;quot;: {&lt;br /&gt;
    // Biome requires running /bin/sh which means it effectively wants all&lt;br /&gt;
    // permissions&lt;br /&gt;
    &amp;quot;biome&amp;quot;: &amp;quot;deno run -A npm:@biomejs/biome&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    // ...&lt;br /&gt;
    &amp;quot;lint&amp;quot;: &amp;quot;deno task biome lint&amp;quot;,&lt;br /&gt;
    &amp;quot;lint:fix&amp;quot;: &amp;quot;deno task biome lint --write&amp;quot;,&lt;br /&gt;
    &amp;quot;format&amp;quot;: &amp;quot;deno task biome check --write&amp;quot;,&lt;br /&gt;
    &amp;quot;format:check&amp;quot;: &amp;quot;deno task biome check&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
    // With ESLINT + Prettier&lt;br /&gt;
    &amp;quot;eslint&amp;quot;: &amp;quot;deno run -A npm:eslint&amp;quot;,&lt;br /&gt;
    &amp;quot;prettier&amp;quot;: &amp;quot;deno run -A npm:prettier&amp;quot;,&lt;br /&gt;
    &amp;quot;prettier:files&amp;quot;: &amp;quot;deno task prettier &amp;#039;src/**/*.{tsx,ts,md,mdx,json}&amp;#039; &amp;#039;*.{json,js,mjs,md}&amp;#039; &amp;#039;.prettierrc&amp;#039;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;lint&amp;quot;: &amp;quot;deno task eslint src --report-unused-disable-directives --max-warnings 0&amp;quot;,&lt;br /&gt;
    &amp;quot;lint:fix&amp;quot;: &amp;quot;deno task lint --fix&amp;quot;,&lt;br /&gt;
    &amp;quot;format&amp;quot;: &amp;quot;deno task prettier:files --write&amp;quot;,&lt;br /&gt;
    &amp;quot;format:check&amp;quot;: &amp;quot;deno task prettier:files --check&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Specifically ==&lt;br /&gt;
&lt;br /&gt;
These are normally the typical styling recommendations for JavaScript:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;camelCase&amp;lt;/code&amp;gt; for variables + functions. Preferably, if you had an acronym in the name, all letters should be the same case e.g. &amp;lt;code&amp;gt;myNPC&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;npcPair&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;PascalCase&amp;lt;/code&amp;gt; for classes&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;SCREAMING_CASE&amp;lt;/code&amp;gt; for global constants&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Use &amp;lt;code&amp;gt;const&amp;lt;/code&amp;gt; by default. Use &amp;lt;code&amp;gt;let&amp;lt;/code&amp;gt; only if you need to reassign to the variable.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Constants in JavaScript + TypeScript are not actually constant, they just can’t be reassigned.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Reduce use of &amp;lt;code&amp;gt;any&amp;lt;/code&amp;gt;. Unfortunately TypeScript can be quite dumb at times so this can be used for type conversion.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Prefer &amp;lt;code&amp;gt;&amp;amp;quot;&amp;lt;/code&amp;gt; over &amp;lt;code&amp;gt;&amp;#039;&amp;lt;/code&amp;gt; for strings, unless you have &amp;lt;code&amp;gt;&amp;amp;quot;&amp;lt;/code&amp;gt; inside the string&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This one is more personal so not necessary (consistency though!)&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Starting a new scope with &amp;lt;code&amp;gt;{&amp;lt;/code&amp;gt; should be on the same line, not on a new line, e.g. in javascript:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;function something(my_arg) {&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// NOT&lt;br /&gt;
function something(my_arg)&lt;br /&gt;
{&lt;br /&gt;
    ...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;else&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;else if&amp;lt;/code&amp;gt; statements should be on the same line as the scope (ignore the lecturers’ preferences for this).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;if (myVar === &amp;#039;Something&amp;#039;) {&lt;br /&gt;
  ...&lt;br /&gt;
} else if (myOtherVar !== &amp;#039;THING&amp;#039;) {&lt;br /&gt;
  ...&lt;br /&gt;
} else {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// NOT&lt;br /&gt;
if (myVar === &amp;#039;Something&amp;#039;) {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
else if (myOtherVar !== &amp;#039;THING&amp;#039;) {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
  ...&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Prefer creating your own interface over using the &amp;lt;code&amp;gt;object&amp;lt;/code&amp;gt; keyword&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;ESLint basically covers all my other issues&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
TypeScript and JavaScript have actually good documentation (probably the only good thing about them), so please use it.&lt;br /&gt;
&lt;br /&gt;
Basically please read through [https://gamedevacademy.org/javascript-docstrings-tutorial/ this].&lt;br /&gt;
&lt;br /&gt;
== Package manager ==&lt;br /&gt;
As an asside, as already alluded to, [[Bath Open Source Society|BOSS]] has a standard of using [https://deno.com/ deno] for its package manage and runtime due to its significant focus on security. However, this comes with some learning barriers as it unlike your regular npm, yarn or bun and goes further than pnpm.&lt;br /&gt;
&lt;br /&gt;
Our configuration of deno is as follows, which can be found in the &amp;lt;code&amp;gt;deno.jsonc&amp;lt;/code&amp;gt; of any project:&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;$schema&amp;quot;: &amp;quot;https://raw.githubusercontent.com/denoland/deno/refs/tags/v2.8.0/cli/schemas/config-file.v1.json&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;tasks&amp;quot;: {&lt;br /&gt;
    // ... Any &amp;quot;scripts&amp;quot; from package.json&lt;br /&gt;
  },&lt;br /&gt;
&lt;br /&gt;
  &amp;quot;minimumDependencyAge&amp;quot;: &amp;quot;P2D&amp;quot;,&lt;br /&gt;
  &amp;quot;vendor&amp;quot;: true,&lt;br /&gt;
  &amp;quot;lock&amp;quot;: { &amp;quot;frozen&amp;quot;: true }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;What this configuration does is as follows:&lt;br /&gt;
&lt;br /&gt;
* When updating, the chosen dependency verion must be older than 2 days to help mitigate from supply chain attacks&lt;br /&gt;
* By default, the lock file is frozen, and so when adding or updating packages, you must explicity include &amp;lt;code&amp;gt;--frozen=false&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;vendor&amp;lt;/code&amp;gt; folder is used as a local cache for remote modules, decreasing overall disk usage.&lt;br /&gt;
&lt;br /&gt;
=== Core differences with npm ===&lt;br /&gt;
&lt;br /&gt;
* Added packages must include a namespace, e.g. anything from &amp;lt;code&amp;gt;npm&amp;lt;/code&amp;gt; (basically anything) should be prefixed with &amp;lt;code&amp;gt;npm:&amp;lt;/code&amp;gt;. You can also install from the [https://jsr.io/ JSR] by prefixing with &amp;lt;code&amp;gt;jsr:&amp;lt;/code&amp;gt;&lt;br /&gt;
* Scripts are not found in &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt; instead they should be in deno&amp;#039;s config: &amp;lt;code&amp;gt;deno.jsonc&amp;lt;/code&amp;gt; under &amp;lt;code&amp;gt;tasks&amp;lt;/code&amp;gt;&lt;br /&gt;
* Running &amp;quot;tasks&amp;quot; should be done through deno&amp;#039;s task cmd: &amp;lt;code&amp;gt;deno task ...&amp;lt;/code&amp;gt;&lt;br /&gt;
* Running package scripts, the full package name must be used e.g. &amp;lt;code&amp;gt;deno run -A npm:@biomejs/biome&amp;lt;/code&amp;gt;&lt;br /&gt;
* You must permit applications to use features such as environmental variables or reading your directories. If deploying yourself, it will ask for each permission. You can also permit anything by using &amp;lt;code&amp;gt;deno run -A&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hw2210</name></author>
	</entry>
</feed>