diff --git a/src/rules/no-default-export.js b/src/rules/no-default-export.js index fcb4f1b2f..d1aab1248 100644 --- a/src/rules/no-default-export.js +++ b/src/rules/no-default-export.js @@ -15,7 +15,10 @@ module.exports = { create(context) { // ignore non-modules - if (context.parserOptions.sourceType !== 'module') { + if ( + context.parserOptions.sourceType !== 'module' + && (!context.languageOptions || context.languageOptions.sourceType !== 'module') + ) { return {}; } diff --git a/src/rules/no-named-export.js b/src/rules/no-named-export.js index efaf9dc4c..7a29ca01d 100644 --- a/src/rules/no-named-export.js +++ b/src/rules/no-named-export.js @@ -13,7 +13,10 @@ module.exports = { create(context) { // ignore non-modules - if (context.parserOptions.sourceType !== 'module') { + if ( + context.parserOptions.sourceType !== 'module' + && (!context.languageOptions || context.languageOptions.sourceType !== 'module') + ) { return {}; } diff --git a/src/rules/unambiguous.js b/src/rules/unambiguous.js index 91152ea2a..568802716 100644 --- a/src/rules/unambiguous.js +++ b/src/rules/unambiguous.js @@ -19,7 +19,10 @@ module.exports = { create(context) { // ignore non-modules - if (context.parserOptions.sourceType !== 'module') { + if ( + context.parserOptions.sourceType !== 'module' + && (!context.languageOptions || context.languageOptions.sourceType !== 'module') + ) { return {}; }