1import React, { useState, forwardRef, useEffect } from 'react'
2import PersistenceService, {
3 NullPersistenceService
4} from './PersistenceService/' 5import updateSW from './updateSW'
6
7export interface ServiceWorkerUpdaterProps {
Unnecessarily complex import statements can be simplified. Complex imports usually result in confusing code. This usually happens as a result of refactoring.
For the following project structure
├── root.config.js
├── .deepsource.toml
└── calculator
├── index.js
├── calc.js
└── config.js
└── utils
└── pofyfills.js
└── index.js
// <!-- calcuator/index.js -->
import utils from './utils/index.js' // unnecessary to mentioned `index.js` at the end. NodeJS always resolves using index.js
import config from './../root.config.js' // unnecessary to add the `./`/
import polyfills from './utils//polyfills.js' // unnecessary to add the extra `/` before `polyfills.js`
import { processUtils } from './utils/' // unnecessary to add the extra `/` after `./utils`
// <!-- calcuator/index.js -->
import utils from './utils'
import config from '../root.config.js' // unnecessary to add the `./`/
import polyfills from './utils/polyfills.js' // unnecessary to add the extra `/` before `polyfills.js`
import { processUtils } from './utils' // unnecessary to add the extra `/` after `./utils`