Skip to content

Commit c1a3856

Browse files
committed
fixup! transform RUI to typescript (#394)
1 parent e126e61 commit c1a3856

File tree

162 files changed

+460
-370
lines changed

Some content is hidden

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

162 files changed

+460
-370
lines changed

.eslintrc

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,27 @@
11
{
22
"extends": [
3-
"@visionappscz/eslint-config-visionapps",
4-
"plugin:deprecation/recommended"
3+
"@visionappscz/eslint-config-visionapps"
4+
],
5+
"env": {
6+
"browser": true,
7+
"jest": true
8+
},
9+
"ignorePatterns": [
10+
"src/docs/_assets/generated"
511
],
612
"overrides": [
713
{
814
"files": [
9-
"**/*.ts",
10-
"**/*.tsx"
15+
"**/*.md"
1116
],
1217
"extends": [
13-
"@visionappscz/eslint-config-visionapps",
14-
"airbnb-typescript",
15-
"plugin:@typescript-eslint/recommended",
16-
"plugin:typescript-sort-keys/recommended"
17-
],
18-
"parser": "@typescript-eslint/parser",
19-
"parserOptions": {
20-
"project": "tsconfig.json"
21-
},
22-
"plugins": ["@typescript-eslint"],
23-
"rules": {
24-
"@typescript-eslint/no-unused-vars": ["error"],
25-
"@typescript-eslint/object-curly-spacing": ["error"],
26-
"import/prefer-default-export": ["off"],
27-
"no-console": ["error"],
28-
"react/default-props-match-prop-types": ["off"],
29-
"react/require-default-props": ["off"]
30-
}
18+
"plugin:markdown/recommended"
19+
]
3120
}
3221
],
33-
"env": {
34-
"browser": true,
35-
"jest": true
36-
},
37-
"parser": "@typescript-eslint/parser",
38-
"parserOptions": {
39-
"project": "./tsconfig.json"
40-
},
41-
"plugins": [
42-
"@typescript-eslint"
43-
],
22+
"parser": "@babel/eslint-parser",
4423
"rules": {
4524
"import/prefer-default-export": "off",
4625
"no-console": "error"
4726
}
48-
}
27+
}

.eslintrc-ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"plugin:@typescript-eslint/recommended",
66
"plugin:@typescript-eslint/recommended-type-checked",
77
"plugin:deprecation/recommended",
8-
"plugin:typescript-sort-keys/recommended",
8+
"plugin:typescript-sort-keys/recommended"
99
],
1010
"env": {
1111
"browser": true,
@@ -15,7 +15,7 @@
1515
{
1616
"files": [
1717
"*.spec.tsx",
18-
"*.story.tsx",
18+
"*.story.tsx"
1919
],
2020
"rules": {
2121
"@typescript-eslint/unbound-method": "off"

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ It is possible to run React UI in your app in development mode. This is useful
8080
because:
8181

8282
- In production mode React UI uses non-human-readable class names.
83-
- Runtime check (i.e. PropTypes) are suppressed in production mode.
8483

8584
To enable development mode, add the following code to the `webpack.config.js`
8685
file in your app:

declaration.d.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
declare module '*.css';
2-
declare module '*.scss';
1+
declare module '*.css' {
2+
const classes: { [key: string]: string };
3+
export default classes;
4+
}
5+
6+
declare module '*.scss' {
7+
const classes: { [key: string]: string };
8+
export default classes;
9+
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@
121121
"mini-css-extract-plugin": "^2.9.0",
122122
"postcss": "^8.4.39",
123123
"postcss-loader": "^8.1.1",
124-
"prop-types": "^15.8.1",
125124
"react": "~18.2.0",
126125
"react-dom": "~18.2.0",
127126
"sass": "^1.77.6",

src/components/Alert/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { classNames } from '../../helpers/classNames/classNames';
55
import { transferProps } from '../../helpers/transferProps';
66
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
77
import styles from './Alert.module.scss';
8-
import { AlertProps } from './Alert.types';
8+
import type { AlertProps } from './Alert.types';
99

1010
export const Alert: React.FunctionComponent<AlertProps> = ({
1111
children,

src/components/Alert/Alert.types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { ReactNode } from 'react';
2-
import {
1+
import type { ReactNode } from 'react';
2+
import type {
3+
CleanedComponentProps,
34
FeedbackColor,
45
NeutralColor,
56
} from '../../types';
67

7-
export type AlertProps = React.ComponentProps<'div'> & {
8+
export type AlertProps = CleanedComponentProps<'div'> & {
89
/**
910
* Alert body.
1011
*/

src/components/Badge/Badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { classNames } from '../../helpers/classNames/classNames';
44
import { transferProps } from '../../helpers/transferProps';
55
import { getRootColorClassName } from '../_helpers/getRootColorClassName';
66
import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName';
7-
import { BadgeProps } from './Badge.types';
7+
import type { BadgeProps } from './Badge.types';
88
import styles from './Badge.module.scss';
99

1010
export const Badge: React.FunctionComponent<BadgeProps> = ({

src/components/Badge/Badge.types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import {
1+
import type {
2+
CleanedComponentProps,
23
FeedbackColor,
34
NeutralColor,
45
Priority,
56
} from '../../types';
67

7-
export type BadgeProps = React.ComponentProps<'div'> & {
8+
export type BadgeProps = CleanedComponentProps<'div'> & {
89
/**
910
* Color to clarify importance and meaning of the badge. Implements
1011
* [Feedback and Neutral color collections](/docs/foundation/collections#colors).

src/components/Badge/__tests__/Badge.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '@testing-library/react';
66
import { feedbackColorPropTest } from '../../../../tests/jest/propTests/feedbackColorPropTest';
77
import { neutralColorPropTest } from '../../../../tests/jest/propTests/neutralColorPropTest';
8-
import { Badge } from '../Badge';
8+
import { Badge } from '../Badge.tsx';
99

1010
const mandatoryProps = {
1111
label: 'label',

0 commit comments

Comments
 (0)