Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 1a13ea1

Browse files
committed
Merge pull request #1 from yahoo/updated-react-intl-api
Updated to align with React Intl's API changes
2 parents 30532c6 + 04b39fe commit 1a13ea1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ const COMPONENT_NAMES = [
1414
];
1515

1616
const FUNCTION_NAMES = [
17-
'formatMessage',
18-
'formatHTMLMessage',
17+
'defineMessage',
1918
];
2019

2120
const IMPORTED_NAMES = new Set([...COMPONENT_NAMES, ...FUNCTION_NAMES]);
@@ -188,7 +187,7 @@ export default function ({Plugin, types: t}) {
188187
let callee = this.get('callee');
189188

190189
if (referencesImport(callee, moduleSourceName, FUNCTION_NAMES)) {
191-
let messageArg = this.get('arguments')[1];
190+
let messageArg = this.get('arguments')[0];
192191
if (!messageArg) {
193192
throw file.errorWithNode(node,
194193
`[React Intl] \`${callee.node.name}()\` requires ` +

0 commit comments

Comments
 (0)