Skip to content

Commit d105de5

Browse files
Merge pull request #966 from stanimirovv/fix/lint
Fix npm run lint command
2 parents 93e1203 + a24bf15 commit d105de5

File tree

5 files changed

+17
-27
lines changed

5 files changed

+17
-27
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module.exports = {
99
'plugin:@typescript-eslint/eslint-recommended',
1010
'plugin:@typescript-eslint/recommended',
1111
'prettier',
12-
'prettier/@typescript-eslint',
1312
],
1413
root: true,
1514
env: {

src/lib/application/application.factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
template,
99
url,
1010
} from '@angular-devkit/schematics';
11-
import { basename, parse, delimiter } from 'path';
11+
import { basename, parse } from 'path';
1212
import {
1313
DEFAULT_AUTHOR,
1414
DEFAULT_DESCRIPTION,

src/lib/library/library.factory.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
join,
3-
normalize,
4-
Path,
5-
strings,
6-
} from '@angular-devkit/core';
1+
import { join, normalize, Path, strings } from '@angular-devkit/core';
72
import {
83
apply,
94
branchAndMerge,
@@ -17,7 +12,7 @@ import {
1712
Tree,
1813
url,
1914
} from '@angular-devkit/schematics';
20-
import { parse } from "jsonc-parser"
15+
import { parse } from 'jsonc-parser';
2116
import {
2217
DEFAULT_LANGUAGE,
2318
DEFAULT_LIB_PATH,
@@ -178,7 +173,7 @@ function updateJsonFile<T>(
178173
if (source) {
179174
const sourceText = source.toString('utf-8');
180175
const json = parse(sourceText);
181-
callback((json as {}) as T);
176+
callback(json as unknown as T);
182177
host.overwrite(path, JSON.stringify(json, null, 2));
183178
}
184179
return host;

src/lib/sub-app/sub-app.factory.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
join,
3-
normalize,
4-
Path,
5-
strings,
6-
} from '@angular-devkit/core';
1+
import { join, normalize, Path, strings } from '@angular-devkit/core';
72
import {
83
apply,
94
branchAndMerge,
@@ -18,11 +13,11 @@ import {
1813
Tree,
1914
url,
2015
} from '@angular-devkit/schematics';
21-
import { parse } from "jsonc-parser"
2216
import * as fse from 'fs-extra';
17+
import { parse } from 'jsonc-parser';
2318
import {
24-
DEFAULT_APP_NAME,
2519
DEFAULT_APPS_PATH,
20+
DEFAULT_APP_NAME,
2621
DEFAULT_DIR_ENTRY_APP,
2722
DEFAULT_LANGUAGE,
2823
DEFAULT_LIB_PATH,
@@ -120,7 +115,7 @@ function updateJsonFile<T>(
120115
if (source) {
121116
const sourceText = source.toString('utf-8');
122117
const json = parse(sourceText);
123-
callback((json as {}) as T);
118+
callback(json as unknown as T);
124119
host.overwrite(path, JSON.stringify(json, null, 2));
125120
}
126121
return host;
@@ -188,9 +183,9 @@ function updateNpmScripts(
188183
defaultAppName,
189184
defaultTestDir,
190185
);
191-
scripts[defaultTestScriptName] = (scripts[
192-
defaultTestScriptName
193-
] as string).replace(defaultTestDir, newTestDir);
186+
scripts[defaultTestScriptName] = (
187+
scripts[defaultTestScriptName] as string
188+
).replace(defaultTestDir, newTestDir);
194189
}
195190
if (
196191
scripts[defaultFormatScriptName] &&
@@ -224,9 +219,8 @@ function updateJestOptions(
224219
jestOptions.roots.push(jestSourceRoot);
225220

226221
const originalSourceRoot = `<rootDir>/src/`;
227-
const originalSourceRootIndex = jestOptions.roots.indexOf(
228-
originalSourceRoot,
229-
);
222+
const originalSourceRootIndex =
223+
jestOptions.roots.indexOf(originalSourceRoot);
230224
if (originalSourceRootIndex >= 0) {
231225
(jestOptions.roots as string[]).splice(originalSourceRootIndex, 1);
232226
}

src/utils/metadata.manager.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export class MetadataManager {
3232
);
3333
const decoratorNodes: Node[] = this.getDecoratorMetadata(source, '@Module');
3434
const node: Node = decoratorNodes[0];
35-
const matchingProperties: ObjectLiteralElement[] = (node as ObjectLiteralExpression).properties
35+
const matchingProperties: ObjectLiteralElement[] = (
36+
node as ObjectLiteralExpression
37+
).properties
3638
.filter((prop) => prop.kind === SyntaxKind.PropertyAssignment)
3739
.filter((prop: PropertyAssignment) => {
3840
const name = prop.name;
@@ -170,7 +172,7 @@ export class MetadataManager {
170172
node = arrLiteral.elements;
171173
}
172174
if (Array.isArray(node)) {
173-
const nodeArray = (node as {}) as Node[];
175+
const nodeArray = node as unknown as Node[];
174176
const symbolsArray = nodeArray.map((childNode) =>
175177
childNode.getText(source),
176178
);

0 commit comments

Comments
 (0)