Skip to content

Commit ab77c8d

Browse files
committed
chore: lint
1 parent 02ac0bd commit ab77c8d

File tree

20 files changed

+162
-148
lines changed

20 files changed

+162
-148
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ jobs:
1010
node-version:
1111
- 16.x
1212
- 18.x
13+
- 20.x
1314
steps:
14-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1516
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v3
1718
with:
1819
node-version: ${{ matrix.node-version }}
1920
- name: Install Redrun

.madrun.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ export default {
2121
'watch:client:dev': () => run('build:client:dev', '--watch'),
2222
'wisdom': () => run('build'),
2323
};
24-

assets/style.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,5 @@ html, body, .edit {
2323

2424
.edit {
2525
position : absolute;
26-
top: 0;
27-
right: 0;
28-
bottom: 0;
29-
left: 0;
26+
inset: 0;
3027
}

bin/edward.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function getPath(name) {
3030

3131
function main(name) {
3232
const filename = getPath(name);
33-
const DIR = __dirname + '/../assets/';
33+
const DIR = `${__dirname}/../assets/`;
3434
const edward = require('..');
3535
const http = require('http');
3636
const express = require('express');
@@ -41,14 +41,12 @@ function main(name) {
4141

4242
const {env} = process;
4343

44-
const port = env.PORT /* c9 */
45-
|| env.VCAP_APP_PORT /* cloudfoundry */
46-
|| 1337;
44+
const port = env.PORT /* c9 */ || env.VCAP_APP_PORT /* cloudfoundry */ || 1337;
4745

48-
const ip = env.IP /* c9 */
49-
|| '0.0.0.0';
46+
const ip = env.IP /* c9 */ || '0.0.0.0';
5047

51-
app .use(express.static(DIR))
48+
app
49+
.use(express.static(DIR))
5250
.use(edward({
5351
diff: true,
5452
zip: true,
@@ -106,4 +104,3 @@ function help() {
106104
console.log(` ${name} ${bin[name]}`);
107105
}
108106
}
109-

bower.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"name": "edward",
3-
"homepage": "https://github.com/cloudcmd/edward",
4-
"authors": [
5-
"coderaiser <[email protected]>"
6-
],
7-
"description": "web editor",
8-
"main": "bin/edward.js",
9-
"keywords": [
10-
"file",
11-
"edit"
12-
],
13-
"license": "MIT",
14-
"private": true,
15-
"ignore": [
16-
"node_modules",
17-
"modules"
18-
],
19-
"dependencies": {
20-
"ace-builds": "^1.23.4"
21-
}
2+
"name": "edward",
3+
"homepage": "https://github.com/cloudcmd/edward",
4+
"authors": [
5+
"coderaiser <[email protected]>"
6+
],
7+
"description": "web editor",
8+
"main": "bin/edward.js",
9+
"keywords": [
10+
"file",
11+
"edit"
12+
],
13+
"license": "MIT",
14+
"private": true,
15+
"ignore": [
16+
"node_modules",
17+
"modules"
18+
],
19+
"dependencies": {
20+
"ace-builds": "^1.23.4"
21+
}
2222
}

client/_clipboard.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ const reject = Promise.reject.bind(Promise);
1212

1313
module.exports = function(cmd) {
1414
const NAME = 'editor-clipboard';
15-
const {
16-
_Ace,
17-
_story,
18-
} = this;
15+
const {_Ace, _story} = this;
1916

2017
const insert = _Ace.insert.bind(_Ace);
2118
const value = this._Ace.getSelectedText();
@@ -30,7 +27,8 @@ module.exports = function(cmd) {
3027
return cut(_story, value) ? resolve() : reject();
3128
}
3229

33-
return clipboard.readText()
30+
return clipboard
31+
.readText()
3432
.then(insert)
3533
.catch(() => {
3634
showMessageOnce('Could not paste from clipboard. Inner buffer used.');
@@ -53,4 +51,3 @@ function cut(story, value) {
5351

5452
return result;
5553
}
56-

client/_init-socket.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
'use strict';
22

33
/* global io */
4-
54
const {applyPatch} = require('daffy');
65
const {alert} = require('smalltalk');
76

87
const getHost = () => {
98
const l = location;
10-
const href = l.origin || l.protocol + '//' + l.host;
119

12-
return href;
10+
return l.origin || l.protocol + '//' + l.host;
1311
};
1412

1513
module.exports = function() {
1614
const edward = this;
1715
const href = getHost();
1816
const FIVE_SECONDS = 5000;
17+
1918
const patch = (name, data) => {
2019
socket.emit('patch', name, data);
2120
};
@@ -41,7 +40,8 @@ module.exports = function() {
4140
});
4241

4342
socket.on('file', (name, data) => {
44-
edward.setModeForPath(name)
43+
edward
44+
.setModeForPath(name)
4545
.setValueFirst(name, data)
4646
.moveCursorTo(0, 0);
4747
});
@@ -59,7 +59,8 @@ module.exports = function() {
5959

6060
this.setValue(result);
6161

62-
this._story
62+
this
63+
._story
6364
.setData(name, value)
6465
.setHash(name, this.sha());
6566

@@ -74,4 +75,3 @@ module.exports = function() {
7475
alert(this._TITLE, error);
7576
});
7677
};
77-

client/_on-save.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = async function(error, text) {
1313
_filename,
1414
_title,
1515
} = edward;
16+
1617
let msg = 'Try again?';
1718

1819
if (error) {
@@ -34,7 +35,8 @@ module.exports = async function(error, text) {
3435
edward.showMessage(text);
3536

3637
const hash = edward.sha();
37-
this._story
38+
this
39+
._story
3840
.setData(_filename, _value)
3941
.setHash(_filename, hash);
4042

client/_set-emmet.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ const load = require('load.js');
55

66
/* global ace */
77
/* global join */
8-
98
module.exports = function() {
10-
const {
11-
_DIR,
12-
_PREFIX,
13-
} = this;
9+
const {_DIR, _PREFIX} = this;
1410

15-
const dir = _DIR + 'ace-builds/src-min/';
11+
const dir = `${_DIR}ace-builds/src-min/`;
1612
const dirVendor = '/vendor/';
1713

1814
const {extensions} = this._Config;
@@ -25,8 +21,8 @@ module.exports = function() {
2521
this.setOption('enableEmmet', true);
2622
}, async (callback) => {
2723
const url = _PREFIX + join([
28-
dirVendor + 'emmet.js',
29-
dir + 'ext-emmet.js',
24+
`${dirVendor}emmet.js`,
25+
`${dir}ext-emmet.js`,
3026
]);
3127

3228
await load.js(url);
@@ -37,4 +33,3 @@ module.exports = function() {
3733
callback();
3834
});
3935
};
40-

0 commit comments

Comments
 (0)