🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

eslint-plugin-mso-conditionals

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

eslint-plugin-mso-conditionals

ESLint plugin for validating MSO (Outlook) conditional comments in HTML email

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

eslint-plugin-mso-conditionals

ESLint plugin for validating MSO (Outlook) conditional comments in HTML email.

Extracts <!--[if mso]><![endif]--> blocks from HTML files and lints them for valid syntax and matched pairs using a custom processor and AST parser.

Installation

npm install eslint-plugin-mso-conditionals --save-dev

Requires ESLint 9+ (flat config) and Node.js 18+.

Quick Start

// eslint.config.js
import msoConditionals from 'eslint-plugin-mso-conditionals';

export default [
  ...msoConditionals.configs.recommended,
];

This lints MSO conditional comments inside **/*.html, **/*.amp, and **/*.ampscript files.

VS Code Setup

To see eslint(mso-conditionals/...) diagnostics inline in VS Code, the ESLint extension must be configured to validate HTML files:

{
  "eslint.validate": ["html", "javascript"]
}

The MSO Conditional Comments VS Code extension provides the same diagnostics without requiring ESLint. Use this plugin when you want linting in CI or in editors other than VS Code.

Rules

RuleDefaultDescription
mso-conditionals/valid-mso-conditionerrorValidate MSO condition syntax — correct keyword, operator, and version
mso-conditionals/matching-mso-endiferrorEnsure every opener has a matching [endif] and vice versa

Processor

ProcessorFilesPurpose
mso-conditionals/html**/*.html, **/*.amp, **/*.ampscriptExtracts MSO conditional comment strings for linting

The processor emits a virtual .mso file per source file containing one MSO comment per line, preserving line offsets so reported locations map back to the original file.

Config

msoConditionals.configs.recommended

An array of two flat config objects:

  • Processor config — registers mso-conditionals/html on HTML/AMP files.
  • Rules config — applies valid-mso-condition and matching-mso-endif at error severity on the extracted .mso virtual files.

Spread it in your config:

export default [
  ...msoConditionals.configs.recommended,
  // your other rules...
];

To adjust severity, override individual rules after spreading:

export default [
  ...msoConditionals.configs.recommended,
  {
    rules: {
      'mso-conditionals/matching-mso-endif': 'warn',
    },
  },
];

License

MIT

Keywords

eslint

FAQs

Package last updated on 07 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts