Skip to content

Commit 3825f21

Browse files
committed
style(lint): lint all files again
1 parent 4774abe commit 3825f21

12 files changed

+103
-118
lines changed

.eslintrc.json

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
{
2-
"parserOptions": {
3-
"ecmaVersion": 6,
4-
"ecmaFeatures": {
5-
"experimentalObjectRestSpread": true
6-
}
7-
},
8-
"env": {
9-
"node": true,
10-
"mocha": true,
11-
"es6": true
12-
},
13-
"extends": "eslint:recommended",
14-
"rules": {
15-
"indent": [
16-
"error",
17-
2
18-
],
19-
"quotes": [
20-
"error",
21-
"single"
22-
],
23-
"semi": [
24-
"error",
25-
"always"
26-
]
2+
"parserOptions": {
3+
"ecmaVersion": 6,
4+
"ecmaFeatures": {
5+
"experimentalObjectRestSpread": true
276
}
28-
}
7+
},
8+
"env": {
9+
"node": true,
10+
"mocha": true,
11+
"es6": true
12+
},
13+
"extends": "eslint:recommended"
14+
}

.prettierrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"singleQuote": true
3-
}
2+
"singleQuote": true,
3+
"semi": true,
4+
"tabWidth": 2,
5+
"useTabs": false,
6+
"printWidth": 80
7+
}

src/CancellationToken.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ export class CancellationToken {
1515
lastCancellationCheckTime: number;
1616
constructor(cancellationFileName: string, isCancelled: boolean) {
1717
this.isCancelled = !!isCancelled;
18-
this.cancellationFileName = cancellationFileName || crypto.randomBytes(64).toString('hex');
18+
this.cancellationFileName =
19+
cancellationFileName || crypto.randomBytes(64).toString('hex');
1920
this.lastCancellationCheckTime = 0;
2021
}
2122

2223
static createFromJSON(json: CancellationTokenData) {
23-
return new CancellationToken(
24-
json.cancellationFileName,
25-
json.isCancelled
26-
);
24+
return new CancellationToken(json.cancellationFileName, json.isCancelled);
2725
}
2826

2927
toJSON() {

src/FilesWatcher.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ export class FilesWatcher {
2424
}
2525

2626
this.watchers = this.watchPaths.map((watchPath: string) => {
27-
return chokidar.watch(
28-
watchPath,
29-
{ persistent: true, alwaysStat: true }
30-
)
27+
return chokidar
28+
.watch(watchPath, { persistent: true, alwaysStat: true })
3129
.on('change', (filePath: string, stats: any) => {
3230
if (this.isFileSupported(filePath)) {
3331
(this.listeners['change'] || []).forEach(changeListener => {
@@ -67,7 +65,9 @@ export class FilesWatcher {
6765

6866
off(event: string, listener: Function) {
6967
if (this.listeners[event]) {
70-
this.listeners[event] = this.listeners[event].filter(oldListener => oldListener !== listener);
68+
this.listeners[event] = this.listeners[event].filter(
69+
oldListener => oldListener !== listener
70+
);
7171
}
7272
}
7373
}

src/Message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NormalizedMessage } from './NormalizedMessage';
22

33
export interface Message {
4-
diagnostics: NormalizedMessage[];
5-
lints: NormalizedMessage[];
4+
diagnostics: NormalizedMessage[];
5+
lints: NormalizedMessage[];
66
}

src/WorkResult.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export class WorkResult {
1515

1616
set(workName: number, result: any) {
1717
if (!this.supports(workName)) {
18-
throw new Error('Cannot set result - work "' + workName + '" is not supported.');
18+
throw new Error(
19+
'Cannot set result - work "' + workName + '" is not supported.'
20+
);
1921
}
2022

2123
this.workResult[workName] = result;
@@ -27,7 +29,9 @@ export class WorkResult {
2729

2830
get(workName: number) {
2931
if (!this.supports(workName)) {
30-
throw new Error('Cannot get result - work "' + workName + '" is not supported.');
32+
throw new Error(
33+
'Cannot get result - work "' + workName + '" is not supported.'
34+
);
3135
}
3236

3337
return this.workResult[workName];

src/WorkSet.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ export class WorkSet {
88
workBegin: number;
99
workEnd: number;
1010

11-
constructor(workDomain: ReadonlyArray<ts.SourceFile> | string[], workNumber: number, workDivision: number) {
11+
constructor(
12+
workDomain: ReadonlyArray<ts.SourceFile> | string[],
13+
workNumber: number,
14+
workDivision: number
15+
) {
1216
this.workDomain = workDomain;
1317
this.workNumber = workNumber;
1418
this.workDivision = workDivision;

src/cluster.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@ const workers: childProcess.ChildProcess[] = [];
1212

1313
for (let num = 0; num < division; num++) {
1414
workers.push(
15-
childProcess.fork(
16-
path.resolve(__dirname, './service.js'),
17-
[],
18-
{
19-
execArgv: ['--max-old-space-size=' + process.env.MEMORY_LIMIT],
20-
env: Object.assign({}, process.env, { WORK_NUMBER: num }),
21-
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
22-
}
23-
)
15+
childProcess.fork(path.resolve(__dirname, './service.js'), [], {
16+
execArgv: ['--max-old-space-size=' + process.env.MEMORY_LIMIT],
17+
env: Object.assign({}, process.env, { WORK_NUMBER: num }),
18+
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
19+
})
2420
);
2521
}
2622

@@ -46,13 +42,10 @@ process.on('message', (message: Message) => {
4642
workers.forEach(worker => {
4743
worker.on('message', (message: Message) => {
4844
// set result from worker
49-
result.set(
50-
worker.pid,
51-
{
52-
diagnostics: message.diagnostics.map(NormalizedMessage.createFromJSON),
53-
lints: message.lints.map(NormalizedMessage.createFromJSON)
54-
}
55-
);
45+
result.set(worker.pid, {
46+
diagnostics: message.diagnostics.map(NormalizedMessage.createFromJSON),
47+
lints: message.lints.map(NormalizedMessage.createFromJSON)
48+
});
5649

5750
// if we have result from all workers, send merged
5851
if (result.hasAll()) {

src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function run(cancellationToken: CancellationToken) {
4646
}
4747
}
4848

49-
process.on('message', (message) => {
49+
process.on('message', message => {
5050
run(CancellationToken.createFromJSON(message));
5151
});
5252

src/tsconfig.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"noImplicitAny": true,
5-
"noImplicitReturns": true,
6-
"noImplicitThis": true,
7-
"noUnusedLocals": true,
8-
"noUnusedParameters": true,
9-
"suppressImplicitAnyIndexErrors": true,
10-
"strictNullChecks": false,
11-
"lib": [
12-
"es5", "es2015.core", "dom"
13-
],
14-
"module": "commonjs",
15-
"moduleResolution": "node",
16-
"declaration": true,
17-
"outDir": "../lib",
18-
"declarationDir": "../lib/types"
19-
}
20-
}
2+
"compilerOptions": {
3+
"target": "es5",
4+
"noImplicitAny": true,
5+
"noImplicitReturns": true,
6+
"noImplicitThis": true,
7+
"noUnusedLocals": true,
8+
"noUnusedParameters": true,
9+
"suppressImplicitAnyIndexErrors": true,
10+
"strictNullChecks": false,
11+
"lib": ["es5", "es2015.core", "dom"],
12+
"module": "commonjs",
13+
"moduleResolution": "node",
14+
"declaration": true,
15+
"outDir": "../lib",
16+
"declarationDir": "../lib/types"
17+
}
18+
}

0 commit comments

Comments
 (0)