Skip to content

Commit 0ca5d0d

Browse files
committed
transform RUI to typescript (#394)
1 parent b781c28 commit 0ca5d0d

File tree

123 files changed

+4254
-5110
lines changed

Some content is hidden

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

123 files changed

+4254
-5110
lines changed

.eslintrc

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
{
22
"extends": [
3-
"@visionappscz/eslint-config-visionapps"
3+
"@visionappscz/eslint-config-visionapps",
4+
"airbnb-typescript",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
7+
"plugin:deprecation/recommended",
8+
"plugin:typescript-sort-keys/recommended",
49
],
510
"env": {
611
"browser": true,
712
"jest": true
813
},
9-
"ignorePatterns": ["src/docs/_assets/generated"],
10-
"overrides": [
11-
{
12-
"files": ["**/*.md"],
13-
"extends": [
14-
"plugin:markdown/recommended"
15-
]
16-
}
14+
"parser": "@typescript-eslint/parser",
15+
"parserOptions": {
16+
"project": "./tsconfig.json"
17+
},
18+
"plugins": [
19+
"@typescript-eslint"
1720
],
18-
"parser": "@babel/eslint-parser",
1921
"rules": {
2022
"import/prefer-default-export": "off",
2123
"no-console": "error"
2224
}
23-
}
25+
}

.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: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +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',
8-
'\\.svg$': '<rootDir>/tests/mocks/svgrMock.jsx',
14+
'\\.svg$': '<rootDir>/tests/jest/mocks/svgrMock.jsx',
915
},
16+
preset: 'ts-jest',
1017
setupFiles: [
11-
'<rootDir>/tests/setupJest.js',
18+
'<rootDir>/tests/jest/setupJest.js',
1219
],
1320
setupFilesAfterEnv: [
14-
'<rootDir>/tests/setupTestingLibrary.js',
1521
],
1622
testEnvironment: '@happy-dom/jest-environment',
23+
testMatch: [
24+
'**/*.test.{ts,tsx}',
25+
],
26+
transform: {
27+
'^.+\\.(ts|tsx)$': [
28+
'ts-jest',
29+
{ useESM: true },
30+
],
31+
},
1732
transformIgnorePatterns: [
1833
'node_modules/(?!(@react-ui-org))',
1934
],

0 commit comments

Comments
 (0)