👷 Linter errors

This commit is contained in:
Felix Rieseberg 2018-01-29 12:36:51 -08:00
parent 8804b09188
commit 8f685e9329

View file

@ -147,7 +147,9 @@ of successful XSS attacks.
// Bad // Bad
const mainWindow = new BrowserWindow() const mainWindow = new BrowserWindow()
mainWindow.loadURL('https://my-website.com') mainWindow.loadURL('https://my-website.com')
```
```js
// Good // Good
const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({
webPreferences: { webPreferences: {
@ -180,7 +182,7 @@ const { readFileSync } = require('fs')
window.readConfig = function () { window.readConfig = function () {
const data = readFileSync('./config.json') const data = readFileSync('./config.json')
return data; return data
} }
``` ```
@ -331,8 +333,8 @@ it bulletproof. Thus, if you do not need it, it is a good idea to disable it.
### How? ### How?
```js ```js
window.eval = global.eval = function() { window.eval = global.eval = function () {
throw new Error(`Sorry, this app does not support window.eval().`); throw new Error(`Sorry, this app does not support window.eval().`)
} }
``` ```
@ -364,7 +366,9 @@ const mainWindow = new BrowserWindow({
allowRunningInsecureContent: true allowRunningInsecureContent: true
} }
}) })
```
```js
// Good // Good
const mainWindow = new BrowserWindow({}) const mainWindow = new BrowserWindow({})
``` ```
@ -395,7 +399,9 @@ const mainWindow = new BrowserWindow({
experimentalFeatures: true experimentalFeatures: true
} }
}) })
```
```js
// Good // Good
const mainWindow = new BrowserWindow({}) const mainWindow = new BrowserWindow({})
``` ```
@ -425,7 +431,9 @@ const mainWindow = new BrowserWindow({
blinkFeatures: ['ExecCommandInJavaScript'] blinkFeatures: ['ExecCommandInJavaScript']
} }
}) })
```
```js
// Good // Good
const mainWindow = new BrowserWindow() const mainWindow = new BrowserWindow()
``` ```
@ -458,6 +466,7 @@ const mainWindow = new BrowserWindow({
} }
}) })
```js
// Good // Good
const mainWindow = new BrowserWindow() const mainWindow = new BrowserWindow()
``` ```