Skip to content

Bug: [no-deprecated] doesn't work on export/re-export statements #11197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
Hotell opened this issue May 9, 2025 · 1 comment · Fixed by microsoft/fluentui#34443
Open
4 tasks done

Bug: [no-deprecated] doesn't work on export/re-export statements #11197

Hotell opened this issue May 9, 2025 · 1 comment · Fixed by microsoft/fluentui#34443
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@Hotell
Copy link
Contributor

Hotell commented May 9, 2025

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

no-deprecate won't process re-exports and ignores them completely.

Our barrel file contains re-exports from sub-packages, which some are deprecated and thus need to be disabled inline ( e.g. https://github.com/microsoft/fluentui/blob/master/packages/react-components/react-components/src/index.ts#L106 )

Recently we migrated from https://github.com/gund/eslint-plugin-deprecation to official no-deprecate rule, but it appears the feature parity is not 100%.

Example 1:

All following APIs contain @deprecated pragma but nothing is being reported

// @filename react-components/src/index.ts

export {
  InfoButton,
  infoButtonClassNames,
  renderInfoButton_unstable,
  useInfoButtonStyles_unstable,
  useInfoButton_unstable,
} from '@fluentui/react-infobutton';
export type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from '@fluentui/react-infobutton';
showcase of re-exported apis containing @deprecated jsdoc pragma

Example 2:

Wrong report for implicit inline no-deprecate

/Users/fluentui/packages/react-components/react-components/src/index.ts
  106:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  111:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  118:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  137:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  140:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  244:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  377:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  565:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  581:3   warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')
  633:34  warning  Unused eslint-disable directive (no problems were reported from '@typescript-eslint/no-deprecated')

Reproduction Repository Link

https://github.com/microsoft/fluentui

Repro Steps

  1. clone the repo
  2. yarn install
  3. yarn nx run react-components:lint

NOTE: we use ESLINT_USE_FLAT_CONFIG=false under the hood

Versions

package version
@typescript-eslint/eslint-plugin 8.32.0
@typescript-eslint/parser 8.32.0
@typescript-eslint/scope-manager 8.32.0
@typescript-eslint/typescript-estree 8.32.0
@typescript-eslint/type-utils 8.32.0
@typescript-eslint/utils 8.32.0
TypeScript 5.3.3
ESLint 9.17.0
node 20

Related issues:

@Hotell Hotell added bug Something isn't working triage Waiting for team members to take a look labels May 9, 2025
@JoshuaKGoldberg JoshuaKGoldberg changed the title Bug: [no-deprecate] doesn't work on export/re-export statements Bug: [no-deprecated] doesn't work on export/re-export statements May 12, 2025
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin and removed triage Waiting for team members to take a look labels May 12, 2025
@bradzacher bradzacher reopened this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
3 participants