Skip to content

Commit 5692d32

Browse files
committed
Update eslint and a few ZEIT references to Vercel
1 parent 6ef561a commit 5692d32

24 files changed

+263
-184
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@
9393
],
9494
"rules": {
9595
"@typescript-eslint/explicit-function-return-type": "off",
96+
"@typescript-eslint/explicit-module-boundary-types": "off",
9697
"@typescript-eslint/no-explicit-any": "off",
9798
"@typescript-eslint/no-non-null-assertion": "off",
98-
"@typescript-eslint/prefer-optional-chain": "error"
99+
"@typescript-eslint/prefer-optional-chain": "error",
100+
"@typescript-eslint/ban-types": "off"
99101
}
100102
}
101103
]

.github/issue_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
-->
88

99
<!-- Checked checkbox should look like this: [x] -->
10-
- [ ] I am on the [latest](https://github.com/zeit/hyper/releases/latest) Hyper.app version
11-
- [ ] I have searched the [issues](https://github.com/zeit/hyper/issues) of this repo and believe that this is not a duplicate
10+
- [ ] I am on the [latest](https://github.com/vercel/hyper/releases/latest) Hyper.app version
11+
- [ ] I have searched the [issues](https://github.com/vercel/hyper/issues) of this repo and believe that this is not a duplicate
1212

1313
<!--
1414
Once those are done, if you're able to fill in the following list with your information,
@@ -22,4 +22,4 @@
2222
- **The issue is reproducible in vanilla Hyper.app**: <!-- Replace with info if applicable, or `Is Vanilla`. (Vanilla means Hyper.app without any add-ons or extras. Straight out of the box.) -->
2323

2424
## Issue
25-
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤ -->
25+
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤ -->

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
- To help whoever reviews your PR, it'd be extremely helpful for you to list whether your PR is ready to be merged,
44
If there's anything left to do and if there are any related PRs
55
- It'd also be extremely helpful to enable us to update your PR incase we need to rebase or what-not by checking `Allow edits from maintainers`
6-
- If your PR changes some API, please make a PR for hyper website too: https://github.com/zeit/hyper-site.
6+
- If your PR changes some API, please make a PR for hyper website too: https://github.com/vercel/hyper-site.
77
88
Thanks, again! -->

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2018 ZEIT, Inc.
3+
Copyright (c) 2018 Vercel, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

PLUGINS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
## Workflow
44

55
### Run Hyper in dev mode
6-
Hyper can be run in dev mode by cloning this repository and following the ["Contributing" section of our README](https://github.com/zeit/hyper#contribute).
6+
Hyper can be run in dev mode by cloning this repository and following the ["Contributing" section of our README](https://github.com/vercel/hyper#contribute).
77

88
In dev mode you'll get more ouput and access to React/Redux dev-tools in Electron.
99

10-
Prerequisites and steps are described in the ["Contributing" section of our README](https://github.com/zeit/hyper#contribute).
10+
Prerequisites and steps are described in the ["Contributing" section of our README](https://github.com/vercel/hyper#contribute).
1111
Be sure to use the `canary` branch.
1212

1313
### Create a dev config file
@@ -30,7 +30,7 @@ module.exports = {
3030
```
3131

3232
### Running your plugin
33-
To load, your plugin should expose at least one API method. All possible methods are listed [here](https://github.com/zeit/hyper/blob/canary/app/plugins/extensions.ts).
33+
To load, your plugin should expose at least one API method. All possible methods are listed [here](https://github.com/vercel/hyper/blob/canary/app/plugins/extensions.ts).
3434

3535
After launching Hyper in dev mode, run `yarn run app`, it should log that your plugin has been correcty loaded: `Plugin hyper-awesome-plugin (0.1.0) loaded.`. Name and version printed are the ones in your plugins `package.json` file.
3636

@@ -70,7 +70,7 @@ exports.decorateTerms = (Terms, {React}) => {
7070
// <Terms onDecorated={this.onDecorated} />
7171
}
7272
}
73-
```
73+
```
7474
:warning: Note that you have to execute `this.props.onDecorated` to not break the handler chain. Without this, you could break other plugins that decorate the same component.
7575
7676
### Keymaps

app/auto-updater-linux.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ class AutoUpdater extends EventEmitter implements Electron.AutoUpdater {
2626
this.emit('update-not-available');
2727
return;
2828
}
29-
// eslint-disable-next-line @typescript-eslint/camelcase
3029
return res.json().then(({name, notes, pub_date}) => {
3130
// Only name is mandatory, needed to construct release URL.
3231
if (!name) {
3332
throw new Error('Malformed server response: release name is missing.');
3433
}
3534
// If `null` is passed to Date constructor, current time will be used. This doesn't work with `undefined`
36-
// eslint-disable-next-line @typescript-eslint/camelcase
3735
const date = new Date(pub_date || null);
3836
this.emit('update-available', {}, notes, name, date);
3937
});

app/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const getDeprecatedCSS = (config: configOptions) => {
1515
const deprecated: string[] = [];
1616
const deprecatedCSS = ['x-screen', 'x-row', 'cursor-node', '::selection'];
1717
deprecatedCSS.forEach((css) => {
18-
if ((config.css && config.css.includes(css)) || (config.termCSS && config.termCSS.includes(css))) {
18+
if (config.css?.includes(css) || config.termCSS?.includes(css)) {
1919
deprecated.push(css);
2020
}
2121
});
@@ -52,7 +52,7 @@ const _watch = () => {
5252
// Windows
5353
if (process.platform === 'win32') {
5454
// watch for changes on config every 2s on Windows
55-
// https://github.com/zeit/hyper/pull/1772
55+
// https://github.com/vercel/hyper/pull/1772
5656
_watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => {
5757
if (!curr.mtime || curr.mtime.getTime() === 0) {
5858
console.error('error watching config');
@@ -144,8 +144,8 @@ export const htermConfigTranslate = (config: configOptions) => {
144144
Object.keys(cssReplacements).forEach((pattern) => {
145145
const searchvalue = new RegExp(pattern, 'g');
146146
const newvalue = cssReplacements[pattern];
147-
config.css = config.css && config.css.replace(searchvalue, newvalue);
148-
config.termCSS = config.termCSS && config.termCSS.replace(searchvalue, newvalue);
147+
config.css = config.css?.replace(searchvalue, newvalue);
148+
config.termCSS = config.termCSS?.replace(searchvalue, newvalue);
149149
});
150150
return config;
151151
};

app/config/open.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default () => {
1212
} catch (err) {
1313
console.error(err);
1414
}
15+
// eslint-disable-next-line @typescript-eslint/no-var-requires
1516
const {exec} = require('child_process') as typeof import('child_process');
1617

1718
const getUserChoiceKey = async () => {

app/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ function installDevExtensions(isDev_: boolean) {
119119
if (!isDev_) {
120120
return Promise.resolve([]);
121121
}
122+
// eslint-disable-next-line @typescript-eslint/no-var-requires
122123
const installer = require('electron-devtools-installer') as typeof import('electron-devtools-installer');
123124

124125
const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'] as const;

app/menus/menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const createMenu = (
5454
dialog.showMessageBox({
5555
title: `About ${appName}`,
5656
message: `${appName} ${appVersion} (${updateChannel})`,
57-
detail: `Renderers: ${renderers}\nPlugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2020 ZEIT, Inc.`,
57+
detail: `Renderers: ${renderers}\nPlugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright © 2020 Vercel, Inc.`,
5858
buttons: [],
5959
icon: icon as any
6060
});

app/menus/menus/help.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default (commands: Record<string, string>, showAbout: () => void): MenuIt
2222
If not, please try and fulfil these first.
2323
-->
2424
<!-- 👉 Checked checkbox should look like this: [x] -->
25-
- [ ] Your Hyper.app version is **${version}**. Please verify your using the [latest](https://github.com/zeit/hyper/releases/latest) Hyper.app version
26-
- [ ] I have searched the [issues](https://github.com/zeit/hyper/issues) of this repo and believe that this is not a duplicate
25+
- [ ] Your Hyper.app version is **${version}**. Please verify your using the [latest](https://github.com/vercel/hyper/releases/latest) Hyper.app version
26+
- [ ] I have searched the [issues](https://github.com/vercel/hyper/issues) of this repo and believe that this is not a duplicate
2727
---
2828
- **Any relevant information from devtools?** _(CMD+OPTION+I on macOS, CTRL+SHIFT+I elsewhere)_:
2929
<!-- 👉 Replace with info if applicable, or N/A -->
@@ -57,11 +57,11 @@ ${JSON.stringify(getPlugins(), null, 2)}
5757
\`\`\`
5858
</details>`;
5959

60-
const issueURL = `https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(body)}`;
60+
const issueURL = `https://github.com/vercel/hyper/issues/new?body=${encodeURIComponent(body)}`;
6161
const copyAndSend = () => {
6262
clipboard.writeText(body);
6363
shell.openExternal(
64-
`https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(
64+
`https://github.com/vercel/hyper/issues/new?body=${encodeURIComponent(
6565
'<!-- We have written the needed data into your clipboard because it was too large to send. ' +
6666
'Please paste. -->\n'
6767
)}`

app/plugins.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// eslint-disable-next-line eslint-comments/disable-enable-pair
2-
/* eslint-disable @typescript-eslint/no-use-before-define */
31
import {app, dialog, BrowserWindow, App} from 'electron';
42
import {resolve, basename} from 'path';
53
import {writeFileSync} from 'fs';
@@ -51,7 +49,7 @@ config.subscribe(() => {
5149

5250
// patching Module._load
5351
// so plugins can `require` them without needing their own version
54-
// https://github.com/zeit/hyper/issues/619
52+
// https://github.com/vercel/hyper/issues/619
5553
function patchModuleLoad() {
5654
// eslint-disable-next-line @typescript-eslint/no-var-requires
5755
const Module = require('module');
@@ -144,6 +142,7 @@ function getPluginVersions() {
144142
return paths_.map((path_) => {
145143
let version = null;
146144
try {
145+
// eslint-disable-next-line @typescript-eslint/no-var-requires
147146
version = require(resolve(path_, 'package.json')).version;
148147
//eslint-disable-next-line no-empty
149148
} catch (err) {}
@@ -199,7 +198,7 @@ function syncPackageJSON() {
199198
description: 'Auto-generated from `~/.hyper.js`!',
200199
private: true,
201200
version: '0.0.1',
202-
repository: 'zeit/hyper',
201+
repository: 'vercel/hyper',
203202
license: 'MIT',
204203
homepage: 'https://hyper.is',
205204
dependencies
@@ -282,6 +281,7 @@ function requirePlugins(): any[] {
282281
// populate the name for internal errors here
283282
mod._name = basename(path_);
284283
try {
284+
// eslint-disable-next-line @typescript-eslint/no-var-requires
285285
mod._version = require(resolve(path_, 'package.json')).version;
286286
} catch (err) {
287287
console.warn(`No package.json found in ${path_}`);

app/session.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const createNodePtyError = () =>
1313

1414
let spawn: typeof npSpawn;
1515
try {
16+
// eslint-disable-next-line @typescript-eslint/no-var-requires
1617
spawn = require('node-pty').spawn;
1718
} catch (err) {
1819
throw createNodePtyError();
@@ -100,6 +101,7 @@ export default class Session extends EventEmitter {
100101
}
101102

102103
init({uid, rows, cols: columns, cwd, shell, shellArgs}: SessionOptions) {
104+
// eslint-disable-next-line @typescript-eslint/no-var-requires
103105
const osLocale = require('os-locale') as typeof import('os-locale');
104106
const baseEnv = Object.assign(
105107
{},
@@ -116,7 +118,7 @@ export default class Session extends EventEmitter {
116118

117119
// Electron has a default value for process.env.GOOGLE_API_KEY
118120
// We don't want to leak this to the shell
119-
// See https://github.com/zeit/hyper/issues/696
121+
// See https://github.com/vercel/hyper/issues/696
120122
if (baseEnv.GOOGLE_API_KEY && process.env.GOOGLE_API_KEY === baseEnv.GOOGLE_API_KEY) {
121123
delete baseEnv.GOOGLE_API_KEY;
122124
}

app/updater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default (win: BrowserWindow) => {
7474
updateUrl: string,
7575
onQuitAndInstall: any
7676
) => {
77-
const releaseUrl = updateUrl || `https://github.com/zeit/hyper/releases/tag/${releaseName}`;
77+
const releaseUrl = updateUrl || `https://github.com/vercel/hyper/releases/tag/${releaseName}`;
7878
rpc.emit('update available', {releaseNotes, releaseName, releaseUrl, canInstall: !!onQuitAndInstall});
7979
};
8080

lib/components/notifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default class Notifications extends React.PureComponent<NotificationsProp
8181
window.require('electron').shell.openExternal(ev.currentTarget.href);
8282
ev.preventDefault();
8383
}}
84-
href={`https://github.com/zeit/hyper/releases/tag/${this.props.updateVersion}`}
84+
href={`https://github.com/vercel/hyper/releases/tag/${this.props.updateVersion}`}
8585
>
8686
notes
8787
</a>

lib/components/term-group.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {HyperState, HyperDispatch, TermGroupProps, TermGroupOwnProps} from '../h
99
const Term = decorate(Term_, 'Term');
1010
const SplitPane = decorate(SplitPane_, 'SplitPane');
1111

12-
// eslint-disable-next-line @typescript-eslint/class-name-casing
1312
class TermGroup_ extends React.PureComponent<TermGroupProps> {
1413
bound: WeakMap<(uid: string, ...args: any[]) => any, Record<string, (...args: any[]) => any>>;
1514
term?: Term_ | null;

lib/containers/hyper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Hyper extends React.PureComponent<HyperProps> {
8989

9090
componentWillUnmount() {
9191
document.body.style.backgroundColor = 'inherit';
92-
this.mousetrap && this.mousetrap.reset();
92+
this.mousetrap?.reset();
9393
}
9494

9595
render() {

lib/ext-modules.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
declare module 'php-escape-shell' {
2-
// eslint-disable-next-line @typescript-eslint/camelcase
32
export function php_escapeshellcmd(path: string): string;
43
}
54

lib/reducers/sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const reducer = (state: ImmutableType<sessionState> = initialState, action: Hype
8181
case SESSION_PTY_DATA:
8282
// we avoid a direct merge for perf reasons
8383
// as this is the most common action
84-
if (state.sessions[action.uid] && state.sessions[action.uid].cleared) {
84+
if (state.sessions[action.uid]?.cleared) {
8585
return state.merge(
8686
{
8787
sessions: {

lib/utils/plugins.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {basename} from 'path';
66

77
// patching Module._load
88
// so plugins can `require` them without needing their own version
9-
// https://github.com/zeit/hyper/issues/619
9+
// https://github.com/vercel/hyper/issues/619
1010
import React, {PureComponent} from 'react';
1111
import ReactDOM from 'react-dom';
1212
import Notification from '../components/notification';
@@ -66,7 +66,7 @@ let reducersDecorators: {
6666
// expose decorated component instance to the higher-order components
6767
function exposeDecorated<P extends Record<string, any>>(
6868
Component_: React.ComponentType<P>
69-
): React.ComponentClass<P, {}> {
69+
): React.ComponentClass<P, unknown> {
7070
return class DecoratedComponent extends React.Component<P> {
7171
constructor(props: P, context: any) {
7272
super(props, context);
@@ -155,6 +155,7 @@ export function decorate<P>(
155155
};
156156
}
157157

158+
// eslint-disable-next-line @typescript-eslint/no-var-requires
158159
const Module = require('module') as typeof import('module') & {_load: Function};
159160
const originalLoad = Module._load;
160161
Module._load = function _load(path: string) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
"@types/terser-webpack-plugin": "3.0.0",
9191
"@types/uuid": "8.0.0",
9292
"@types/webpack": "4.41.21",
93-
"@typescript-eslint/eslint-plugin": "2.34.0",
94-
"@typescript-eslint/parser": "2.34.0",
93+
"@typescript-eslint/eslint-plugin": "3.6.0",
94+
"@typescript-eslint/parser": "3.6.0",
9595
"ava": "3.10.1",
9696
"babel-loader": "8.1.0",
9797
"concurrently": "5.2.0",
@@ -103,7 +103,7 @@
103103
"electron-builder-squirrel-windows": "22.7.0",
104104
"electron-devtools-installer": "3.1.0",
105105
"electron-rebuild": "1.11.0",
106-
"eslint": "6.8.0",
106+
"eslint": "7.4.0",
107107
"eslint-config-prettier": "6.11.0",
108108
"eslint-plugin-eslint-comments": "^3.2.0",
109109
"eslint-plugin-prettier": "3.1.4",

test/unit/cli-api.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import test from 'ava';
2+
// eslint-disable-next-line @typescript-eslint/no-var-requires
23
const proxyquire = require('proxyquire').noCallThru();
34

45
test('existsOnNpm() builds the url for non-scoped packages', (t) => {

test/unit/window-utils.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import test from 'ava';
2+
// eslint-disable-next-line @typescript-eslint/no-var-requires
23
const proxyquire = require('proxyquire').noCallThru();
34

45
test('positionIsValid() returns true when window is on only screen', (t) => {

0 commit comments

Comments
 (0)