Refactor relative cross-package imports to absolute ones via package name
Created by: valerybugakov
Closes #19562 (closed).
Changes
- Added new ESLint rule that forbids cross-package relative imports.
- All cross-package imports are auto-fixed by new ESLint rule.
import X from '../../shared/src/x'
👇
import X from '@sourcegraph/shared/src/x'
Note
ESLint auto-fixer for a new rule doesn't work correctly out of the box. I've patched it locally to process our repo. I plan to create a PR to ESLint rule later to fix this issue. In the meantime the rule itself correctly shows errors.