-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): register @nx plugin internally in order to be ab…
…le to consume our custom @nx/workspace-* lint rules (#30337)
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-eslint-plugin-c8715c3d-52d8-4b79-b0e7-279481b378f0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "chore(eslint-plugin): register @nx plugin internally in order to be able to consume our custom @nx/workspace-* lint rules", | ||
"packageName": "@fluentui/eslint-plugin", | ||
"email": "martinhochel@microsoft.com", | ||
"dependentChangeType": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function shouldRegisterInternal() { | ||
try { | ||
const hasNxEslintPlugin = require.resolve('@nx/eslint-plugin'); | ||
return Boolean(hasNxEslintPlugin); | ||
} catch (err) { | ||
return false; | ||
} | ||
} | ||
|
||
const shouldRegister = shouldRegisterInternal(); | ||
|
||
/** | ||
* @internal | ||
* | ||
* this will be removed after https://github.com/microsoft/fluentui/issues/30332 | ||
* | ||
* expands this with rulesets/overrides that are necessary for specific configs | ||
*/ | ||
const __internal = { | ||
/** | ||
* `@nx/eslint-plugin` is necessary in order to register custom lint rules that live within tools/eslint-rules | ||
*/ | ||
plugins: shouldRegister ? ['@nx'] : [], | ||
}; | ||
|
||
exports.__internal = __internal; |