Office Add-in Lint

raw JSON →
3.0.7 verified Sat Apr 25 auth: no javascript

A configuration package that provides ESLint and Prettier integration for Office Add-in projects. Current stable version is 3.0.7, with monthly releases. It simplifies setting up linting and formatting by bundling shared ESLint configs, Prettier options, and TypeScript support. Differentiates from raw ESLint/Prettier by providing pre-tuned rules for Office Add-in development and automatic dependency management.

error Cannot find module 'office-addin-lint'
cause Package not installed or outdated npm cache
fix
Run npm install office-addin-lint --save-dev then clear cache with npm cache clean --force
error TypeError: officeAddinLint is not a function
cause Using deprecated v2 function name in v3
fix
Use configure() instead of officeAddinLint(). See documentation.
breaking Modules are ESM-only since v3, require() not supported
fix Use import syntax instead of require(). Ensure your project is configured for ESM (e.g., type: 'module' in package.json).
deprecated officeAddinLint() function deprecated in v3; use configure() instead
fix Replace officeAddinLint() with configure() as shown in the quickstart.
gotcha ESLint and Prettier must be installed as peer dependencies
fix Run npm install eslint prettier --save-dev in your project.
npm install office-addin-lint
yarn add office-addin-lint
pnpm add office-addin-lint

Shows how to import and use the configure function to set up ESLint and Prettier options.

import { configure } from 'office-addin-lint';
const config = configure({
  eslint: { fix: false },
  prettier: { printWidth: 100 }
});
console.log(config);