debian-image-builder-frontend/src/AppEntry.tsx
regexowl 9707278d01 src: Disable some linting errors
This disables linting errors that would require more changes.
2024-08-05 11:51:20 +02:00

38 lines
1.1 KiB
TypeScript

import React from 'react';
import { Provider } from 'react-redux';
import App from './App';
import { store } from './store';
if (
process.env.NODE_ENV === 'development' &&
process.env.MSW?.toString().toLowerCase() === 'true'
) {
// process.env.MSW is set in the webpack config using DefinePlugin
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { worker } = require('./test/mocks/browser');
worker.start({
serviceWorker: {
url: '/beta/apps/image-builder/mockServiceWorker.js',
options: {
/*
Service workers can only intercept requests made from within their scope.
mockServiceWorker.js is served from /beta/apps/image-builder/, which becomes
the worker's default scope. Set scope to '/' so that all requests are in scope
and can be intercepted. Note that the Service-Worker-Allowed header must
be set to '/' for this to work, and is done in the webpack config.
*/
scope: '../../../',
},
},
});
}
const ImageBuilder = () => (
<Provider store={store}>
<App />
</Provider>
);
export default ImageBuilder;