Skip to content

Commit 78ba919

Browse files
committed
chore: lint
1 parent bb4ff7b commit 78ba919

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

client/api/_init-socket.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@ export default function _initSocket(prefix = '', socketPath = '') {
4444
});
4545

4646
socket.on('patch', (name, patch, hash) => {
47-
const wrongFile = name !== _filename;
4847
const wrongHash = hash !== _story.getHash(name);
4948

50-
if (wrongFile || wrongHash)
51-
return;
52-
5349
const {
5450
_filename,
5551
_story,
@@ -60,6 +56,11 @@ export default function _initSocket(prefix = '', socketPath = '') {
6056
sha,
6157
} = this;
6258

59+
const wrongFile = name !== _filename;
60+
61+
if (wrongFile || wrongHash)
62+
return;
63+
6364
const value = applyPatch(getValue(), patch);
6465

6566
setValue(value);

client/api/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import Emitify from 'emitify';
99
import {createPatch} from 'daffy';
1010
import jssha from 'jssha';
1111
import currify from 'currify';
12-
import {
13-
enableVim,
14-
disableVim,
15-
} from './vim.js';
12+
import {enableVim, disableVim} from './vim.js';
1613
import goToLine from './go-to-line.js';
1714
import _initSocket from './_init-socket.js';
1815
import showMessage from './show-message/index.js';

client/api/set-mode.spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
test,
3-
stub,
4-
} from 'supertape';
1+
import {test, stub} from 'supertape';
52
import setMode from './set-mode.js';
63

74
test('client: setMode: return this', (t) => {

webpack.config.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {createRequire} from 'module';
1+
import {createRequire} from 'node:module';
22
import path, {dirname} from 'node:path';
33
import {fileURLToPath} from 'node:url';
4-
import {env} from 'node:process';
4+
import process, {env} from 'node:process';
55
import webpack from 'webpack';
66

77
const __filename = fileURLToPath(import.meta.url);
@@ -17,6 +17,7 @@ const clean = (array) => array.filter(notEmpty);
1717
const {resolve} = createRequire(import.meta.url);
1818

1919
const {NODE_ENV} = process.env;
20+
2021
process.env.NODE_DEBUG = '';
2122
process.env.NODE_ENV = NODE_ENV || '';
2223

@@ -60,17 +61,20 @@ export default {
6061
module: {
6162
rules,
6263
},
63-
resolve: {
64+
resolve: {
6465
fallback: {
6566
path: resolve('path-browserify'),
6667
util: resolve('util'),
6768
},
68-
},
69+
},
6970
plugins: [
70-
new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
71-
resource.request = resource.request.replace(/^node:/, "");
72-
}),
73-
new webpack.EnvironmentPlugin(['NODE_ENV', 'NODE_DEBUG']),
71+
new webpack.NormalModuleReplacementPlugin(/node:/, (resource) => {
72+
resource.request = resource.request.replace(/^node:/, '');
73+
}),
74+
new webpack.EnvironmentPlugin([
75+
'NODE_ENV',
76+
'NODE_DEBUG',
77+
]),
7478
],
7579
};
7680

0 commit comments

Comments
 (0)