Skip to content

Commit 2cf49c6

Browse files
feat: support react 18 (#625)
1 parent c70ef4e commit 2cf49c6

20 files changed

+4307
-2338
lines changed

config/.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { babel } = require('../lib/presets');
22

33
module.exports = {
4-
extends: '@edx/eslint-config',
4+
extends: ['@edx/eslint-config'],
55
plugins: ['@typescript-eslint'],
66
parser: '@typescript-eslint/parser',
77
parserOptions: {
@@ -43,5 +43,6 @@ module.exports = {
4343
},
4444
ignorePatterns: [
4545
'module.config.js',
46+
'env.config.*',
4647
],
4748
};

config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
],
2222
rootDir: process.cwd(),
2323
moduleNameMapper: {
24-
'\\.svg': path.resolve(__dirname, 'jest/svgrMock.js'),
24+
'\\.svg': path.resolve(__dirname, 'jest/svgrMock.jsx'),
2525
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(__dirname, 'jest/fileMock.js'),
2626
'\\.(css|scss)$': 'identity-obj-proxy',
2727
'env.config': envConfigPath,

config/jest/svgrMock.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/jest/svgrMock.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const ReactComponent = (props) => <div data-testid="IconMock" {...props} />;
2+
3+
const mock = 'icon/mock/path';
4+
export default mock;

config/webpack.dev-stage.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ module.exports = merge(commonConfig, {
109109
},
110110
{
111111
test: /.svg(\?v=\d+\.\d+\.\d+)?$/,
112-
issuer: /\.jsx?$/,
112+
issuer: /\.(jsx?|tsx?)$/,
113113
use: ['@svgr/webpack'],
114114
},
115115
// Webpack, by default, uses the url-loader for images and fonts that are required/included by

config/webpack.dev.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ module.exports = merge(commonConfig, {
127127
},
128128
{
129129
test: /.svg(\?v=\d+\.\d+\.\d+)?$/,
130-
issuer: /\.jsx?$/,
130+
issuer: /\.(jsx?|tsx?)$/,
131131
use: ['@svgr/webpack'],
132132
},
133133
// Webpack, by default, uses the url-loader for images and fonts that are required/included by

config/webpack.prod.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module.exports = merge(commonConfig, {
140140
},
141141
{
142142
test: /.svg(\?v=\d+\.\d+\.\d+)?$/,
143-
issuer: /\.jsx?$/,
143+
issuer: /\.(jsx?|tsx?)$/,
144144
use: ['@svgr/webpack'],
145145
},
146146
// Webpack, by default, uses the url-loader for images and fonts that are required/included by

example/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-ignore
12
const config = require('../config/.eslintrc');
23

34
module.exports = config;

0 commit comments

Comments
 (0)