Skip to content

Commit 8225312

Browse files
umairraza96ovflowd
andauthored
feat: new branch for absolute path closes #5484 (#5513)
Co-authored-by: Claudio Wunder <cwunder@gnome.org>
1 parent fda2d33 commit 8225312

73 files changed

Lines changed: 201 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88
"overrides": [
99
{
1010
"files": ["**/*.ts?(x)"],
11-
"plugins": ["@typescript-eslint"],
11+
"plugins": ["@typescript-eslint", "no-relative-import-paths"],
1212
"rules": {
13-
"@typescript-eslint/consistent-type-imports": "error"
13+
"@typescript-eslint/consistent-type-imports": "error",
14+
"no-relative-import-paths/no-relative-import-paths": [
15+
"warn",
16+
{
17+
"allowSameFolder": true,
18+
"prefix": "@"
19+
}
20+
]
1421
}
1522
},
1623
{

.storybook/main.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { StorybookConfig } from '@storybook/nextjs';
2+
import { resolve } from 'node:path';
23

34
const config: StorybookConfig = {
45
stories: ['../components/**/*.stories.tsx'],
@@ -8,6 +9,16 @@ const config: StorybookConfig = {
89
docs: { autodocs: 'tag' },
910
staticDirs: ['../public'],
1011
core: { disableTelemetry: true },
12+
webpackFinal: async (config, { configType }) => {
13+
config.resolve!.modules = [resolve(__dirname, '..'), 'node_modules'];
14+
15+
config.resolve!.alias = {
16+
...config.resolve!.alias,
17+
'@': resolve(__dirname, '../'),
18+
};
19+
20+
return config;
21+
},
1122
};
1223

1324
export default config;

__fixtures__/nodeReleases.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { NodeRelease } from '../types';
1+
import type { NodeRelease } from '@/types';
22

33
export const createNodeReleases = (): NodeRelease[] => [
44
{

components/Api/ApiChanges/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FormattedMessage } from 'react-intl';
22
import styles from './index.module.scss';
3-
import { parseApiDocsVersion } from '../../../util/parseApiDocsVersion';
4-
import type { ApiChange, ApiUpdate } from '../../../types';
3+
import { parseApiDocsVersion } from '@/util/parseApiDocsVersion';
4+
import type { ApiChange, ApiUpdate } from '@/types';
55
import type { FC } from 'react';
66

77
type ApiChangesProps = {

components/Api/JsonLink/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FormattedMessage } from 'react-intl';
22
import { FaRobot } from 'react-icons/fa';
3-
import { DOCS_URL } from '../../../next.constants.mjs';
3+
import { DOCS_URL } from '@/next.constants.mjs';
44
import type { FC } from 'react';
55

66
import styles from './index.module.scss';

components/Article/Codebox/__tests__/index.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import userEvent from '@testing-library/user-event';
22
import { render, screen } from '@testing-library/react';
33
import { IntlProvider } from 'react-intl';
44

5-
import Codebox, { replaceLabelLanguages, replaceLanguages } from '../index';
5+
import Codebox, {
6+
replaceLabelLanguages,
7+
replaceLanguages,
8+
} from '@/components/Article/Codebox/index';
69

710
describe('Replacer tests', (): void => {
811
it('replaceLabelLanguages', (): void => {

components/Article/Codebox/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useMemo, useState } from 'react';
22
import classnames from 'classnames';
33
import { TbCopy, TbCheck } from 'react-icons/tb';
4-
import { useCopyToClipboard } from '../../../hooks/useCopyToClipboard';
5-
import { usePrismJS } from '../../../hooks/usePrismJS';
4+
import { useCopyToClipboard } from '@/hooks/useCopyToClipboard';
5+
import { usePrismJS } from '@/hooks/usePrismJS';
66
import type { FC, PropsWithChildren, ReactElement, MouseEvent } from 'react';
77

88
import styles from './index.module.scss';

components/Blog/BlogCard/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FormattedDate, FormattedMessage } from 'react-intl';
22
import styles from './index.module.scss';
3-
import LocalizedLink from '../../LocalizedLink';
4-
import navigation from '../../../navigation.json';
5-
import type { BlogPost } from '../../../types';
3+
import LocalizedLink from '@/components/LocalizedLink';
4+
import navigation from '@/navigation.json';
5+
import type { BlogPost } from '@/types';
66
import type { FC } from 'react';
77

88
const getBlogCategoryUrl = (category: string): string =>

components/Common/ActiveLocalizedLink/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useRouter } from 'next/router';
22
import { useState, useEffect, type FC } from 'react';
33
import classNames from 'classnames';
4-
import LocalizedLink from '../../LocalizedLink';
4+
import LocalizedLink from '@/components/LocalizedLink';
55
import type Link from 'next/link';
66
import type { ComponentProps } from 'react';
77

components/Common/Banner/__tests__/index.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render, screen } from '@testing-library/react';
22
import { IntlProvider } from 'react-intl';
3-
import Banner from '../index';
4-
import type { WebsiteBanner } from '../../../../types';
3+
import Banner from '@/components/Common/Banner/index';
4+
import type { WebsiteBanner } from '@/types';
55

66
const bannersIndex: WebsiteBanner = {
77
endDate: '',

0 commit comments

Comments
 (0)