{"id":19866,"library":"eslint-plugin-office-addins","title":"ESLint Plugin for Office Add-ins","description":"ESLint plugin for Office Add-ins development. Current stable version 4.0.7, released on an as-needed cadence. It enforces rules specific to Office.js APIs, ensuring best practices and compatibility with Office Add-in platform requirements. Differentiates from generic ESLint plugins by providing rules tailored to Office.js patterns, async Office.js usage, and manifest validation. Provides out-of-the-box configuration for Office Add-in projects, and the package ships with TypeScript type definitions for rule options.","status":"active","version":"4.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/OfficeDev/Office-Addin-Scripts","tags":["javascript","eslint","eslintplugin","eslint-plugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-office-addins","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-office-addins","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-office-addins","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; required as the runtime environment for the plugin","package":"eslint","optional":false}],"imports":[{"note":"ESM default import is preferred; CommonJS require works but may lack TypeScript types","wrong":"const plugin = require('eslint-plugin-office-addins')","symbol":"plugin","correct":"import plugin from 'eslint-plugin-office-addins'"},{"note":"Named export 'configs' is available for accessing predefined configuration sets","wrong":null,"symbol":"configs","correct":"import { configs } from 'eslint-plugin-office-addins'"},{"note":"Named export 'rules' is available for accessing individual rule definitions","wrong":null,"symbol":"rules","correct":"import { rules } from 'eslint-plugin-office-addins'"}],"quickstart":{"code":"// .eslintrc.js (CommonJS) or .eslintrc.cjs\nmodule.exports = {\n  plugins: ['office-addins'],\n  extends: ['plugin:office-addins/recommended'],\n  rules: {\n    'office-addins/call-sync-before-read': 'error',\n    'office-addins/load-object-before-use': 'warn',\n  },\n};","lang":"javascript","description":"Configures ESLint to use the office-addins plugin with recommended rules and additional custom rules for Office.js best practices."},"warnings":[{"fix":"Upgrade ESLint to ^9.0.0, and update any legacy .eslintrc format if needed.","message":"ESLint 9+ required; plugin v4 drops support for ESLint 8 and below.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use eslint.config.js with flat config structure; see ESLint flat config migration guide.","message":"Plugin v4 uses flat config format; .eslintrc files may not be compatible without migration.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Replace 'office-addins/no-excel-in-auto-open' with 'office-addins/avoid-auto-open' in your config.","message":"Rule 'office-addins/no-excel-in-auto-open' is deprecated in v4, use 'office-addins/avoid-auto-open' instead.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Either upgrade ESLint to 9+ or pin eslint-plugin-office-addins@3.x.","message":"Plugin does not work with ESLint 8; if locked to ESLint 8, use plugin v3.x.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install eslint-plugin-office-addins --save-dev","cause":"Plugin not installed or missing from node_modules.","error":"Error: Failed to load plugin 'office-addins' declared in 'extends': Cannot find module 'eslint-plugin-office-addins'"},{"fix":"Ensure you are using plugin v4 or later, and use 'plugin:office-addins/recommended' (flat config) or check documentation.","cause":"The plugin version is too old or the config name has changed.","error":"ESLint couldn't find the config 'plugin:office-addins/recommended'."},{"fix":"Check the list of available rules from the plugin documentation and correct the rule name.","cause":"Using an invalid or misspelled rule name.","error":"TypeError: Cannot read properties of undefined (reading 'someRule')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}