Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Update TSlint version
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-gross committed Nov 20, 2016
1 parent b37db7b commit 1a05d19
Show file tree
Hide file tree
Showing 43 changed files with 104 additions and 104 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"npm-check-updates": "2.8.6",
"spectron": "3.4.0",
"ts-node": "1.7.0",
"tslint": "4.0.0",
"tslint": "4.0.1",
"typescript": "2.0.9"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/ANSIParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface HandlerResult {
}

const SGR: { [indexer: string]: (attributes: Attributes) => Attributes } = {
0: (attributes: Attributes) => defaultAttributes,
0: (_attributes: Attributes) => defaultAttributes,
1: (attributes: Attributes) => assign(attributes, {brightness: Brightness.Bright}),
2: (attributes: Attributes) => assign(attributes, {weight: Weight.Faint}),
4: (attributes: Attributes) => assign(attributes, {underline: true}),
Expand Down Expand Up @@ -328,7 +328,7 @@ export class ANSIParser {
};
}

private csiHandler(collected: any, rawParams: number[] | number, flag: string): HandlerResult {
private csiHandler(_collected: any, rawParams: number[] | number, flag: string): HandlerResult {
let short = "";
let long = "";
let url = "";
Expand Down
7 changes: 4 additions & 3 deletions src/Autocompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export const getSuggestions = async(job: Job, caretPosition: number) => {
aliases: job.session.aliases,
});

const applicableSuggestions = _.uniqBy([...firstThreeFromHistory, ...suggestions, ...remainderFromHistory], suggestion => suggestion.value).filter(suggestion =>
suggestion.value.toLowerCase().startsWith(node.value.toLowerCase())
);
const applicableSuggestions = _.uniqBy(
[...firstThreeFromHistory, ...suggestions, ...remainderFromHistory],
suggestion => suggestion.value,
).filter(suggestion => suggestion.value.toLowerCase().startsWith(node.value.toLowerCase()));

if (applicableSuggestions.length === 1) {
const suggestion = applicableSuggestions[0];
Expand Down
2 changes: 1 addition & 1 deletion src/Char.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const attributesFlyweight = _.memoize(
const ordered: Dictionary<any> = {};
Object.keys(attributes).sort().forEach(key => ordered[key] = attributes[key]);
return JSON.stringify(ordered);
}
},
);

