-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Library
React Components / v9 (@fluentui/react-components)
Describe the feature that you would like added
ATM any custom eslint rule goes to public @fluentui/eslint-plugin.
This has various issues:
- exposing publicly eslint rules that might be only for internal stuff
- adding technical depth to already very complex configuration within the existing plugin
- authoring rules in vanilla js / no type guarantees within tests
All of these can be mitigated with monorepo internal set of lint rules.
Implementation of internal rules:
new project bootstrapped -> tools/eslint-rules, under the hood this uses nx workspace lint rule resolution.
Registration of internal rules:
As a contrived example let say we implement custom lint rule named uppercase-const
This is how on ca use it in particular project:
{
"rules": {
"@nx/workspace-uppercase-const": "error"
}
}Additional Context
In order to make this work we need @nx/eslint-plugin registered within our monorepo eslint root config which will load these custom rules under the hood.
To make that work we need overhaul of eslint configs within our projects to extend from monorepo root eslint config
{
- "extends": ["plugin:@fluentui/eslint-plugin/react"],
+ "extends": ["../../../.eslintrc", "plugin:@fluentui/eslint-plugin/react"],
- "root": true,
"rules": {
"@nx/workspace-uppercase-const": "warn"
}
}
Tasks:
- bootstrap workspace eslint rules / feat(eslint-rules): bootstrap workspace eslint rules project #30335
- provide workspace eslint rule generator / feat(workspace-plugin): add eslint-rule generator #30336
- implement temporary solution to make workspace lint rules be loaded with existing eslint setup / feat(eslint-plugin): register @nx plugin internally in order to be able to consume our custom @nx/workspace-* lint rules #30337
Have you discussed this feature with our team
v-build
Additional context
No response
Validations
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Priority
None