Skip to content

Commit 0576588

Browse files
authored
Use types in tscnofig to explicitly define global types (#1045)
1 parent 5572d57 commit 0576588

File tree

106 files changed

+319
-194
lines changed

Some content is hidden

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

106 files changed

+319
-194
lines changed

extension/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../tsconfig.react.base.json",
3+
"compilerOptions": {
4+
"types": ["chrome"]
5+
},
36
"include": ["src"]
47
}

packages/d3-state-visualizer/examples/tree/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"url": "https://github.com/reduxjs/redux-devtools.git"
2020
},
2121
"scripts": {
22-
"start": "webpack serve --open",
23-
"build": "webpack",
22+
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
23+
"build": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack",
2424
"lint": "eslint . --ext .ts",
2525
"type-check": "tsc --noEmit"
2626
},
@@ -33,10 +33,10 @@
3333
"@babel/preset-env": "^7.16.7",
3434
"@babel/preset-typescript": "^7.16.7",
3535
"@types/node": "^16.11.17",
36-
"@types/webpack-dev-server": "^4.5.1",
3736
"@typescript-eslint/eslint-plugin": "^5.8.1",
3837
"@typescript-eslint/parser": "^5.8.1",
3938
"babel-loader": "^8.2.3",
39+
"cross-env": "^7.0.3",
4040
"eslint": "^8.6.0",
4141
"eslint-config-prettier": "^8.3.0",
4242
"fork-ts-checker-webpack-plugin": "^6.5.0",
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["node", "webpack-dev-server"]
5+
},
36
"include": ["webpack.config.ts"]
47
}

packages/map2tree/.eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
extends: '../../eslintrc.ts.jest.base.json',
77
parserOptions: {
88
tsconfigRootDir: __dirname,
9-
project: ['./test/tsconfig.json'],
9+
project: ['./tsconfig.json'],
1010
},
1111
},
1212
{
1313
files: ['test/**/*.ts'],
1414
extends: '../../eslintrc.ts.jest.base.json',
1515
parserOptions: {
1616
tsconfigRootDir: __dirname,
17-
project: ['./test/tsconfig.json'],
17+
project: ['./tsconfig.test.json'],
1818
},
1919
},
2020
],

packages/map2tree/jest.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
module.exports = {
22
preset: 'ts-jest',
3+
globals: {
4+
'ts-jest': {
5+
tsconfig: 'tsconfig.test.json',
6+
},
7+
},
38
};

packages/map2tree/test/tsconfig.json

-4
This file was deleted.

packages/map2tree/tsconfig.test.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["jest"]
5+
},
6+
"include": ["src", "test"]
7+
}

packages/react-base16-styling/.eslintrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
extends: '../../eslintrc.ts.jest.base.json',
77
parserOptions: {
88
tsconfigRootDir: __dirname,
9-
project: ['./test/tsconfig.json'],
9+
project: ['./tsconfig.json'],
1010
},
1111
},
1212
{
1313
files: ['test/**/*.ts'],
1414
extends: '../../eslintrc.ts.jest.base.json',
1515
parserOptions: {
1616
tsconfigRootDir: __dirname,
17-
project: ['./test/tsconfig.json'],
17+
project: ['./tsconfig.test.json'],
1818
},
1919
},
2020
],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
module.exports = {
22
preset: 'ts-jest',
33
testEnvironment: 'jsdom',
4+
globals: {
5+
'ts-jest': {
6+
tsconfig: 'tsconfig.test.json',
7+
},
8+
},
49
};

packages/react-base16-styling/test/tsconfig.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["jest"]
5+
},
6+
"include": ["src", "test"]
7+
}

packages/react-dock/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
extends: '../../eslintrc.ts.react.jest.base.json',
1515
parserOptions: {
1616
tsconfigRootDir: __dirname,
17-
project: ['./test/tsconfig.json'],
17+
project: ['./tsconfig.test.json'],
1818
},
1919
},
2020
],

