chore: tidy

This commit is contained in:
cha0s 2023-12-02 06:34:39 -06:00
parent cc4ec9c30b
commit 6976fa8183
10 changed files with 1 additions and 20 deletions

View File

@ -34,6 +34,5 @@
# Webpack 5
fixup no-param-reassign
warningsFilter deprecated
refactor stats

View File

@ -20,7 +20,6 @@ export const hooks = {
),
'@flecks/core/test/invoke': () => 69,
'@flecks/core/test/invoke-parallel': (O) => {
// eslint-disable-next-line no-param-reassign
O.foo *= 2;
},
'@flecks/core/test/invoke-merge': () => ({foo: 69}),
@ -28,7 +27,6 @@ export const hooks = {
'@flecks/core/test/invoke-merge-unique': () => ({foo: 69}),
'@flecks/core/test/invoke-merge-unique-async': () => new Promise((resolve) => { resolve({foo: 69}); }),
'@flecks/core/test.middleware': () => (foo, next) => {
// eslint-disable-next-line no-param-reassign
foo.bar += 1;
next();
},

View File

@ -7,7 +7,6 @@ export const hooks = {
'@flecks/core/test/invoke': () => 420,
'@flecks/core/test/invoke-parallel': (O) => new Promise((resolve) => {
setTimeout(() => {
// eslint-disable-next-line no-param-reassign
O.foo += 2;
resolve();
}, 0);
@ -17,7 +16,6 @@ export const hooks = {
'@flecks/core/test/invoke-merge-unique': () => ({foo: 69}),
'@flecks/core/test/invoke-merge-unique-async': () => new Promise((resolve) => { resolve({foo: 69}); }),
'@flecks/core/test.middleware': () => (foo, next) => {
// eslint-disable-next-line no-param-reassign
foo.bar *= 2;
next();
},

View File

@ -32,7 +32,6 @@ export default (flecks) => {
this.destroy({where: {id: ban.id}});
return [...r, null];
}
// eslint-disable-next-line no-param-reassign
ban.ttl = Math.ceil((expiresAt.getTime() - Date.now()) / 1000);
}
return [...r, ban];

View File

@ -3,7 +3,6 @@ import {augmentBuild} from '@flecks/web/server';
import ssr from './ssr';
export const hooks = {
/* eslint-disable no-param-reassign */
'@flecks/core.build': (target, config, env, argv, flecks) => {
const isProduction = 'production' === argv.mode;
config.resolve.alias['react-native'] = 'react-native-web';
@ -18,7 +17,6 @@ export const hooks = {
augmentBuild(target, config, env, argv, flecks);
}
},
/* eslint-enable no-param-reassign */
'@flecks/web/server.stream.html': (stream, req, flecks) => (
flecks.get('@flecks/react.ssr') ? ssr(stream, req, flecks) : stream
),

View File

@ -21,14 +21,12 @@ export default (key) => (Superclass) => {
);
Packer.pack = key
? (data) => {
// eslint-disable-next-line no-param-reassign
data[key] = msgpack.encode(data[key]);
return Superclass.pack(data);
}
: (data) => msgpack.encode(data);
Packer.unpack = key
? (data) => {
// eslint-disable-next-line no-param-reassign
data[key] = msgpack.decode(data[key]);
return Superclass.pack(data);
}

View File

@ -62,7 +62,6 @@ export const hooks = {
passport.initialize()(socket.handshake, undefined, () => {
debugSilly('@flecks/socket/server.request.socket: passport.session()');
passport.session()(socket.handshake, undefined, async () => {
/* eslint-disable no-param-reassign */
if (!socket.handshake.user) {
const {User} = flecks.get('$flecks/db.models');
socket.handshake.user = new User();
@ -74,7 +73,6 @@ export const hooks = {
socket.handshake.logOut = LogOps.logOut;
socket.handshake.isAuthenticated = LogOps.isAuthenticated;
socket.handshake.isUnauthenticated = LogOps.isUnauthenticated;
/* eslint-enable no-param-reassign */
await socket.join(`/u/${socket.handshake.user.id}`);
next();
});

View File

@ -20,7 +20,6 @@ const slice = createSlice({
entities: {0: {name: 'anonymous'}},
ids: [0],
}),
/* eslint-disable no-param-reassign */
extraReducers: (builder) => {
builder.addCase(hydrateLocalStorage, (state, action) => {
const storage = action.payload;
@ -38,7 +37,6 @@ const slice = createSlice({
}
});
},
/* eslint-enable no-param-reassign */
});
export default slice.reducer;

View File

@ -45,9 +45,8 @@ const {version} = require('@flecks/web/package.json');
}
const progress = new Progress(window);
debug('loading runtime...');
// eslint-disable-next-line import/no-extraneous-dependencies
const {default: loader} = await import(
/* webpackChunkName: "flecks-runtime" */
/* webpackChunkName: "flecks-runtime" */ // eslint-disable-next-line import/no-unresolved
'@flecks/web/runtime'
);
const runtime = await loader(progress.update.bind(progress));

View File

@ -21,7 +21,6 @@ export const hooks = {
'@flecks/core.build.alter': async (configs, env, argv, flecks) => {
// Don't build if there's a fleck target.
if (configs.fleck && !flecks.get('@flecks/web/server.forceBuildWithFleck')) {
// eslint-disable-next-line no-param-reassign
delete configs.web;
return;
}
@ -29,7 +28,6 @@ export const hooks = {
// Only build vendor in dev.
if (configs['web-vendor']) {
if (isProduction) {
// eslint-disable-next-line no-param-reassign
delete configs['web-vendor'];
}
// Only build if something actually changed.
@ -65,7 +63,6 @@ export const hooks = {
catch (error) {}
}
if (timestamp > latest) {
// eslint-disable-next-line no-param-reassign
delete configs['web-vendor'];
}
else if (timestamp > 0) {
@ -104,7 +101,6 @@ export const hooks = {
child.kill();
});
// Remove the build config since we're handing off to WDS.
// eslint-disable-next-line no-param-reassign
delete configs.web;
},
'@flecks/core.build.config': () => [