Skip to content

Commit

Permalink
feat: support react 18
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Feb 11, 2025
1 parent c70ef4e commit fa7306f
Show file tree
Hide file tree
Showing 19 changed files with 5,281 additions and 2,125 deletions.
3 changes: 2 additions & 1 deletion config/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { babel } = require('../lib/presets');

module.exports = {
extends: '@edx/eslint-config',
extends: ['@edx/eslint-config', 'plugin:import/typescript'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down Expand Up @@ -43,5 +43,6 @@ module.exports = {
},
ignorePatterns: [
'module.config.js',
'env.config.*',
],
};
2 changes: 1 addition & 1 deletion config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
],
rootDir: process.cwd(),
moduleNameMapper: {
'\\.svg': path.resolve(__dirname, 'jest/svgrMock.js'),
'\\.svg': path.resolve(__dirname, 'jest/svgrMock.jsx'),
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(__dirname, 'jest/fileMock.js'),
'\\.(css|scss)$': 'identity-obj-proxy',
'env.config': envConfigPath,
Expand Down
4 changes: 0 additions & 4 deletions config/jest/svgrMock.js

This file was deleted.

4 changes: 4 additions & 0 deletions config/jest/svgrMock.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const ReactComponent = (props) => <div data-testid="IconMock" {...props} />;

const mock = 'icon/mock/path';
export default mock;
2 changes: 1 addition & 1 deletion config/webpack.dev-stage.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.exports = merge(commonConfig, {
},
{
test: /.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.jsx?$/,
issuer: /\.(jsx?|tsx?)$/,
use: ['@svgr/webpack'],
},
// Webpack, by default, uses the url-loader for images and fonts that are required/included by
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = merge(commonConfig, {
},
{
test: /.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.jsx?$/,
issuer: /\.(jsx?|tsx?)$/,
use: ['@svgr/webpack'],
},
// Webpack, by default, uses the url-loader for images and fonts that are required/included by
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ module.exports = merge(commonConfig, {
},
{
test: /.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.jsx?$/,
issuer: /\.(jsx?|tsx?)$/,
use: ['@svgr/webpack'],
},
// Webpack, by default, uses the url-loader for images and fonts that are required/included by
Expand Down
1 change: 1 addition & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-ignore
const config = require('../config/.eslintrc');

module.exports = config;
Loading

0 comments on commit fa7306f

Please sign in to comment.