Skip to content

Commit

Permalink
fix(misc): using flat config should not cause module boundary errors …
Browse files Browse the repository at this point in the history
…when extending from base
  • Loading branch information
jaysoo committed Sep 11, 2024
1 parent 94af427 commit 9b7456c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion packages/eslint/src/generators/init/global-eslint-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,25 @@ export const getGlobalFlatEslintConfiguration = (
if (!rootProject) {
content = addBlockToFlatConfigExport(
content,
generateFlatOverride(moduleBoundariesOverride)
generateFlatOverride({
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [
// This allows a root project to be present without causing lint errors
// since all projects will depend on this base file.
'^.*/eslint.base.config.[cm]?js$',
],
depConstraints: [
{ sourceTag: '*', onlyDependOnLibsWithTags: ['*'] },
],
},
],
} as Linter.RulesRecord,
})
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('@nx/eslint:lint-project', () => {
'error',
{
enforceBuildableLibDependency: true,
allow: [],
allow: ['^.*/eslint.base.config.[cm]?js$'],
depConstraints: [
{
sourceTag: '*',
Expand Down

0 comments on commit 9b7456c

Please sign in to comment.