diff --git a/eslint-plugin-expensify/prefer-import-module-contents.js b/eslint-plugin-expensify/prefer-import-module-contents.js index aadac77..571b796 100644 --- a/eslint-plugin-expensify/prefer-import-module-contents.js +++ b/eslint-plugin-expensify/prefer-import-module-contents.js @@ -41,7 +41,15 @@ function isHigherOrderComponent(source) { * @returns {Boolean} */ function isContextComponent(source) { - return /context/.test(source.toLowerCase()); + return /context|provider/.test(source.toLowerCase()); +} + +/** + * @param {String} source + * @returns {Boolean} + */ +function isJSONFile(source) { + return /\.json/.test(source.toLowerCase()); } module.exports = { @@ -52,7 +60,11 @@ module.exports = { return; } - if (isFromNodeModules(sourceValue) || isHigherOrderComponent(sourceValue) || isContextComponent(sourceValue)) { + if (isFromNodeModules(sourceValue) + || isHigherOrderComponent(sourceValue) + || isContextComponent(sourceValue) + || isJSONFile(sourceValue) + ) { return; }