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
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.
Implementation proposal
@internal,@stable,@unstablefor now ).IMPORT*Rule configuration
{ "overrides": [ { "files": "**/src/index.{ts,tsx,js}", "@fluentui/eslint-plugin/no-annotation": [ "error", { "annotations": [ { "tag": "internal" } ] } ] } ] }Rule Usage Example
❌ Incorect
✅ Correct
Have you discussed this feature with our team
core team
Additional context
No response
Validations