Skip to content

Commit 8fc5f7e

Browse files
Merge pull request #505 from jogelin/fix-linting
fix(lint): fix linting
2 parents 041d478 + de0b92f commit 8fc5f7e

File tree

16 files changed

+88
-81
lines changed

16 files changed

+88
-81
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{
77
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
88
"rules": {
9+
"@typescript-eslint/no-explicit-any": "warn",
910
"@nx/enforce-module-boundaries": [
1011
"error",
1112
{
@@ -24,7 +25,7 @@
2425
{
2526
"files": ["*.ts", "*.tsx"],
2627
"extends": ["plugin:@nx/typescript"],
27-
"rules": {}
28+
"rules": { "@typescript-eslint/no-explicit-any": "warn" }
2829
},
2930
{
3031
"files": ["*.js", "*.jsx"],

apps/mfe1/src/app/demo/demo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
PlaygroundLibModule,
44
} from '@angular-architects/playground-lib';
55
import { CommonModule } from '@angular/common';
6-
import { Component, OnInit } from '@angular/core';
6+
import { Component } from '@angular/core';
77

88
@Component({
99
standalone: true,

apps/mfe2/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { initFederation } from '@angular-architects/native-federation';
22

33
initFederation('/assets/federation.manifest.json')
44
.catch((err) => console.error(err))
5-
.then((_) => import('./bootstrap'))
5+
.then(() => import('./bootstrap'))
66
.catch((err) => console.error(err));

libs/mf/src/schematics/mf/schematic.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function add(options: MfSchematicSchema): Rule {
3232
}
3333

3434
export function adjustSSR(sourceRoot: string, ssrMappings: string): Rule {
35-
return async function (tree, context) {
35+
return async function (tree) {
3636
const server = path.join(sourceRoot, 'server.ts');
3737

3838
if (!tree.exists(server)) {
@@ -70,7 +70,7 @@ const ssrEngine = new Engine();
7070
}
7171

7272
function makeMainAsync(main: string, options: MfSchematicSchema): Rule {
73-
return async function (tree, context) {
73+
return async function (tree) {
7474
const mainPath = path.dirname(main);
7575
const bootstrapName = path.join(mainPath, 'bootstrap.ts');
7676

@@ -149,7 +149,10 @@ function nxBuildersAvailable(tree: Tree): boolean {
149149
function infereNxBuilderNames(tree: Tree): { dev: string; prod: string } {
150150
const dep = getPackageJsonDependency(tree, '@nx/angular');
151151

152-
const useDevServer = dep && dep.version && semver.satisfies(semver.minVersion(dep.version), '>=17.2.0');
152+
const useDevServer =
153+
dep &&
154+
dep.version &&
155+
semver.satisfies(semver.minVersion(dep.version), '>=17.2.0');
153156

154157
const defaultResult = {
155158
dev: useDevServer
@@ -264,8 +267,7 @@ export default function config(options: MfSchematicSchema): Rule {
264267
projectName,
265268
remotes,
266269
relTsConfigPath,
267-
projectRoot,
268-
port
270+
projectRoot
269271
);
270272
tree.create(configPath, webpackConfig);
271273
} else {

libs/mf/src/schematics/migrate-to-13/schematic.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Rule } from '@angular-devkit/schematics';
22

33
export function index(): Rule {
4-
return async function (tree, context) {
4+
return async function () {
55
console.info(`!!!
6-
Angular 13 compiles bundles as EcmaScript modules.
7-
Hence, we need to adjust how we use Module Federation.
6+
Angular 13 compiles bundles as EcmaScript modules.
7+
Hence, we need to adjust how we use Module Federation.
88
We've got you covered. Please find all information here:
99
https://github.com/angular-architects/module-federation-plugin/blob/main/migration-guide.md
1010
!!!
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
type BootAsyncSchema = {};
1+
type BootAsyncSchema = object;

libs/mf/src/utils/create-config.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ export function createConfig(
44
projectName: string,
55
remotes: string,
66
tsConfigName: string,
7-
root: string,
8-
port: number
7+
root: string
98
): string {
109
return `const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
1110
const mf = require("@angular-architects/module-federation/webpack");
@@ -24,7 +23,7 @@ module.exports = {
2423
},
2524
optimization: {
2625
runtimeChunk: false
27-
},
26+
},
2827
resolve: {
2928
alias: {
3029
...sharedMappings.getAliases(),
@@ -42,22 +41,22 @@ module.exports = {
4241
// filename: "remoteEntry.js",
4342
// exposes: {
4443
// './Component': './${root}/src/app/app.component.ts',
45-
// },
46-
44+
// },
45+
4746
// For hosts (please adjust)
4847
// remotes: {
4948
${remotes}
5049
// },
5150
5251
shared: share({
53-
"@angular/core": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
54-
"@angular/common": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
55-
"@angular/common/http": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
52+
"@angular/core": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
53+
"@angular/common": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
54+
"@angular/common/http": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
5655
"@angular/router": { singleton: true, strictVersion: true, requiredVersion: 'auto' },
5756
5857
...sharedMappings.getDescriptors()
5958
})
60-
59+
6160
}),
6261
sharedMappings.getPlugin()
6362
],

libs/mf/src/utils/share-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ export function share(
296296
return result;
297297
}
298298

299-
function addSecondaries(secondaries: Record<string, SharedConfig>, result: {}) {
299+
function addSecondaries(
300+
secondaries: Record<string, SharedConfig>,
301+
result: object
302+
) {
300303
for (const key in secondaries) {
301304
result[key] = secondaries[key];
302305
}

libs/native-federation-core/src/lib/config/share-utils.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ function findPackageJson(folder: string): string {
6565
);
6666
}
6767

68-
function readVersionMap(packagePath: string): VersionMap {
69-
// eslint-disable-next-line @typescript-eslint/no-var-requires
70-
const json = require(packagePath);
71-
const versions = {
72-
...json['dependencies'],
73-
};
74-
return versions;
75-
}
68+
// TODO: Unused, to delete?
69+
// function readVersionMap(packagePath: string): VersionMap {
70+
// // eslint-disable-next-line @typescript-eslint/no-var-requires
71+
// const json = require(packagePath);
72+
// const versions = {
73+
// ...json['dependencies'],
74+
// };
75+
// return versions;
76+
// }
7677

7778
function lookupVersion(key: string, workspaceRoot: string): string {
7879
const versionMaps = getVersionMaps(workspaceRoot, workspaceRoot);

libs/native-federation-core/src/lib/config/with-native-federation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getMappedPaths, MappedPath } from '../utils/mapped-paths';
2-
import { shareAll, share, findRootTsConfigJson } from './share-utils';
2+
import { shareAll, findRootTsConfigJson } from './share-utils';
33
import {
44
FederationConfig,
55
NormalizedFederationConfig,

0 commit comments

Comments
 (0)