packages/react-dock/demo/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"version": "0.1.3",
55
"license": "MIT",
66
"scripts": {
7-
"start": "webpack serve --open",
8-
"build": "webpack",
7+
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
8+
"build": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack",
99
"lint": "eslint . --ext .ts,.tsx",
1010
"type-check": "tsc --noEmit"
1111
},
@@ -27,10 +27,10 @@
2727
"@types/react": "^17.0.38",
2828
"@types/react-dom": "^17.0.11",
2929
"@types/styled-components": "^5.1.19",
30-
"@types/webpack-dev-server": "^4.5.1",
3130
"@typescript-eslint/eslint-plugin": "^5.8.1",
3231
"@typescript-eslint/parser": "^5.8.1",
3332
"babel-loader": "^8.2.3",
33+
"cross-env": "^7.0.3",
3434
"eslint": "^8.6.0",
3535
"eslint-config-prettier": "^8.3.0",
3636
"eslint-plugin-react": "^7.28.0",
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["node", "webpack-dev-server"]
5+
},
36
"include": ["webpack.config.ts"]
47
}

packages/react-dock/jest.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
module.exports = {
22
preset: 'ts-jest',
33
testEnvironment: 'jsdom',
4+
globals: {
5+
'ts-jest': {
6+
tsconfig: 'tsconfig.test.json',
7+
},
8+
},
49
};

packages/react-dock/test/tsconfig.json

-4
This file was deleted.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.react.base.json",
3+
"compilerOptions": {
4+
"types": ["jest"]
5+
},
6+
"include": ["src", "test"]
7+
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
extends: '../../eslintrc.ts.react.jest.base.json',
1515
parserOptions: {
1616
tsconfigRootDir: __dirname,
17-
project: ['./test/tsconfig.json'],
17+
project: ['./tsconfig.test.json'],
1818
},
1919
},
2020
{

packages/react-json-tree/examples/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"url": "https://github.com/reduxjs/redux-devtools.git"
1414
},
1515
"scripts": {
16-
"start": "webpack serve --open",
17-
"build": "webpack",
16+
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
17+
"build": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack",
1818
"lint": "eslint . --ext .ts,.tsx",
1919
"type-check": "tsc --noEmit"
2020
},
@@ -33,10 +33,10 @@
3333
"@types/node": "^16.11.17",
3434
"@types/react": "^17.0.38",
3535
"@types/react-dom": "^17.0.11",
36-
"@types/webpack-dev-server": "^4.5.1",
3736
"@typescript-eslint/eslint-plugin": "^5.8.1",
3837
"@typescript-eslint/parser": "^5.8.1",
3938
"babel-loader": "^8.2.3",
39+
"cross-env": "^7.0.3",
4040
"eslint": "^8.6.0",
4141
"eslint-config-prettier": "^8.3.0",
4242
"eslint-plugin-react": "^7.28.0",
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["node", "webpack-dev-server"]
5+
},
36
"include": ["webpack.config.ts"]
47
}
+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
module.exports = {
22
preset: 'ts-jest',
3+
globals: {
4+
'ts-jest': {
5+
tsconfig: 'tsconfig.test.json',
6+
},
7+
},
38
};

packages/react-json-tree/test/tsconfig.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.react.base.json",
3+
"compilerOptions": {
4+
"types": ["jest"]
5+
},
6+
"include": ["src", "test"]
7+
}

