fix: cleanup imports (#112)

* fix: use path alias

* fix: more path alias

* fix: even more path aliasing

* fix: even moreeeee path aliasing

* fix: sort imports

* fix: sort imports (again)
This commit is contained in:
Dhruv
2024-02-27 23:57:36 -06:00
committed by doprz
parent 19fe070491
commit b17c3fae6d
28 changed files with 53 additions and 71 deletions

View File

@@ -1,7 +1,6 @@
import { capitalize } from '@shared/util/string';
import type { Serialized } from 'chrome-extension-toolkit';
import { capitalize } from '../util/string';
/**
* A type representing an instructor for a course (who teaches it)
*/

View File

@@ -1,7 +1,6 @@
import { getCourseColors } from '@shared/util/colors';
import { theme } from 'unocss/preset-mini';
import { getCourseColors } from './colors';
export const tailwindColorways = Object.keys(theme.colors)
// check that the color is a colorway (is an object)
.filter(color => typeof theme.colors[color] === 'object')

View File

@@ -1,7 +1,6 @@
import { getLuminance } from '@shared/util/colors';
import { describe, expect, it } from 'vitest';
import { getLuminance } from '../colors';
describe('getLuminance', () => {
it('should return the correct luminance value for a given hex color', () => {
// Test case 1: Hex color #FFFFFF (white)

View File

@@ -1,7 +1,6 @@
import { generateRandomId } from '@shared/util/random';
import { describe, expect, it } from 'vitest';
import { generateRandomId } from '../random';
describe('generateRandomId', () => {
it('should generate a random ID with the specified length', () => {
// Test case 1: Length 5

View File

@@ -1,7 +1,6 @@
import { capitalize, capitalizeFirstLetter, ellipsify } from '@shared/util/string';
import { describe, expect, it } from 'vitest';
import { capitalize, capitalizeFirstLetter, ellipsify } from '../string';
// TODO: Fix `string.ts` and `string.test.ts` to make the tests pass
// `capitalize` is adding an extra space at the end of the word.
describe('capitalize', () => {

View File

@@ -1,7 +1,6 @@
import { getThemeColorHexByName, getThemeColorRgbByName, hexToRgb } from '@shared/util/themeColors';
import { describe, expect, it } from 'vitest';
import { getThemeColorHexByName, getThemeColorRgbByName, hexToRgb } from '../themeColors';
describe('hexToRgb', () => {
it('should convert hex color to RGB', () => {
expect(hexToRgb('#BF5700')).toEqual([191, 87, 0]);

View File

@@ -1,7 +1,6 @@
import { sleep } from '@shared/util/time';
import { describe, expect, it } from 'vitest';
import { sleep } from '../time';
describe('sleep', () => {
it('should resolve after the specified number of milliseconds', async () => {
const start = Date.now();