-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eslint): enforce rules on exports
Dependencies can be accessed directly via exports, and these cases need to be checked against existing rules. The CLI was already detecting such violations, but ESLint missed them. This commit ensures that exports are now properly checked as well.
- Loading branch information
1 parent
a418b7d
commit 883a472
Showing
15 changed files
with
986 additions
and
26 deletions.
There are no files selected for viewing
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
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
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
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
11 changes: 11 additions & 0 deletions
11
test-projects/angular-i/tests/customer-api-re-exports.index.ts
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,11 @@ | ||
import { inject, Injectable } from '@angular/core'; | ||
import { CustomersRepository } from '../data'; | ||
export { bookingsRoutes } from '../../bookings'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class CustomersApi { | ||
repo = inject(CustomersRepository); | ||
get selectedCustomer$() { | ||
return this.repo.selectedCustomer$; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
test-projects/angular-i/tests/expected/re-exports-lint.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,25 @@ | ||
[ | ||
{ | ||
"filePath": "./src/app/customers/api/index.ts", | ||
"messages": [ | ||
{ | ||
"ruleId": "@softarc/sheriff/dependency-rule", | ||
"severity": 2, | ||
"message": "module /src/app/customers/api cannot access /src/app/bookings. Tag domain:customers:api has no clearance for tags domain:bookings, type:feature", | ||
"line": 3, | ||
"column": 1, | ||
"nodeType": "ExportNamedDeclaration", | ||
"endLine": 3, | ||
"endColumn": 49 | ||
} | ||
], | ||
"suppressedMessages": [], | ||
"errorCount": 1, | ||
"fatalErrorCount": 0, | ||
"warningCount": 0, | ||
"fixableErrorCount": 0, | ||
"fixableWarningCount": 0, | ||
"source": "import { inject, Injectable } from '@angular/core';\nimport { CustomersRepository } from '../data';\nexport { bookingsRoutes } from '../../bookings';\n\n@Injectable({ providedIn: 'root' })\nexport class CustomersApi {\n repo = inject(CustomersRepository);\n get selectedCustomer$() {\n return this.repo.selectedCustomer$;\n }\n}\n", | ||
"usedDeprecatedRules": [] | ||
} | ||
] |
Oops, something went wrong.