'use strict'; var _unambiguous = require('eslint-module-utils/unambiguous'); var _docsUrl = require('../docsUrl'); var _docsUrl2 = _interopRequireDefault(_docsUrl); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @fileOverview Report modules that could parse incorrectly as scripts. * @author Ben Mosher */ module.exports = { meta: { type: 'suggestion', docs: { url: (0, _docsUrl2.default)('unambiguous') } }, create: function (context) { // ignore non-modules if (context.parserOptions.sourceType !== 'module') { return {}; } return { Program: function (ast) { if (!(0, _unambiguous.isModule)(ast)) { context.report({ node: ast, message: 'This module could be parsed as a valid script.' }); } } }; } }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGVzL3VuYW1iaWd1b3VzLmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJtZXRhIiwidHlwZSIsImRvY3MiLCJ1cmwiLCJjcmVhdGUiLCJjb250ZXh0IiwicGFyc2VyT3B0aW9ucyIsInNvdXJjZVR5cGUiLCJQcm9ncmFtIiwiYXN0IiwicmVwb3J0Iiwibm9kZSIsIm1lc3NhZ2UiXSwibWFwcGluZ3MiOiI7O0FBS0E7O0FBQ0E7Ozs7OztBQU5BOzs7OztBQVFBQSxPQUFPQyxPQUFQLEdBQWlCO0FBQ2ZDLFFBQU07QUFDSkMsVUFBTSxZQURGO0FBRUpDLFVBQU07QUFDSkMsV0FBSyx1QkFBUSxhQUFSO0FBREQ7QUFGRixHQURTOztBQVFmQyxVQUFRLFVBQVVDLE9BQVYsRUFBbUI7QUFDekI7QUFDQSxRQUFJQSxRQUFRQyxhQUFSLENBQXNCQyxVQUF0QixLQUFxQyxRQUF6QyxFQUFtRDtBQUNqRCxhQUFPLEVBQVA7QUFDRDs7QUFFRCxXQUFPO0FBQ0xDLGVBQVMsVUFBVUMsR0FBVixFQUFlO0FBQ3RCLFlBQUksQ0FBQywyQkFBU0EsR0FBVCxDQUFMLEVBQW9CO0FBQ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