Skip to content

Commit c7fdc93

Browse files
committed
refactor: use import
1 parent 3ce64f5 commit c7fdc93

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/extract-react-intl/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
PluginItem
1111
} from '@babel/core'
1212
import readBabelrcUp from 'read-babelrc-up'
13+
import babelPluginReactIntl from 'babel-plugin-react-intl'
1314

1415
type LocaleMap = Record<string, Record<string, {}>>
1516

@@ -90,10 +91,7 @@ export default async (
9091
const presets = babelrc.presets || []
9192
const plugins = babelrc.plugins || []
9293

93-
presets.unshift({
94-
// eslint-disable-next-line global-require, @typescript-eslint/no-require-imports
95-
plugins: [[require('babel-plugin-react-intl'), pluginOptions]]
96-
})
94+
presets.unshift({ plugins: [[babelPluginReactIntl, pluginOptions]] })
9795

9896
const extractFromFile = async (file: string) => {
9997
const babelOpts = {

0 commit comments

Comments
 (0)