no-webpack-loader-syntax.js 2.9 KB

1234567891011121314151617181920212223242526
  1. 'use strict';var _moduleVisitor = require('eslint-module-utils/moduleVisitor');var _moduleVisitor2 = _interopRequireDefault(_moduleVisitor);
  2. var _docsUrl = require('../docsUrl');var _docsUrl2 = _interopRequireDefault(_docsUrl);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { 'default': obj };}
  3. function reportIfNonStandard(context, node, name) {
  4. if (name && name.indexOf('!') !== -1) {
  5. context.report(node, 'Unexpected \'!\' in \'' + String(name) + '\'. ' +
  6. 'Do not use import syntax to configure webpack loaders.');
  7. }
  8. }
  9. module.exports = {
  10. meta: {
  11. type: 'problem',
  12. docs: {
  13. url: (0, _docsUrl2['default'])('no-webpack-loader-syntax') },
  14. schema: [] },
  15. create: function () {function create(context) {
  16. return (0, _moduleVisitor2['default'])(function (source, node) {
  17. reportIfNonStandard(context, node, source.value);
  18. }, { commonjs: true });
  19. }return create;}() };
  20. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlcy9uby13ZWJwYWNrLWxvYWRlci1zeW50YXguanMiXSwibmFtZXMiOlsicmVwb3J0SWZOb25TdGFuZGFyZCIsImNvbnRleHQiLCJub2RlIiwibmFtZSIsImluZGV4T2YiLCJyZXBvcnQiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0YSIsInR5cGUiLCJkb2NzIiwidXJsIiwic2NoZW1hIiwiY3JlYXRlIiwic291cmNlIiwidmFsdWUiLCJjb21tb25qcyJdLCJtYXBwaW5ncyI6ImFBQUEsa0U7QUFDQSxxQzs7QUFFQSxTQUFTQSxtQkFBVCxDQUE2QkMsT0FBN0IsRUFBc0NDLElBQXRDLEVBQTRDQyxJQUE1QyxFQUFrRDtBQUNoRCxNQUFJQSxRQUFRQSxLQUFLQyxPQUFMLENBQWEsR0FBYixNQUFzQixDQUFDLENBQW5DLEVBQXNDO0FBQ3BDSCxZQ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