Useless path segments for "./i18n/", should be "./i18n"
1import "@total-typescript/ts-reset"
2import "./i18n/" 3import type {} from "graphql-request"
4import type {} from "swr"
5export { useAppStore } from "./common/store/app"
Description
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
Bad Practice
// <!-- 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`
Recommended
// <!-- 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`