Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>ES6 BlockerNew to Visual Studio Code? Get it now.
ES6 Blocker

ES6 Blocker

Durai Raja

|
6 installs
| (0) | Free
VSCode extension to block ES6 features in AngularJS projects.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🚫 AngularJS ES6 Blocker

AngularJS ES6 Blocker is a lightweight VS Code extension that detects and blocks ES6+ syntax inside AngularJS (1.x) projects.
It ensures your code stays UglifyJS-compatible, ES5-safe, and fully supported on legacy browsers.


⚡ Features

This extension scans JavaScript files under public/app/ and warns whenever ES6+ code is used.

❗ Blocks the following ES6 features:

Variable Declarations

  • let
  • const

Functions

  • Arrow functions ()=>{}
  • Async / await
  • Generator functions (function*)

Syntax

  • Template literals (`text`)
  • Object destructuring {a, b} = obj
  • Array destructuring [a, b] = arr
  • Spread operator ...data
  • Default parameters
  • Ternary operator ? :
  • Nullish coalescing ??

Classes

  • class User {}
  • super()

Modules

  • import ... from
  • export default
  • export const

Promises

  • new Promise()
  • .finally()
  • Promise.resolve()

Loops

  • for…of

Objects

  • Object.assign()
  • Symbol()
  • Proxy()

Collections

  • Map
  • Set
  • WeakMap
  • WeakSet

ES6 String Methods

  • startsWith()
  • endsWith()
  • includes()

ES6 Array Methods

  • map()
  • filter()
  • reduce()
  • find()
  • findIndex()
  • some()
  • every()
  • includes()

📂 When Does It Run?

The blocker activates for:

  • .js files
  • .jsx files
  • Projects containing public/app/
  • Files located inside public/app/**

This ensures it only affects AngularJS, not your Node, React, or modern JS code.


🚨 Example Warnings

let x = 10;
// ❌ Avoid 'let' in AngularJS app files. Use 'var'.
const add = (a, b) => a + b;
// ❌ Arrow functions are not supported in AngularJS.
const { name } = user;
// ❌ Destructuring is not supported in AngularJS.
import hi from "./a.js";
// ❌ ES6 import is not allowed in AngularJS.

🧪 Full ES6 Test File

Use this code to test every blocked rule:

let x = 1;
const y = 2;
const add = (a, b) => a + b;
const msg = `hello`;
const {n} = obj;
const [a,b] = arr;
const arr2 = [...arr];
class A {}
import test from "./a.js";
export const a1 = 1;
async function run(){ await go(); }
new Promise(r => r());
for (const x of [1,2]) {}
Symbol("x");
new Map();
"abc".startsWith("a");
[1,2].map(x => x);
Object.assign({}, {});
Promise.resolve(1);

Your extension should detect EVERY LINE as an ES6 violation.


🚀 Getting Started

Install from VS Code Marketplace

  1. Open Visual Studio Code
  2. Go to the Extensions Panel
  3. Search for: ES6 Blocker
  4. Click Install

Or install via CLI:

code --install-extension duraidev.angularjs-es6-blocker

🔧 Configuration

Works automatically. No setup needed.

💡 Why This Extension?

AngularJS (1.x):

  • does NOT support ES6+
  • breaks in UglifyJS (cannot minify ES6)
  • is still used in enterprise environments

This extension protects your project from accidental modern JavaScript.


👨‍💻 Author

Built with ❤️ by Durai Raja

Full Stack Developer & Tool Creator


⭐ Feedback

If this ES6 Blocker helps your team, please leave a ⭐ on the Marketplace!


  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft