-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
Area: Build SystemArea: LintingFluent UI react-components (v9)Package: eslint-pluginResolution: Soft CloseSoft closing inactive issues over a certain periodSoft closing inactive issues over a certain periodType: Feature
Description
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-extractionapi 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,@unstablefor 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area: Build SystemArea: LintingFluent UI react-components (v9)Package: eslint-pluginResolution: Soft CloseSoft closing inactive issues over a certain periodSoft closing inactive issues over a certain periodType: Feature