Developed By Ken Key

Modern JavaScript Practices That Actually Hold Up in 2026

By Ken Key Dec 11, 2025 5 min read Updated Oct 16, 2026

Modern JavaScript Practices That Actually Hold Up in 2026
The short answer

The JavaScript practices that hold up in 2026 are ESM everywhere, Node 22's native fetch, test runner and watch mode, plus strict linting and formatting. Skip transpile steps and extra dependencies unless a real need proves otherwise. Consistency beats clever syntax every time.

Part of the complete web development guide.

On this page

Most of the “JavaScript standards” posts floating around are either five years stale or list rules nobody actually enforces on a real project. I’ve been writing JavaScript for over a decade, the last several building sites and apps for businesses around Commack and the rest of Long Island, and the standards that matter in 2026 are less about syntax tricks and more about consistency, tooling, and not fighting the language. Here’s what I actually reach for day to day.

Start with the runtime, not the framework

Node 22 is the current LTS line, and it ships with things you used to need a dependency for. Native fetch, a built-in test runner, and a real --watch mode mean a small project can have zero dev dependencies and still be pleasant to work in.

// package.json
{
 "type": "module",
 "scripts": {
 "test": "node --test",
 "dev": "node --watch src/server.js"
 }
}

That’s it. No nodemon, no Jest config file, no transpile step for a basic API. If your project genuinely needs those tools, fine, but reach for them because of a real need, not habit.

Modules are ESM now. Commit to it.

Mixing CommonJS and ESM in the same codebase is the single biggest source of “why is this import undefined” confusion I see in code reviews. Pick ESM, set "type": "module", and use import everywhere. If you have to pull in an older CommonJS package, Node handles the interop fine.

import { readFile } from 'node:fs/promises';
import express from 'express'; // CJS package, still works

const app = express();
const config = JSON.parse(await readFile('./config.json', 'utf8'));

Note the node: prefix on built-ins. It’s not required, but it makes it obvious at a glance which imports are core and which are packages.

Use the language features that remove whole classes of bugs

Optional chaining and nullish coalescing have been standard for years, but I still see defensive code that predates them. These two operators alone delete a lot of noise.

// Old way
const city = user && user.address && user.address.city ? user.address.city : 'Unknown';

// 2026 way
const city = user?.address?.city ?? 'Unknown';

One gotcha worth internalizing: ?? only falls back on null or undefined. If you want to catch empty strings too, use ||. They are not interchangeable, and mixing them up has caused real production bugs.

Structured clone instead of JSON round-tripping

Copying an object with JSON.parse(JSON.stringify(obj)) silently drops dates, undefined values, and functions. structuredClone is native now and does the right thing.

const original = { created: new Date(), tags: new Set(['a', 'b']) };
const copy = structuredClone(original); // Date and Set survive

Async patterns that scale past one file

Two rules cover most of the async bugs I’ve debugged. First, never use await inside a for loop unless the iterations genuinely depend on each other. Second, always handle rejections at the boundary.

// Slow: runs one at a time
for (const id of ids) {
 results.push(await fetchUser(id));
}

// Fast: runs concurrently
const results = await Promise.all(ids.map(fetchUser));

Just be careful with Promise.all on a huge list. If you’re hitting an API with rate limits, batch it or use a concurrency limiter so you don’t fire 500 requests at once and get throttled.

Tooling: pick boring, keep it fast

For linting and formatting, Biome has become a solid single-tool replacement for ESLint plus Prettier on most projects I work on. It’s fast, config is one file, and it handles both jobs. If you’re on a big existing ESLint setup, migrating isn’t urgent, but for anything new it’s worth a look.

// biome.json
{
 "formatter": { "indentStyle": "space", "indentWidth": 2 },
 "linter": { "enabled": true, "rules": { "recommended": true } }
}

For bundling, Vite remains the default choice for most front-ends, and Bun or esbuild handle the “I just need this fast” cases. None of this is glamorous, and that’s the point. Boring tooling you don’t think about is tooling that works.

Type safety without a full rewrite

You don’t have to convert a whole codebase to TypeScript to get value from types. JSDoc annotations plus checkJs give you real checking in plain JavaScript files, which is often the right move for an existing project.

/**
 * @param {string} id
 * @returns {Promise<{ id: string, name: string } | null>}
 */
export async function getUser(id) {
 const res = await fetch(`/api/users/${id}`);
 return res.ok ? res.json() : null;
}

Turn on "checkJs": true in your tsconfig.json and your editor starts flagging mistakes today, no build step required.

Performance habits that still matter

  • Keep your JavaScript bundle honest. If a page doesn’t need a library, don’t ship it. Check the bundle analyzer before you ship, not after someone complains the site feels slow.
  • Use requestAnimationFrame for anything animating, and prefer CSS transforms over layout-triggering properties.
  • Lazy-load below-the-fold components with dynamic import(). It’s a one-line change that often cuts initial load meaningfully.
  • Measure with real devices and real networks. Your dev machine on fiber is not your customer’s phone on LTE.

None of this is exotic. The teams I see shipping reliable JavaScript aren’t using secret techniques. They just pick a small set of solid practices and apply them consistently. If you’re weighing a rebuild versus refactoring what you have, that’s the kind of decision custom web development work usually turns on, and it’s worth getting honest about before you commit months to it.

FAQ

Should I migrate my project from CommonJS to ESM?

If it’s actively maintained, yes, but do it incrementally. Node 22 supports both, so you can convert file by file instead of all at once. The main friction is older dependencies, and most popular packages have ESM support by now.

Is TypeScript required for modern JavaScript?

No. It helps on large codebases and teams, but JSDoc with checkJs gets you most of the safety with none of the build complexity. Pick based on your project, not what’s trending.

Do I really need a bundler in 2026?

For a simple site, maybe not. Native ESM works in browsers, and import maps handle bare specifiers. Once you have many modules, dependencies, or a framework, a bundler like Vite earns its place by handling splitting and optimization for you.

Have a project like this?

I do custom web development for Long Island businesses. If you need this done right, let’s talk.