OfficeDev / OfficeDev/Office-Addin-Scripts

Bad lib/main.ts.d file generation in eslint-plugin-office-addins

Open
#926 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs triage
Dominant language
TypeScript
Stars
194
Forks
117
Avg merge
1d 32m
Merged PRs (30d)
2

Description

Prerequisites

package office-addin-lint is installed
Thie above package installs the needed dependencies of eslint v9 and the eslint-plugin-office-addins

Expected behavior

The configs and rules objects should be accessible to the project's eslint.config.mts file via importing the eslint-plugin-office-addins library in order customize the linting based on eslint-plugin-office-addins predefined configs and rules.

Current behavior

cannot reference attributes of the exported plugin in the eslint-plugin-office-addins package in typescript:

  • eslint-plugin-office-addin.configs
  • eslint-plugin-office-addin.rules

Property '(<configs|rules>)' does not exist on type 'typeof import("...//node_modules/eslint-plugin-office-addins/lib/main")'.ts(2339)

Steps to Reproduce

npm install -D office-addin-lint // installs eslint-plugin-office-addins and eslint

edit the local project eslint.config.mts file to include the eslint-plugin-office-addins library and then configure eslint to use a non default configuration from the imported plugin from the eslint-plugin-office-addins library.

import eslintPluginOfficeAddins from "eslint-plugin-office-addins";
   ...

export default [
   ...eslintPluginOfficeAddins.configs.react
   ...

Context

  • Operating System: Windows 11 Pro
  • Node version: v22.14.0
  • Office version:
  • Tool version: vscode 1.98.1

Failure Logs

Please include any relevant log snippets, screenshots or code samples here.

Property 'configs' does not exist on type 'typeof import("...<projectName>/node_modules/eslint-plugin-office-addins/lib/main")'.ts(2339)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the generated lib/main.ts.d declaration and the eslint-plugin-office-addins import shown in eslint.config.mts. Compare the declaration with the configs and rules members expected by the issue, then verify the package installation and TypeScript error are resolved when those members are referenced.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.