Skip to content
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

[Feature]: no-annotation lint rule #25694

Open
1 task done
Tracked by #23343
Hotell opened this issue Nov 16, 2022 · 4 comments
Open
1 task done
Tracked by #23343

[Feature]: no-annotation lint rule #25694

Hotell opened this issue Nov 16, 2022 · 4 comments

Comments

@Hotell
Copy link
Contributor

Hotell commented Nov 16, 2022

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

To be able to automate api-access modifiers restrictions we need to create new lint rule.

Previous attempts

We tried to use api-extraction api stripping on Type Level which doesn't work how we want and adds non trivial processing during build time and not very good DX.

Implementation proposal

  • should be configurable to accommodate any kind of JSDoc tag ( in RFC we agreed on @internal , @stable , @unstable for now ).
  • should check any node types except IMPORT*

Rule configuration

{
  "overrides": [
    {
      "files": "**/src/index.{ts,tsx,js}",
      "@fluentui/eslint-plugin/no-annotation": [
        "error",
        {
          "annotations": [
            {
              "tag": "internal"
            }
          ]
        }
      ]
    }
  ]
}

Rule Usage Example

❌ Incorect

// @filename  utils.ts

/**
* @internal
*/
export const notPublicGreeting = 'hello';


// @filename  index.ts

/** @internal **/
export function notPublic(){ }

export {notPublicGreeting} from './utils'

✅ Correct

// @filename  utils.ts

/**
* @internal
*/
export const notPublicGreeting = 'hello';

export function whoAmI(){ return notPublicGreeting }

export function greet(){}


// @filename  index.ts

export { whoAmI } from './utils';
export { greet } from './utils';

Have you discussed this feature with our team

core team

Additional context

No response

Validations

  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@msft-fluent-ui-bot
Copy link
Collaborator

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Apr 15, 2023
@Hotell Hotell reopened this Apr 18, 2023
@microsoft-github-policy-service

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@microsoft-github-policy-service

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@Hotell Hotell reopened this Sep 19, 2023

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants