Skip to content

Commit f4ea8a6

Browse files
committed
fix linting errors
1 parent afc5b1d commit f4ea8a6

File tree

9 files changed

+29
-19
lines changed

9 files changed

+29
-19
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# /node_modules and /bower_components ignored by default
2+
dist/
23
.git/
34
tmp/
45
typings/

addon/ng2/commands/github-pages-deploy.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import CreateGithubRepo from '../tasks/create-github-repo';
1212
import { CliConfig } from '../models/config';
1313
import { oneLine } from 'common-tags';
1414

15-
const fsReadFile = <any>denodeify(fs.readFile);
16-
const fsWriteFile = <any>denodeify(fs.writeFile);
1715
const fsReadDir = <any>denodeify(fs.readdir);
1816
const fsCopy = <any>denodeify(fse.copy);
1917

addon/ng2/commands/init.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,57 +47,61 @@ const InitCommand: any = Command.extend({
4747
commandOptions.skipBower = true;
4848
}
4949

50-
var installBlueprint = new this.tasks.InstallBlueprint({
50+
const installBlueprint = new this.tasks.InstallBlueprint({
5151
ui: this.ui,
5252
analytics: this.analytics,
5353
project: this.project
5454
});
5555

5656
// needs an explicit check in case it's just 'undefined'
5757
// due to passing of options from 'new' and 'addon'
58+
let gitInit;
5859
if (commandOptions.skipGit === false) {
59-
var gitInit = new GitInit({
60+
gitInit = new GitInit({
6061
ui: this.ui,
6162
project: this.project
6263
});
6364
}
6465

66+
let linkCli;
6567
if (commandOptions.linkCli) {
66-
var linkCli = new LinkCli({
68+
linkCli = new LinkCli({
6769
ui: this.ui,
6870
analytics: this.analytics,
6971
project: this.project
7072
});
7173
}
7274

75+
let npmInstall;
7376
if (!commandOptions.skipNpm) {
74-
var npmInstall = new NpmInstall({
77+
npmInstall = new NpmInstall({
7578
ui: this.ui,
7679
analytics: this.analytics,
7780
project: this.project
7881
});
7982
}
8083

84+
let bowerInstall;
8185
if (!commandOptions.skipBower) {
82-
var bowerInstall = new this.tasks.BowerInstall({
86+
bowerInstall = new this.tasks.BowerInstall({
8387
ui: this.ui,
8488
analytics: this.analytics,
8589
project: this.project
8690
});
8791
}
8892

89-
var project = this.project;
90-
var packageName = commandOptions.name !== '.' && commandOptions.name || project.name();
93+
const project = this.project;
94+
const packageName = commandOptions.name !== '.' && commandOptions.name || project.name();
9195

9296
if (!packageName) {
93-
var message = 'The `ng ' + this.name + '` command requires a ' +
97+
const message = 'The `ng ' + this.name + '` command requires a ' +
9498
'package.json in current folder with name attribute or a specified name via arguments. ' +
9599
'For more details, use `ng help`.';
96100

97101
return Promise.reject(new SilentError(message));
98102
}
99103

100-
var blueprintOpts = {
104+
const blueprintOpts = {
101105
dryRun: commandOptions.dryRun,
102106
blueprint: commandOptions.blueprint || this._defaultBlueprint(),
103107
rawName: packageName,

addon/ng2/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030

3131
// Configuration.
3232
'set': require('./commands/set').default,
33-
'get': require('./commands/get').default,
33+
'get': require('./commands/get').default
3434
};
3535
}
3636
};

addon/ng2/models/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class CliConfig<JsonType> {
7676

7777
let content: T;
7878
let schema: Object;
79-
let others : T[];
79+
let others: T[];
8080

8181
try {
8282
content = JSON.parse(configContent);

addon/ng2/models/json-schema/schema-class-factory.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ export interface SchemaClass<JsonType> extends Object {
7272
class SchemaClassBase<T> implements SchemaClass<T> {
7373
constructor(schema: Object, value: T, ...fallbacks: T[]) {
7474
(this as any)[kOriginalRoot] = value;
75+
const forward = fallbacks.length > 0
76+
? (new SchemaClassBase<T>(schema, fallbacks.pop(), ...fallbacks).$$schema())
77+
: null;
7578
(this as any)[kSchemaNode] = new RootSchemaTreeNode(this, {
76-
forward: fallbacks.length > 0 ? (new SchemaClassBase<T>(schema, fallbacks.pop(), ...fallbacks).$$schema()) : null,
79+
forward,
7780
value,
7881
schema
7982
});

addon/ng2/models/json-schema/serializer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export abstract class Serializer {
3737

3838

3939
interface JsonSerializerState {
40-
empty?: boolean,
41-
type?: string,
42-
property?: boolean
40+
empty?: boolean;
41+
type?: string;
42+
property?: boolean;
4343
}
4444

4545
class JsonSerializer implements Serializer {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"test:packages": "node scripts/run-packages-spec.js",
2020
"build-config-interface": "dtsgen lib/config/schema.json --out lib/config/schema.d.ts",
2121
"eslint": "eslint .",
22-
"tslint": "tslint \"**/*.ts\" -c tslint.json -e \"**/blueprints/*/files/**/*.ts\" -e \"node_modules/**\" -e \"tmp/**\"",
22+
"tslint": "tslint '**/*.ts' -c tslint.json -e '**/blueprints/*/files/**/*.ts' -e 'node_modules/**' -e 'tmp/**' -e 'dist/**'",
2323
"lint": "npm-run-all -c eslint tslint"
2424
},
2525
"repository": {

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@
2424
"@angular-cli/ast-tools": [ "./packages/ast-tools/src" ],
2525
"@angular-cli/webpack": [ "./packages/webpack/src" ]
2626
}
27-
}
27+
},
28+
"exclude": [
29+
"dist/**/*",
30+
"tmp/**/*"
31+
]
2832
}

0 commit comments

Comments
 (0)