Navigation Menu

Skip to content
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

build: Update TypeScript, use @typescript-eslint #17251

Merged
merged 2 commits into from Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions .eslintrc.json
@@ -1,21 +1,33 @@
{
"extends": "standard",
"parser": "typescript-eslint-parser",
"plugins": ["typescript"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"env": {
"browser": true
},
"rules": {
"no-var": "error",
"no-unused-vars": 0,
"no-global-assign": 0,
"typescript/no-unused-vars": "error",
"@typescript-eslint/no-unused-vars": ["error", {
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false
}],
"prefer-const": ["error", {
"destructuring": "all"
}]
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
}
},
"overrides": [
{
"files": "*.js",
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}
8 changes: 0 additions & 8 deletions default_app/.eslintrc

This file was deleted.

8 changes: 0 additions & 8 deletions lib/.eslintrc

This file was deleted.

5 changes: 3 additions & 2 deletions lib/browser/api/content-tracing.js
Expand Up @@ -6,8 +6,9 @@ contentTracing.getCategories = deprecate.promisify(contentTracing.getCategories)
contentTracing.startRecording = deprecate.promisify(contentTracing.startRecording)
contentTracing.stopRecording = deprecate.promisify(contentTracing.stopRecording)
contentTracing.getTraceBufferUsage = deprecate.promisifyMultiArg(
contentTracing.getTraceBufferUsage,
(value) => [value.paths, value.bookmarks]
contentTracing.getTraceBufferUsage
// convertPromiseValue: Temporarily disabled until it's used
/* (value) => [value.paths, value.bookmarks] */
)

module.exports = contentTracing
4 changes: 2 additions & 2 deletions lib/browser/api/protocol.ts
Expand Up @@ -5,7 +5,7 @@ const protocol = process.atomBinding('protocol')

// Fallback protocol APIs of default session.
Object.setPrototypeOf(protocol, new Proxy({}, {
get (target, property) {
get (_target, property) {
if (!app.isReady()) return

const protocol = session.defaultSession!.protocol
Expand All @@ -21,7 +21,7 @@ Object.setPrototypeOf(protocol, new Proxy({}, {
return Object.getOwnPropertyNames(Object.getPrototypeOf(session.defaultSession!.protocol))
},

getOwnPropertyDescriptor (target) {
getOwnPropertyDescriptor () {
return { configurable: true, enumerable: true }
}
}))
Expand Down
3 changes: 2 additions & 1 deletion lib/common/api/deprecate.ts
Expand Up @@ -102,7 +102,8 @@ const deprecate: ElectronInternal.DeprecationUtil = {
} as T
},

promisifyMultiArg: <T extends (...args: any[]) => any>(fn: T, convertPromiseValue: (v: any) => any): T => {
// convertPromiseValue: Temporarily disabled until it's used
promisifyMultiArg: <T extends (...args: any[]) => any>(fn: T /* convertPromiseValue: (v: any) => any */): T => {
const fnName = fn.name || 'function'
const oldName = `${fnName} with callbacks`
const newName = `${fnName} with Promises`
Expand Down
136 changes: 73 additions & 63 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.