-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable require-jsdoc
lint and add two lints related to React
#6403
Changes from 3 commits
cc62b69
2242c69
a3db9bc
20c26d9
7273564
9a00bc0
9c15ba0
f8e5773
0151739
00874dd
a4e3858
68d9862
d577733
0f0230e
043ddb0
4fb4bda
bab7a2f
4e91bec
1e0aa42
de9ec38
938cd82
cdd39f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ class App { | |
args: config.Args = config.CONFIG | ||
isQuitting = false | ||
|
||
/** Initializes and runs the Electron application. */ | ||
async run() { | ||
urlAssociations.registerAssociations() | ||
// Register file associations for macOS. | ||
|
@@ -76,6 +77,7 @@ class App { | |
} | ||
} | ||
|
||
/** Processes the command line arguments. */ | ||
processArguments() { | ||
// We parse only "client arguments", so we don't have to worry about the Electron-Dev vs | ||
// Electron-Proper distinction. | ||
|
@@ -114,14 +116,11 @@ class App { | |
} | ||
} | ||
|
||
/** Set Chrome options based on the app configuration. For comprehensive list of available | ||
/** Sets Chrome options based on the app configuration. For comprehensive list of available | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In all of our Rust codebase we have the opposite rule - instead of "Sets" we use "Set". I think we should be consistent here. Using docs in the imperative form rather than 3rd person form makes them shorter and unified with Rust codebase (which is unified with official Rust style guide). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah - i think the convention for TS in the other files was to use the opposite, but should be easy enough to change back |
||
* Chrome options refer to: https://peter.sh/experiments/chromium-command-line-switches. */ | ||
setChromeOptions(chromeOptions: configParser.ChromeOption[]) { | ||
const addIf = ( | ||
opt: contentConfig.Option<boolean>, | ||
chromeOptName: string, | ||
value?: string | ||
) => { | ||
/** Adds the specified Chrome option when the specified command line option is enabled. */ | ||
function addIf(opt: contentConfig.Option<boolean>, chromeOptName: string, value?: string) { | ||
if (opt.value) { | ||
const chromeOption = new configParser.ChromeOption(chromeOptName, value) | ||
const chromeOptionStr = chromeOption.display() | ||
|
@@ -130,8 +129,10 @@ class App { | |
chromeOptions.push(chromeOption) | ||
} | ||
} | ||
const add = (option: string, value?: string) => | ||
/** Adds the specified Chrome option. */ | ||
function add(option: string, value?: string) { | ||
chromeOptions.push(new configParser.ChromeOption(option, value)) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why we need to change const lambdas int functions? This makes the code more verbose. |
||
logger.groupMeasured('Setting Chrome options', () => { | ||
const perfOpts = this.args.groups.performance.options | ||
addIf(perfOpts.disableGpuSandbox, 'disable-gpu-sandbox') | ||
|
@@ -330,7 +331,8 @@ class App { | |
} | ||
} | ||
|
||
printVersion(): Promise<void> { | ||
/** Prints the version of the frontend and the backend. */ | ||
async printVersion(): Promise<void> { | ||
const indent = ' '.repeat(utils.INDENT_SIZE) | ||
let maxNameLen = 0 | ||
for (const name in debug.VERSION_INFO) { | ||
|
@@ -342,22 +344,20 @@ class App { | |
const spacing = ' '.repeat(maxNameLen - name.length) | ||
console.log(`${indent}${label}:${spacing} ${value}`) | ||
} | ||
|
||
console.log('') | ||
|
||
console.log('Backend:') | ||
return projectManager.version(this.args).then(backend => { | ||
if (!backend) { | ||
console.log(`${indent}No backend available.`) | ||
} else { | ||
const lines = backend.split(/\r?\n/).filter(line => line.length > 0) | ||
for (const line of lines) { | ||
console.log(`${indent}${line}`) | ||
} | ||
const backend = await projectManager.version(this.args) | ||
if (!backend) { | ||
console.log(`${indent}No backend available.`) | ||
} else { | ||
const lines = backend.split(/\r?\n/).filter(line => line.length > 0) | ||
for (const line of lines) { | ||
console.log(`${indent}${line}`) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
/** Registers keyboard shortcuts. */ | ||
registerShortcuts() { | ||
electron.app.on('web-contents-created', (_webContentsCreatedEvent, webContents) => { | ||
webContents.on('before-input-event', (_beforeInputEvent, input) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that requiring docs on arrow fn exprs is an overkill. Vast majority of them are small helper functions that do not require better docs than just a good name. In case we will find a code during review with too long such an arrow expression, we can always refactor it to a normal fn :)