Skip to content

Commit

Permalink
Merge pull request #966 from stanimirovv/fix/lint
Browse files Browse the repository at this point in the history
Fix npm run lint command
  • Loading branch information
kamilmysliwiec committed Mar 7, 2022
2 parents 93e1203 + a24bf15 commit d105de5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Expand Up @@ -9,7 +9,6 @@ module.exports = {
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
],
root: true,
env: {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/application/application.factory.ts
Expand Up @@ -8,7 +8,7 @@ import {
template,
url,
} from '@angular-devkit/schematics';
import { basename, parse, delimiter } from 'path';
import { basename, parse } from 'path';
import {
DEFAULT_AUTHOR,
DEFAULT_DESCRIPTION,
Expand Down
11 changes: 3 additions & 8 deletions src/lib/library/library.factory.ts
@@ -1,9 +1,4 @@
import {
join,
normalize,
Path,
strings,
} from '@angular-devkit/core';
import { join, normalize, Path, strings } from '@angular-devkit/core';
import {
apply,
branchAndMerge,
Expand All @@ -17,7 +12,7 @@ import {
Tree,
url,
} from '@angular-devkit/schematics';
import { parse } from "jsonc-parser"
import { parse } from 'jsonc-parser';
import {
DEFAULT_LANGUAGE,
DEFAULT_LIB_PATH,
Expand Down Expand Up @@ -178,7 +173,7 @@ function updateJsonFile<T>(
if (source) {
const sourceText = source.toString('utf-8');
const json = parse(sourceText);
callback((json as {}) as T);
callback(json as unknown as T);
host.overwrite(path, JSON.stringify(json, null, 2));
}
return host;
Expand Down
24 changes: 9 additions & 15 deletions src/lib/sub-app/sub-app.factory.ts
@@ -1,9 +1,4 @@
import {
join,
normalize,
Path,
strings,
} from '@angular-devkit/core';
import { join, normalize, Path, strings } from '@angular-devkit/core';
import {
apply,
branchAndMerge,
Expand All @@ -18,11 +13,11 @@ import {
Tree,
url,
} from '@angular-devkit/schematics';
import { parse } from "jsonc-parser"
import * as fse from 'fs-extra';
import { parse } from 'jsonc-parser';
import {
DEFAULT_APP_NAME,
DEFAULT_APPS_PATH,
DEFAULT_APP_NAME,
DEFAULT_DIR_ENTRY_APP,
DEFAULT_LANGUAGE,
DEFAULT_LIB_PATH,
Expand Down Expand Up @@ -120,7 +115,7 @@ function updateJsonFile<T>(
if (source) {
const sourceText = source.toString('utf-8');
const json = parse(sourceText);
callback((json as {}) as T);
callback(json as unknown as T);
host.overwrite(path, JSON.stringify(json, null, 2));
}
return host;
Expand Down Expand Up @@ -188,9 +183,9 @@ function updateNpmScripts(
defaultAppName,
defaultTestDir,
);
scripts[defaultTestScriptName] = (scripts[
defaultTestScriptName
] as string).replace(defaultTestDir, newTestDir);
scripts[defaultTestScriptName] = (
scripts[defaultTestScriptName] as string
).replace(defaultTestDir, newTestDir);
}
if (
scripts[defaultFormatScriptName] &&
Expand Down Expand Up @@ -224,9 +219,8 @@ function updateJestOptions(
jestOptions.roots.push(jestSourceRoot);

const originalSourceRoot = `<rootDir>/src/`;
const originalSourceRootIndex = jestOptions.roots.indexOf(
originalSourceRoot,
);
const originalSourceRootIndex =
jestOptions.roots.indexOf(originalSourceRoot);
if (originalSourceRootIndex >= 0) {
(jestOptions.roots as string[]).splice(originalSourceRootIndex, 1);
}
Expand Down
6 changes: 4 additions & 2 deletions src/utils/metadata.manager.ts
Expand Up @@ -32,7 +32,9 @@ export class MetadataManager {
);
const decoratorNodes: Node[] = this.getDecoratorMetadata(source, '@Module');
const node: Node = decoratorNodes[0];
const matchingProperties: ObjectLiteralElement[] = (node as ObjectLiteralExpression).properties
const matchingProperties: ObjectLiteralElement[] = (
node as ObjectLiteralExpression
).properties
.filter((prop) => prop.kind === SyntaxKind.PropertyAssignment)
.filter((prop: PropertyAssignment) => {
const name = prop.name;
Expand Down Expand Up @@ -170,7 +172,7 @@ export class MetadataManager {
node = arrLiteral.elements;
}
if (Array.isArray(node)) {
const nodeArray = (node as {}) as Node[];
const nodeArray = node as unknown as Node[];
const symbolsArray = nodeArray.map((childNode) =>
childNode.getText(source),
);
Expand Down

0 comments on commit d105de5

Please sign in to comment.