export const defaultAttributes = Object.freeze({
Expand Down
6 changes: 3 additions & 3 deletions src/Decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ export function memoize(resolver: Function | undefined = undefined) {
resolver = (...args: any[]) => JSON.stringify(args);
}

return (target: any, name: string, descriptor: TypedPropertyDescriptor<any>) => {
return (_target: any, _name: string, descriptor: TypedPropertyDescriptor<any>) => {
descriptor.value = _.memoize(descriptor.value, resolver);

return descriptor;
};
}

export const memoizeAccessor = <T>(target: Object, name: string | symbol, descriptor: TypedPropertyDescriptor<T>) => {
export const memoizeAccessor = <T>(_target: Object, name: string | symbol, descriptor: TypedPropertyDescriptor<T>) => {
const memoizedPropertyName = `__memoized_${name}`;
const originalGetter = descriptor.get;

Expand All @@ -28,7 +28,7 @@ export const memoizeAccessor = <T>(target: Object, name: string | symbol, descri
};

export function debounce(wait: number = 0) {
return (target: any, name: string, descriptor: PropertyDescriptor) => {
return (_target: any, _name: string, descriptor: PropertyDescriptor) => {
descriptor.value = _.debounce(descriptor.value, wait);

return descriptor;
Expand Down
2 changes: 1 addition & 1 deletion src/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export enum Status {

export enum ScreenBufferType {
Standard,
Alternate
Alternate,
}

export enum Weight {
Expand Down
4 changes: 2 additions & 2 deletions src/PTY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function executeCommand(
command: string,
args: string[] = [],
directory: string,
execOptions?: any
execOptions?: any,
): Promise<string> {
return new Promise((resolve, reject) => {
const options = Object.assign(
Expand All @@ -67,7 +67,7 @@ export function executeCommand(
{
env: _.extend({PWD: directory}, process.env),
cwd: directory,
}
},
);

ChildProcess.exec(`${command} ${args.join(" ")}`, options, (error, output) => {
Expand Down
10 changes: 5 additions & 5 deletions src/ScreenBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class ScreenBuffer extends events.EventEmitter {
let char: Char = storage.getIn(cursorCoordinates);
storage = storage.setIn(
cursorCoordinates,
Char.flyweight(char.toString(), assign(char.attributes, {cursor: true}))
Char.flyweight(char.toString(), assign(char.attributes, {cursor: true})),
);
}

Expand Down Expand Up @@ -167,7 +167,7 @@ export class ScreenBuffer extends events.EventEmitter {
this.storage = this.storage.update(
this.cursorPosition.row,
List<Char>(),
(row: List<Char>) => row.splice(this.cursorPosition.column, n).toList()
(row: List<Char>) => row.splice(this.cursorPosition.column, n).toList(),
);
}
this.emitData();
Expand All @@ -180,7 +180,7 @@ export class ScreenBuffer extends events.EventEmitter {
this.storage = this.storage.update(
this.cursorPosition.row,
List<Char>(),
(row: List<Char>) => row.splice(this.cursorPosition.column, 0, nSpace).toList()
(row: List<Char>) => row.splice(this.cursorPosition.column, 0, nSpace).toList(),
);
}
this.emitData();
Expand All @@ -193,7 +193,7 @@ export class ScreenBuffer extends events.EventEmitter {
List<Char>(),
(row: List<Char>) => row.take(this.cursorPosition.column)
.concat(Array(n).fill(Char.empty), row.skip(this.cursorPosition.column + n))
.toList()
.toList(),
);
}
this.emitData();
Expand All @@ -209,7 +209,7 @@ export class ScreenBuffer extends events.EventEmitter {
this.storage = this.storage.update(
this.cursorPosition.row,
List<Char>(),
(row: List<Char>) => row.take(this.cursorPosition.column).toList()
(row: List<Char>) => row.take(this.cursorPosition.column).toList(),
);
}
this.emitData();
Expand Down
2 changes: 1 addition & 1 deletion src/main/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app.on("ready", () => {
browserWindow.focus();
});

app.on("open-file", (event, file) => browserWindow.webContents.send("change-working-directory", file));
app.on("open-file", (_event, file) => browserWindow.webContents.send("change-working-directory", file));
});

app.on("window-all-closed", () => app.quit());
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/GitBranch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class GitBranchComponent extends React.Component<GitBranchProps, GitBranchState>
this.setState({ failReason: e.message } as GitBranchState);
}
}}>Delete</Button>
</div>
</div>,
)}
</div>
</div>;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/GitStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const GitStatusFile: React.StatelessComponent<GitStatusFileProps> = ({
<Link absolutePath={absolutePath}>{path}</Link>
</span>
{buttons.map(({buttonText, action}, index) =>
<Button key={index.toString()} onClick={action}>{buttonText}</Button>
<Button key={index.toString()} onClick={action}>{buttonText}</Button>,
)}
</div>;
};
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/GitWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ class GitWatcher extends EventEmitter {

this.watcher.on(
"change",
(type: string, fileName: string) => {
(_type: string, fileName: string) => {
if (!fileName.startsWith(".git") ||
fileName === this.GIT_HEAD_FILE_NAME ||
fileName.startsWith(this.GIT_HEADS_DIRECTORY_NAME)) {
this.updateGitData();
}
}
},
);
} else {
const data: VcsData = { kind: "not-repository" };
Expand Down Expand Up @@ -145,7 +145,7 @@ interface WatchesValue {
class WatchManager implements EnvironmentObserverPlugin {
directoryToDetails: Map<string, WatchesValue> = new Map();

presentWorkingDirectoryWillChange(session: Session, newDirectory: string) {
presentWorkingDirectoryWillChange(session: Session, _newDirectory: string) {
const oldDirectory = session.directory;

if (!this.directoryToDetails.has(oldDirectory)) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/Ls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import Link from "../utils/Link";

type Props = {
files: any[],
}
};

type State = {
itemWidth: number | undefined,
}
};

const renderFile = (file: any, itemWidth = 0, key: number) => {
const style: CSSObject = {display: "inline-block"};
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/ManPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {v4} from "uuid";

type Props = {
man: string,
}
};

type State = {
html: undefined | string,
uniqueId: string,
}
};

const postprocesManHTML = (element: HTMLElement, uniqueId: string) => {
Array.prototype.slice.call(element.getElementsByTagName("a")).forEach((link: any) => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/PWDOperatingSystemIntegrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {remote} from "electron";
PluginManager.registerEnvironmentObserver({
presentWorkingDirectoryWillChange: () => { /* do nothing */ },

presentWorkingDirectoryDidChange: (session: Session, directory: string) => {
presentWorkingDirectoryDidChange: (_session: Session, directory: string) => {
remote.app.addRecentDocument(directory);
},
});
2 changes: 1 addition & 1 deletion src/plugins/autocompletion_providers/Brew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getFormulae = memoize(
}
return [];
},
(brewArgs: string[]) => brewArgs.join(" ")
(brewArgs: string[]) => brewArgs.join(" "),
);

const getAllFormulae = (cask: boolean) => getFormulae(cask ? ["cask", "search"] : ["search"]);
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/autocompletion_providers/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,13 @@ const commands = contextIndependent(async(): Promise<Suggestion[]> => {
return [];
});

const aliases = contextIndependent(() => Git.aliases(process.env.HOME).then(variables =>
variables.map(variable => new Suggestion({
const aliases = contextIndependent(() => Git.aliases(process.env.HOME).then(
variables => variables.map(variable => new Suggestion({
value: variable.name,
synopsis: variable.value,
style: styles.alias,
space: true,
}))
})),
));

const expandAlias = async(name: string): Promise<string> => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/autocompletion_providers/Grep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const baseOptions = combine(mapObject(
return mapSuggestions(longFlag(option),
suggestion => suggestion.withDescription(info.description));
}
}
},
));

const extendedRegexOption = combine([
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/autocompletion_providers/Ps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const shortOptions = combine(mapObject(
(option, info) => {
return mapSuggestions(shortFlag(option),
suggestion => suggestion.withDescription(info.description));
}
},
));


Expand Down Expand Up @@ -111,7 +111,7 @@ const processSuggestions = async(context: AutocompletionContext): Promise<Sugges
return processes
.filter(i => !arg.params.includes(i.pid))
.map(i => new Suggestion({value: arg.start + i.pid, displayValue: i.pid,
description: `Process with command '${i.cmd.slice(0, 25)}'
description: `Process with command '${i.cmd.slice(0, 25)}'
and ruser '${i.ruser}'`,
style: styles.optionValue}));
};
Expand All @@ -122,7 +122,7 @@ const sessionSuggestions = async(context: AutocompletionContext): Promise<Sugges
return sessions
.filter(i => !arg.params.includes(i.sid))
.map(i => new Suggestion({value: arg.start + i.sid, displayValue: i.sid,
description: `Session '${i.sid}' with ruser '${i.ruser}'
description: `Session '${i.sid}' with ruser '${i.ruser}'
and rgroup '${i.rgroup}'`,
style: styles.optionValue}));
};
Expand Down Expand Up @@ -150,7 +150,7 @@ const longOptions: LongFlagItem[] = [
},
{
flag: "tty=",
description: `selects the processes associated with the terminals given
description: `selects the processes associated with the terminals given
in ttylist. Identical to -T.`,
providers: terminalSuggestions,
},
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/autocompletion_providers/Top.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const options = combine(mapObject(
long: "Show library version and the usage prompt, then quit.",
},
},
(option, descriptions) => mapSuggestions(shortFlag(option), suggestion => suggestion.withSynopsis(descriptions.short).withDescription(descriptions.long))
(option, descriptions) => mapSuggestions(shortFlag(option), suggestion => suggestion.withSynopsis(descriptions.short).withDescription(descriptions.long)),
));


Expand Down
2 changes: 1 addition & 1 deletion src/plugins/autocompletion_utils/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export const directoriesSuggestionsProvider = filesSuggestionsProvider(info => i
export const environmentVariableSuggestions = mk(async context => {
if (context.argument.value.startsWith("$")) {
return context.environment.map((key, value) =>
new Suggestion({value: "$" + key, description: value, style: styles.environmentVariable})
new Suggestion({value: "$" + key, description: value, style: styles.environmentVariable}),
);
} else {
return [];
Expand Down
4 changes: 2 additions & 2 deletions src/shell/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const executors: Dictionary<(i: Job, a: string[]) => void> = {

job.session.directory = fullPath;
},
clear: (job: Job, args: string[]): void => {
clear: (job: Job, _args: string[]): void => {
setTimeout(() => job.session.clearJobs(), 0);
},
exit: (job: Job, args: string[]): void => {
exit: (job: Job, _args: string[]): void => {
job.session.close();
},
export: (job: Job, args: string[]): void => {
Expand Down
9 changes: 4 additions & 5 deletions src/shell/CommandExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class NonZeroExitCodeError extends Error {
}

abstract class CommandExecutionStrategy {
static async canExecute(job: Job): Promise<boolean> {
static async canExecute(_job: Job): Promise<boolean> {
return false;
}

Expand Down Expand Up @@ -63,14 +63,14 @@ class ShellExecutionStrategy extends CommandExecutionStrategy {
this.job.environment.toObject(),
this.job.dimensions,
(data: string) => this.job.parser.parse(data),
(exitCode: number) => exitCode === 0 ? resolve() : reject(new NonZeroExitCodeError(exitCode.toString()))
(exitCode: number) => exitCode === 0 ? resolve() : reject(new NonZeroExitCodeError(exitCode.toString())),
);
});
}
}

class WindowsShellExecutionStrategy extends CommandExecutionStrategy {
static async canExecute(job: Job) {
static async canExecute(_job: Job) {
return isWindows;
}

Expand All @@ -85,7 +85,7 @@ class WindowsShellExecutionStrategy extends CommandExecutionStrategy {
],
this.job.environment.toObject(), this.job.dimensions,
(data: string) => this.job.parser.parse(data),
(exitCode: number) => resolve()
(_exitCode: number) => resolve(),
);
});
}
Expand Down Expand Up @@ -118,4 +118,3 @@ export class CommandExecutor {
}
}
}

2 changes: 1 addition & 1 deletion src/shell/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class EnvironmentPath extends AbstractOrderedSet<string> {
return [];
}
},
updatedPaths => this.environment.set("PATH", updatedPaths.join(Path.delimiter))
updatedPaths => this.environment.set("PATH", updatedPaths.join(Path.delimiter)),
);
}
}
Loading

0 comments on commit 1a05d19

Please sign in to comment.