packages/redux-devtools-app/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
extends: '../../eslintrc.ts.react.jest.base.json',
2323
parserOptions: {
2424
tsconfigRootDir: __dirname,
25-
project: ['./test/tsconfig.json'],
25+
project: ['./tsconfig.test.json'],
2626
},
2727
},
2828
{

packages/redux-devtools-app/jest.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ module.exports = {
55
moduleNameMapper: {
66
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
77
},
8+
globals: {
9+
'ts-jest': {
10+
tsconfig: 'tsconfig.test.json',
11+
},
12+
},
813
};

packages/redux-devtools-app/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"url": "https://github.com/reduxjs/redux-devtools.git"
2222
},
2323
"scripts": {
24-
"start": "webpack serve --hot --env development --env platform=web --progress",
24+
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --hot --env development --env platform=web --progress",
2525
"build": "yarn run build:lib && yarn run build:web && yarn run build:umd && yarn run build:umd:min",
2626
"build:lib": "rollup -c",
27-
"build:web": "webpack --env platform=web --progress",
28-
"build:umd": "webpack --progress --config webpack.config.umd.ts",
29-
"build:umd:min": "webpack --env production --progress --config webpack.config.umd.ts",
27+
"build:web": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack --env platform=web --progress",
28+
"build:umd": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack --progress --config webpack.config.umd.ts",
29+
"build:umd:min": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack --env production --progress --config webpack.config.umd.ts",
3030
"clean": "rimraf build dist umd",
3131
"test": "jest",
3232
"lint": "eslint . --ext .ts,.tsx",
@@ -83,11 +83,11 @@
8383
"@types/socketcluster-client": "^13.0.5",
8484
"@types/styled-components": "^5.1.19",
8585
"@types/testing-library__jest-dom": "^5.14.2",
86-
"@types/webpack-dev-server": "^4.5.1",
8786
"@types/webpack-env": "^1.16.3",
8887
"@typescript-eslint/eslint-plugin": "^5.8.1",
8988
"@typescript-eslint/parser": "^5.8.1",
9089
"babel-loader": "^8.2.3",
90+
"cross-env": "^7.0.3",
9191
"css-loader": "^6.5.1",
9292
"eslint": "^8.6.0",
9393
"eslint-config-prettier": "^8.3.0",

packages/redux-devtools-app/test/tsconfig.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../tsconfig.react.base.json",
3+
"compilerOptions": {
4+
"types": ["webpack-env"]
5+
},
36
"include": ["demo", "src"]
47
}
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../../tsconfig.react.base.json",
33
"compilerOptions": {
4-
"outDir": "lib"
4+
"outDir": "lib",
5+
"types": ["webpack-env"]
56
},
67
"include": ["src"]
78
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.react.base.json",
3+
"compilerOptions": {
4+
"types": ["jest"]
5+
},
6+
"include": ["src", "test"]
7+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["node", "webpack-dev-server"]
5+
},
36
"include": ["webpack.config.ts", "webpack.config.umd.ts"]
47
}

packages/redux-devtools-cli/.eslintrc.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
module.exports = {
2-
extends: '../../eslintrc.ts.base.json',
3-
parserOptions: {
4-
tsconfigRootDir: __dirname,
5-
project: ['./tsconfig.json'],
6-
},
72
overrides: [
83
{
9-
files: ['test/**/*.ts', 'test/**/*.tsx'],
4+
files: ['*.ts'],
5+
extends: '../../eslintrc.ts.base.json',
6+
parserOptions: {
7+
tsconfigRootDir: __dirname,
8+
project: ['./tsconfig.json'],
9+
},
10+
},
11+
{
12+
files: ['test/**/*.ts'],
1013
extends: '../../eslintrc.ts.jest.base.json',
1114
parserOptions: {
1215
tsconfigRootDir: __dirname,
13-
project: ['./test/tsconfig.json'],
16+
project: ['./tsconfig.test.json'],
1417
},
1518
},
1619
],
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
module.exports = {
22
preset: 'ts-jest',
3+
globals: {
4+
'ts-jest': {
5+
tsconfig: 'tsconfig.test.json',
6+
},
7+
},
38
};

packages/redux-devtools-cli/test/tsconfig.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"types": ["jest"]
5+
},
6+
"include": ["src", "test"]
7+
}

packages/redux-devtools-inspector-monitor-test-tab/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
extends: '../../eslintrc.ts.react.jest.base.json',
3131
parserOptions: {
3232
tsconfigRootDir: __dirname,
33-
project: ['./test/tsconfig.json'],
33+
project: ['./tsconfig.test.json'],
3434
},
3535
},
3636
],

0 commit comments

Comments
 (0)