@graphql-eslint/eslint-plugin 3.14.3-alpha-20221227235450-493f670 → 3.14.3-alpha-20221228000849-7bb2626

Sign up to get free protection for your applications and to get access to all the features.
package/cjs/processor.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processor = void 0;
4
+ const path_1 = require("path");
4
5
  const graphql_tag_pluck_1 = require("@graphql-tools/graphql-tag-pluck");
5
6
  const utils_1 = require("@graphql-tools/utils");
6
7
  const graphql_config_js_1 = require("./graphql-config.js");
@@ -46,9 +47,10 @@ exports.processor = {
46
47
  blocksMap.set(filePath, blocks);
47
48
  return [...blocks, code /* source code must be provided and be last */];
48
49
  }
49
- catch (e) {
50
+ catch (error) {
51
+ error.message = `[graphql-eslint] Error while preprocessing "${(0, path_1.relative)(utils_js_1.CWD, filePath)}" file\n\n${error.message}`;
50
52
  // eslint-disable-next-line no-console
51
- console.error(e);
53
+ console.error(error);
52
54
  // in case of parsing error return code as is
53
55
  return [code];
54
56
  }
package/esm/processor.js CHANGED
@@ -1,7 +1,8 @@
1
+ import { relative } from 'path';
1
2
  import { gqlPluckFromCodeStringSync, } from '@graphql-tools/graphql-tag-pluck';
2
3
  import { asArray } from '@graphql-tools/utils';
3
4
  import { loadOnDiskGraphQLConfig } from './graphql-config.js';
4
- import { REPORT_ON_FIRST_CHARACTER } from './utils.js';
5
+ import { CWD, REPORT_ON_FIRST_CHARACTER } from './utils.js';
5
6
  const blocksMap = new Map();
6
7
  let onDiskConfig;
7
8
  let onDiskConfigLoaded = false;
@@ -43,9 +44,10 @@ export const processor = {
43
44
  blocksMap.set(filePath, blocks);
44
45
  return [...blocks, code /* source code must be provided and be last */];
45
46
  }
46
- catch (e) {
47
+ catch (error) {
48
+ error.message = `[graphql-eslint] Error while preprocessing "${relative(CWD, filePath)}" file\n\n${error.message}`;
47
49
  // eslint-disable-next-line no-console
48
- console.error(e);
50
+ console.error(error);
49
51
  // in case of parsing error return code as is
50
52
  return [code];
51
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.14.3-alpha-20221227235450-493f670",
3
+ "version": "3.14.3-alpha-20221228000849-7bb2626",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {