Skip to content

Commit 093c33d

Browse files
committed
restore prettier <2 arrowParens behavior
1 parent 523fe3f commit 093c33d

File tree

30 files changed

+115
-115
lines changed

30 files changed

+115
-115
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
}
3030
},
3131
"prettier": {
32+
"arrowParens": "avoid",
3233
"singleQuote": true,
3334
"trailingComma": "none"
3435
},

packages/jupyterlab-go-to-definition/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
6161
// more reasonable thing would be to create a PR with .onAddCell
6262
setTimeout(() => {
6363
// now (notebook.widgets.length is likely > 1)
64-
notebook.widgets.every((cell) => {
64+
notebook.widgets.every(cell => {
6565
let codemirror_editor = cell.editor as CodeMirrorEditor;
6666
let extension = new CodeMirrorExtension(codemirror_editor, jumper);
6767

@@ -86,7 +86,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
8686

8787
function updateOptions(settings: ISettingRegistry.ISettings): void {
8888
let options = settings.composite;
89-
Object.keys(options).forEach((key) => {
89+
Object.keys(options).forEach(key => {
9090
if (key === 'modifier') {
9191
let modifier = options[key] as KeyModifier;
9292
CodeMirrorExtension.modifierKey = modifier;
@@ -96,7 +96,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
9696

9797
settingRegistry
9898
.load(plugin.id)
99-
.then((settings) => {
99+
.then(settings => {
100100
updateOptions(settings);
101101
settings.changed.connect(() => {
102102
updateOptions(settings);
@@ -221,7 +221,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
221221
}
222222
];
223223

224-
bindings.map((binding) => app.commands.addKeyBinding(binding));
224+
bindings.map(binding => app.commands.addKeyBinding(binding));
225225
},
226226
autoStart: true
227227
};

packages/jupyterlab-go-to-definition/src/jumpers/jumper.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export abstract class CodeJumper {
140140
let filtered = in_earlier_cell
141141
? definitions // all are in an earlier cell
142142
: definitions.filter(
143-
(otherToken) => otherToken.offset < originToken.offset
143+
otherToken => otherToken.offset < originToken.offset
144144
); // all are in same cell
145145

146146
// but ignore ones that are part of the same assignment expression,
@@ -149,7 +149,7 @@ export abstract class CodeJumper {
149149
// >>> a = a + 1
150150
// clicking on the last 'a' should jump to the first line,
151151
// and not to beginning of the second line.
152-
filtered = filtered.filter((otherToken) => {
152+
filtered = filtered.filter(otherToken => {
153153
// If otherToken is in previous cell, we don't need to worry.
154154
if (i < stopIndex) {
155155
return true;
@@ -243,7 +243,7 @@ export abstract class CodeJumper {
243243
});
244244

245245
dialog_promise
246-
.then((result) => {
246+
.then(result => {
247247
if (result.button.accept) {
248248
disposable.dispose();
249249
}
@@ -335,7 +335,7 @@ export abstract class CodeJumper {
335335
let potential_paths = cell_of_origin_analyzer.guessReferencePath(context);
336336
if (this.cwd) {
337337
let prefixed_with_cwd = potential_paths.map(
338-
(path) => this.cwd + '/' + path
338+
path => this.cwd + '/' + path
339339
);
340340
potential_paths = prefixed_with_cwd.concat(potential_paths);
341341
}
@@ -346,7 +346,7 @@ export abstract class CodeJumper {
346346
this.queryKernel(
347347
code,
348348
this.kernel,
349-
(msg) => this.handle_path_from_kernel(msg, potential_paths) // TODO: extract fallback?
349+
msg => this.handle_path_from_kernel(msg, potential_paths) // TODO: extract fallback?
350350
);
351351
} else {
352352
// TODO: extract fallback?
@@ -392,7 +392,7 @@ export abstract class CodeJumper {
392392
let code = cell_of_origin_analyzer.definitionLocationQuery(context);
393393

394394
if (cell_of_origin_analyzer.supportsKernel && this.kernel && code) {
395-
this.queryKernel(code, this.kernel, (msg) =>
395+
this.queryKernel(code, this.kernel, msg =>
396396
this.handle_kernel_inspect(msg, fallback)
397397
);
398398
} else {

packages/jupyterlab-go-to-definition/src/jumpers/notebook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class NotebookJumper extends CodeJumper {
3535
}
3636

3737
get editors() {
38-
return this.notebook.widgets.map((cell) => cell.editor);
38+
return this.notebook.widgets.map(cell => cell.editor);
3939
}
4040

4141
get language() {

packages/jupyterlab-go-to-definition/src/languages/analyzer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export abstract class LanguageAnalyzer {
114114
_get_token_index(token: CodeEditor.IToken) {
115115
this._maybe_setup_tokens();
116116
return this.tokens.findIndex(
117-
(t) =>
117+
t =>
118118
t.value === token.value &&
119119
t.offset === token.offset &&
120120
t.type === token.type
@@ -211,7 +211,7 @@ export abstract class LanguageAnalyzer {
211211
let terminatingTokens = this._selectTerminatingTokens(tokensBetween);
212212

213213
let terminatorsAfterAssignment = terminatingTokens.filter(
214-
(token) => token.offset > firstAssignment.offset
214+
token => token.offset > firstAssignment.offset
215215
);
216216

217217
if (!terminatorsAfterAssignment.length) {

packages/jupyterlab-go-to-definition/src/languages/r.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('RAnalyzer', () => {
2222
) {
2323
let tokens = tokensProvider.getTokens();
2424
let matchedTokens = tokens.filter(
25-
(token) => token.value === tokenName && token.type === tokenType
25+
token => token.value === tokenName && token.type === tokenType
2626
);
2727
let token = matchedTokens[tokenOccurrence - 1];
2828
let tokenId = tokens.indexOf(token);

packages/jupyterlab-go-to-definition/src/notebook_private.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function _findCell(notebook: Notebook, node: HTMLElement): number {
3737
if (node.classList.contains(NB_CELL_CLASS)) {
3838
let i = ArrayExt.findFirstIndex(
3939
notebook.widgets,
40-
(widget) => widget.node === node
40+
widget => widget.node === node
4141
);
4242
if (i !== -1) {
4343
return i;

packages/jupyterlab-go-to-definition/src/testutils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function matchToken(
99
tokenType = 'variable'
1010
): CodeEditor.IToken {
1111
let matchedTokens = tokens.filter(
12-
(token) => token.value === tokenName && token.type === tokenType
12+
token => token.value === tokenName && token.type === tokenType
1313
);
1414
return matchedTokens[tokenOccurrence - 1];
1515
}

packages/jupyterlab-lsp/src/adapters/codemirror/feature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export abstract class CodeMirrorLSPFeature implements ILSPFeature {
288288
// Specs: documentChanges are preferred over changes
289289
let changes = workspaceEdit.documentChanges
290290
? workspaceEdit.documentChanges.map(
291-
(change) => change as lsProtocol.TextDocumentEdit
291+
change => change as lsProtocol.TextDocumentEdit
292292
)
293293
: toDocumentChanges(workspaceEdit.changes);
294294
let applied_changes = null;

packages/jupyterlab-lsp/src/adapters/codemirror/features/diagnostics.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('Diagnostics', () => {
149149
});
150150

151151
let cm_editors = env.virtual_editor.notebook.widgets.map(
152-
(cell) => (cell.editor as CodeMirrorEditor).editor
152+
cell => (cell.editor as CodeMirrorEditor).editor
153153
);
154154
let marks_cell_1 = cm_editors[0].getDoc().getAllMarks();
155155
// test from mypy, test from pyflakes, whitespace around operator from pycodestyle
@@ -213,7 +213,7 @@ describe('Diagnostics', () => {
213213
// test guards against wrongly propagated responses:
214214
feature.handleDiagnostic(response);
215215
let cm_editors = env.virtual_editor.notebook.widgets.map(
216-
(cell) => (cell.editor as CodeMirrorEditor).editor
216+
cell => (cell.editor as CodeMirrorEditor).editor
217217
);
218218

219219
let marks_cell_1 = cm_editors[0].getDoc().getAllMarks();

0 commit comments

Comments
 (0)