Skip to content

Commit 40ac89a

Browse files
authored
feature(react-json-tree): convert react-json-tree to TypeScript (#601)
* eslint base * stash * setup * stash * stash * Add jest.config.js * caught
1 parent ac6f743 commit 40ac89a

37 files changed

+634
-352
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
*.js text eol=lf
22
*.jsx text eol=lf
3+
*.ts text eol=lf
4+
*.tsx text eol=lf
35
*.json text eol=lf
46
*.css text eol=lf
57
*.html text eol=lf

eslintrc.ts.base.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,11 @@
88
"plugin:@typescript-eslint/recommended-requiring-type-checking",
99
"plugin:prettier/recommended",
1010
"prettier/@typescript-eslint"
11-
]
11+
],
12+
"rules": {
13+
"@typescript-eslint/no-unsafe-return": "off",
14+
"@typescript-eslint/no-unsafe-assignment": "off",
15+
"@typescript-eslint/no-unsafe-call": "off",
16+
"@typescript-eslint/no-unsafe-member-access": "off"
17+
}
1218
}

eslintrc.ts.jest.base.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99
"plugin:jest/style",
1010
"plugin:prettier/recommended",
1111
"prettier/@typescript-eslint"
12-
]
12+
],
13+
"rules": {
14+
"@typescript-eslint/no-unsafe-return": "off",
15+
"@typescript-eslint/no-unsafe-assignment": "off",
16+
"@typescript-eslint/no-unsafe-call": "off",
17+
"@typescript-eslint/no-unsafe-member-access": "off"
18+
}
1319
}

eslintrc.ts.react.base.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaFeatures": {
5+
"jsx": true
6+
}
7+
},
8+
"plugins": ["@typescript-eslint", "react"],
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/eslint-recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
14+
"plugin:react/recommended",
15+
"plugin:prettier/recommended",
16+
"prettier/@typescript-eslint",
17+
"prettier/react"
18+
],
19+
"settings": {
20+
"react": {
21+
"version": "detect"
22+
}
23+
},
24+
"rules": {
25+
"@typescript-eslint/no-unsafe-return": "off",
26+
"@typescript-eslint/no-unsafe-assignment": "off",
27+
"@typescript-eslint/no-unsafe-call": "off",
28+
"@typescript-eslint/no-unsafe-member-access": "off"
29+
}
30+
}

eslintrc.ts.react.jest.base.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"plugins": ["jest"],
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/eslint-recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
8+
"plugin:react/recommended",
9+
"plugin:jest/recommended",
10+
"plugin:jest/style",
11+
"plugin:prettier/recommended",
12+
"prettier/@typescript-eslint",
13+
"prettier/react"
14+
],
15+
"rules": {
16+
"@typescript-eslint/no-unsafe-return": "off",
17+
"@typescript-eslint/no-unsafe-assignment": "off",
18+
"@typescript-eslint/no-unsafe-call": "off",
19+
"@typescript-eslint/no-unsafe-member-access": "off"
20+
}
21+
}

package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"@babel/preset-env": "^7.11.0",
88
"@babel/preset-typescript": "^7.10.4",
99
"@types/jest": "^26.0.9",
10+
"@types/node": "^14.6.0",
11+
"@types/react-test-renderer": "^16.9.3",
12+
"@types/webpack": "^4.41.21",
13+
"@types/webpack-dev-server": "^3.11.0",
1014
"@typescript-eslint/eslint-plugin": "^3.9.0",
1115
"@typescript-eslint/parser": "^3.9.0",
1216
"babel-eslint": "^10.1.0",
@@ -16,14 +20,18 @@
1620
"eslint-plugin-jest": "^23.20.0",
1721
"eslint-plugin-prettier": "^3.1.4",
1822
"eslint-plugin-react": "^7.20.5",
19-
"husky": "^4.2.5",
2023
"jest": "^26.2.2",
2124
"lerna": "^3.22.1",
22-
"lint-staged": "^10.2.11",
2325
"prettier": "^2.0.5",
26+
"react": "^16.13.1",
27+
"react-dom": "^16.13.1",
28+
"react-test-renderer": "^16.13.1",
2429
"rimraf": "^3.0.2",
2530
"ts-jest": "^26.2.0",
26-
"typescript": "^3.9.7"
31+
"ts-node": "^9.0.0",
32+
"typescript": "^3.9.7",
33+
"webpack": "^4.44.1",
34+
"webpack-cli": "^3.3.12"
2735
},
2836
"scripts": {
2937
"lerna": "lerna",

packages/react-base16-styling/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,6 @@ export const invertTheme = (theme: Theme | undefined): Theme | undefined => {
288288

289289
return theme;
290290
};
291+
292+
export { Base16Theme };
293+
export * from './types';

packages/react-json-tree/.babelrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-react"],
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
"@babel/preset-typescript"
6+
],
37
"plugins": ["@babel/plugin-proposal-class-properties"]
48
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib
2+
umd

packages/react-json-tree/.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
extends: '../../.eslintrc',
3+
overrides: [
4+
{
5+
files: ['*.ts', '*.tsx'],
6+
extends: '../../eslintrc.ts.react.base.json',
7+
parserOptions: {
8+
tsconfigRootDir: __dirname,
9+
project: ['./tsconfig.json'],
10+
},
11+
},
12+
{
13+
files: ['test/*.ts', 'test/*.tsx'],
14+
extends: '../../eslintrc.ts.react.jest.base.json',
15+
parserOptions: {
16+
tsconfigRootDir: __dirname,
17+
project: ['./test/tsconfig.json'],
18+
},
19+
},
20+
{
21+
files: ['webpack.config.umd.ts'],
22+
extends: '../../eslintrc.ts.base.json',
23+
parserOptions: {
24+
tsconfigRootDir: __dirname,
25+
project: ['./tsconfig.webpack.json'],
26+
},
27+
},
28+
],
29+
};

0 commit comments

Comments
 (0)