esLintError.js 378 B

12345678910111213141516171819
  1. 'use strict';
  2. function isEslintError (e) {
  3. return e.originalStack
  4. .some(stackframe => stackframe.fileName && stackframe.fileName.indexOf('eslint-loader') > 0);
  5. }
  6. function transform(error) {
  7. if (isEslintError(error)) {
  8. return Object.assign({}, error, {
  9. name: 'Lint error',
  10. type: 'lint-error',
  11. });
  12. }
  13. return error;
  14. }
  15. module.exports = transform;