Skip to content

Commit 34128ec

Browse files
committed
transform RUI to typescript (#394)
1 parent 6b1c4e7 commit 34128ec

File tree

194 files changed

+3135
-3025
lines changed

Some content is hidden

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

194 files changed

+3135
-3025
lines changed

.eslintrc

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,48 @@
11
{
22
"extends": [
3-
"@visionappscz/eslint-config-visionapps"
3+
"@visionappscz/eslint-config-visionapps",
4+
"plugin:deprecation/recommended"
45
],
5-
"env": {
6-
"browser": true,
7-
"jest": true
8-
},
9-
"ignorePatterns": ["src/docs/_assets/generated"],
106
"overrides": [
117
{
12-
"files": ["**/*.md"],
8+
"files": [
9+
"**/*.ts",
10+
"**/*.tsx"
11+
],
1312
"extends": [
14-
"plugin:markdown/recommended"
15-
]
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+
}
1631
}
1732
],
18-
"parser": "@babel/eslint-parser",
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+
],
1944
"rules": {
2045
"import/prefer-default-export": "off",
2146
"no-console": "error"
2247
}
23-
}
48+
}

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/site
88
/src/**/__tests__
99
/src/docs/
10-
/src/docsCustomProperties.js
10+
/src/docsCustomProperties.ts
1111
/src/index.md
1212
/tests
1313
.browserslistrc

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ module.exports = {
1212
},
1313
],
1414
'@babel/preset-react',
15+
'@babel/preset-typescript',
1516
],
1617
};

declaration.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare module '*.css';
2+
declare module '*.scss';

jest.config.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
module.exports = {
2+
extensionsToTreatAsEsm: [
3+
'.ts',
4+
'.tsx',
5+
],
26
moduleFileExtensions: [
37
'js',
48
'jsx',
9+
'ts',
10+
'tsx',
511
],
612
moduleNameMapper: {
713
'\\.scss$': 'identity-obj-proxy',
814
'\\.svg$': '<rootDir>/tests/jest/mocks/svgrMock.jsx',
915
},
16+
preset: 'ts-jest',
1017
setupFiles: [
1118
'<rootDir>/tests/jest/setupJest.js',
1219
],
1320
setupFilesAfterEnv: [
14-
'<rootDir>/tests/jest/setupTestingLibrary.js',
1521
],
1622
testEnvironment: '@happy-dom/jest-environment',
1723
testMatch: [
18-
'**/*.test.{js,jsx}',
24+
'**/*.test.{ts,tsx}',
1925
],
26+
transform: {
27+
'^.+\\.(ts|tsx)$': [
28+
'ts-jest',
29+
{ useESM: true },
30+
],
31+
},
2032
transformIgnorePatterns: [
2133
'node_modules/(?!(@react-ui-org))',
2234
],

0 commit comments

Comments
 (0)