Skip to content
Permalink
Browse files

New: Node.js API

Fix #1532
  • Loading branch information...
sarvaje authored and molant committed Mar 26, 2019
1 parent 09c5383 commit d934aeb9b714a7ddcaf1d09a3790348eaa4c335b
Showing with 1,826 additions and 1,409 deletions.
  1. +2 βˆ’3 packages/connector-chrome/src/chrome-launcher.ts
  2. +3 βˆ’3 packages/connector-chrome/src/connector.ts
  3. +1 βˆ’2 packages/connector-chrome/tests/collect.ts
  4. +1 βˆ’2 packages/connector-chrome/tests/evaluate.ts
  5. +1 βˆ’2 packages/connector-chrome/tests/events.ts
  6. +1 βˆ’2 packages/connector-chrome/tests/fetch-content.ts
  7. +2 βˆ’2 packages/connector-chrome/tests/invalid-url.ts
  8. +2 βˆ’2 packages/connector-chrome/tests/request-response.ts
  9. +4 βˆ’3 packages/connector-edge/src/connector-edge-launcher.ts
  10. +3 βˆ’14 packages/connector-jsdom/src/connector.ts
  11. +3 βˆ’5 packages/connector-jsdom/src/resource-loader.ts
  12. +1 βˆ’2 packages/connector-jsdom/tests/collect.ts
  13. +1 βˆ’2 packages/connector-jsdom/tests/evaluate.ts
  14. +2 βˆ’2 packages/connector-jsdom/tests/events.ts
  15. +2 βˆ’2 packages/connector-jsdom/tests/fetch-content.ts
  16. +2 βˆ’2 packages/connector-jsdom/tests/invalid-url.ts
  17. +2 βˆ’2 packages/connector-jsdom/tests/request-response.ts
  18. +27 βˆ’3 packages/connector-local/src/connector.ts
  19. +1 βˆ’2 packages/connector-local/tests/tests.ts
  20. +3 βˆ’4 packages/create-hint/package.json
  21. +1 βˆ’2 packages/create-hint/src/create-hint.ts
  22. +2 βˆ’1 packages/create-hint/src/handlebars-utils.ts
  23. +3 βˆ’3 packages/create-hintrc/package.json
  24. +2 βˆ’3 packages/create-hintrc/src/create-hintrc.ts
  25. +1 βˆ’1 packages/create-hintrc/tests/create-hintrc.ts
  26. +3 βˆ’4 packages/create-parser/package.json
  27. +3 βˆ’1 packages/create-parser/src/handlebars-utils.ts
  28. +1 βˆ’0 packages/create-parser/src/new-parser.ts
  29. +1 βˆ’1 packages/extension-browser/package.json
  30. +3 βˆ’3 packages/extension-browser/src/content-script/connector.ts
  31. +1 βˆ’1 packages/extension-browser/src/content-script/webhint.ts
  32. +4 βˆ’0 packages/extension-vscode/CONTRIBUTING.md
  33. +25 βˆ’51 packages/extension-vscode/src/server.ts
  34. +29 βˆ’39 packages/extension-vscode/tests/fixtures/mocks.ts
  35. +51 βˆ’41 packages/extension-vscode/tests/server.ts
  36. +1 βˆ’1 packages/formatter-codeframe/src/formatter.ts
  37. +1 βˆ’1 packages/formatter-excel/src/formatter.ts
  38. +1 βˆ’2 packages/formatter-html/src/formatter.ts
  39. +2 βˆ’3 packages/formatter-html/src/result.ts
  40. +2 βˆ’1 packages/formatter-html/tests/tests.ts
  41. +1 βˆ’1 packages/formatter-json/src/formatter.ts
  42. +1 βˆ’1 packages/formatter-json/tests/tests.ts
  43. +1 βˆ’1 packages/formatter-stylish/src/formatter.ts
  44. +1 βˆ’1 packages/formatter-summary/src/formatter.ts
  45. +1 βˆ’2 packages/hint-apple-touch-icons/src/hint.ts
  46. +1 βˆ’3 packages/hint-apple-touch-icons/src/meta.ts
  47. +1 βˆ’1 packages/hint-axe/src/meta.ts
  48. +1 βˆ’3 packages/hint-babel-config/src/is-valid.ts
  49. +1 βˆ’3 packages/hint-babel-config/src/meta/is-valid.ts
  50. +1 βˆ’2 packages/hint-create-element-svg/src/hint.ts
  51. +1 βˆ’3 packages/hint-create-element-svg/src/meta.ts
  52. +1 βˆ’2 packages/hint-doctype/src/hint.ts
  53. +1 βˆ’3 packages/hint-doctype/src/meta.ts
  54. +1 βˆ’1 packages/hint-doctype/src/types.ts
  55. +1 βˆ’2 packages/hint-html-checker/src/hint.ts
  56. +1 βˆ’3 packages/hint-html-checker/src/meta.ts
  57. +2 βˆ’3 packages/hint-http-compression/src/hint.ts
  58. +1 βˆ’3 packages/hint-http-compression/src/meta.ts
  59. +2 βˆ’4 packages/hint-https-only/src/hint.ts
  60. +1 βˆ’3 packages/hint-https-only/src/meta.ts
  61. +1 βˆ’1 packages/hint-image-optimization-cloudinary/src/cloudinary-types.ts
  62. +1 βˆ’2 packages/hint-image-optimization-cloudinary/src/hint.ts
  63. +1 βˆ’3 packages/hint-image-optimization-cloudinary/src/meta.ts
  64. +1 βˆ’0 packages/hint-image-optimization-cloudinary/tests/tests.ts
  65. +2 βˆ’2 packages/hint-manifest-exists/src/hint.ts
  66. +1 βˆ’3 packages/hint-manifest-exists/src/meta.ts
  67. +2 βˆ’2 packages/hint-meta-theme-color/src/hint.ts
  68. +1 βˆ’3 packages/hint-meta-theme-color/src/meta.ts
  69. +2 βˆ’3 packages/hint-no-bom/src/hint.ts
  70. +1 βˆ’3 packages/hint-no-bom/src/meta.ts
  71. +4 βˆ’4 packages/hint-no-broken-links/src/hint.ts
  72. +1 βˆ’3 packages/hint-no-broken-links/src/meta.ts
  73. +1 βˆ’2 packages/hint-no-friendly-error-pages/src/hint.ts
  74. +1 βˆ’3 packages/hint-no-friendly-error-pages/src/meta.ts
  75. +1 βˆ’2 packages/hint-no-p3p/src/hint.ts
  76. +1 βˆ’3 packages/hint-no-p3p/src/meta.ts
  77. +1 βˆ’1 packages/hint-no-vulnerable-javascript-libraries/src/meta.ts
  78. +1 βˆ’2 packages/hint-performance-budget/src/hint.ts
  79. +1 βˆ’3 packages/hint-performance-budget/src/meta.ts
  80. +1 βˆ’2 packages/hint-ssllabs/src/hint.ts
  81. +1 βˆ’3 packages/hint-ssllabs/src/meta.ts
  82. +1 βˆ’2 packages/hint-strict-transport-security/src/hint.ts
  83. +1 βˆ’3 packages/hint-strict-transport-security/src/meta.ts
  84. +1 βˆ’2 packages/hint-typescript-config/src/consistent-casing.ts
  85. +1 βˆ’1 packages/hint-typescript-config/src/helpers/config-checker.ts
  86. +1 βˆ’2 packages/hint-typescript-config/src/import-helpers.ts
  87. +1 βˆ’2 packages/hint-typescript-config/src/is-valid.ts
  88. +1 βˆ’3 packages/hint-typescript-config/src/meta/consistent-casing.ts
  89. +1 βˆ’3 packages/hint-typescript-config/src/meta/import-helpers.ts
  90. +1 βˆ’3 packages/hint-typescript-config/src/meta/is-valid.ts
  91. +1 βˆ’3 packages/hint-typescript-config/src/meta/no-comments.ts
  92. +1 βˆ’3 packages/hint-typescript-config/src/meta/strict.ts
  93. +1 βˆ’3 packages/hint-typescript-config/src/meta/target.ts
  94. +1 βˆ’2 packages/hint-typescript-config/src/no-comments.ts
  95. +1 βˆ’2 packages/hint-typescript-config/src/strict.ts
  96. +1 βˆ’2 packages/hint-typescript-config/src/target.ts
  97. +1 βˆ’2 packages/hint-webpack-config/src/config-exists.ts
  98. +1 βˆ’2 packages/hint-webpack-config/src/is-installed.ts
  99. +1 βˆ’2 packages/hint-webpack-config/src/is-valid.ts
  100. +1 βˆ’3 packages/hint-webpack-config/src/meta/config-exists.ts
  101. +1 βˆ’3 packages/hint-webpack-config/src/meta/is-installed.ts
  102. +1 βˆ’3 packages/hint-webpack-config/src/meta/is-valid.ts
  103. +1 βˆ’3 packages/hint-webpack-config/src/meta/module-esnext-typescript.ts
  104. +1 βˆ’3 packages/hint-webpack-config/src/meta/modules-false-babel.ts
  105. +1 βˆ’3 packages/hint-webpack-config/src/meta/no-devtool-in-prod.ts
  106. +1 βˆ’2 packages/hint-webpack-config/src/module-esnext-typescript.ts
  107. +1 βˆ’2 packages/hint-webpack-config/src/modules-false-babel.ts
  108. +1 βˆ’2 packages/hint-webpack-config/src/no-devtool-in-prod.ts
  109. +4 βˆ’0 packages/hint/docs/contributor-guide/how-to/formatter.md
  110. +128 βˆ’0 packages/hint/docs/user-guide/api/using-api.md
  111. +1 βˆ’1 packages/hint/package.json
  112. +267 βˆ’0 packages/hint/src/lib/analyzer.ts
  113. +1 βˆ’1 packages/hint/src/lib/cli.ts
  114. +166 βˆ’184 packages/hint/src/lib/cli/analyze.ts
  115. +1 βˆ’1 packages/hint/src/lib/cli/version.ts
  116. +14 βˆ’88 packages/hint/src/lib/config.ts
  117. +5 βˆ’2 packages/hint/src/lib/engine.ts
  118. +7 βˆ’0 packages/hint/src/lib/enums/error-status.ts
  119. +4 βˆ’0 packages/hint/src/lib/enums/index.ts
  120. +14 βˆ’0 packages/hint/src/lib/index.ts
  121. +2 βˆ’0 packages/hint/src/lib/types.ts
  122. +28 βˆ’0 packages/hint/src/lib/types/analyzer-error.ts
  123. +38 βˆ’0 packages/hint/src/lib/types/analyzer.ts
  124. +5 βˆ’1 packages/hint/src/lib/types/events.ts
  125. +1 βˆ’1 packages/hint/src/lib/types/html.ts
  126. +6 βˆ’2 packages/hint/src/lib/utils/content-type.ts
  127. +1 βˆ’1 packages/hint/src/lib/utils/dom/create-html-document.ts
  128. +1 βˆ’1 packages/hint/src/lib/utils/dom/find-original-element.ts
  129. +1 βˆ’1 packages/hint/src/lib/utils/dom/get-element-by-url.ts
  130. +4 βˆ’0 packages/hint/src/lib/utils/dom/index.ts
  131. +4 βˆ’3 packages/hint/src/lib/utils/dom/traverse.ts
  132. +15 βˆ’0 packages/hint/src/lib/utils/index.ts
  133. +1 βˆ’0 packages/hint/src/lib/utils/packages/index.ts
  134. +1 βˆ’1 packages/hint/src/lib/utils/packages/load-hint-package.ts
  135. +2 βˆ’2 packages/hint/src/lib/utils/resource-loader.ts
  136. +563 βˆ’0 packages/hint/tests/lib/analyzer.ts
  137. +5 βˆ’5 packages/hint/tests/lib/cli.ts
  138. +163 βˆ’599 packages/hint/tests/lib/cli/analyze.ts
  139. +46 βˆ’79 packages/hint/tests/lib/config.ts
  140. +2 βˆ’2 packages/hint/tests/lib/types/html.ts
  141. +2 βˆ’2 packages/hint/tests/lib/utils/dom/find-original-element.ts
  142. +2 βˆ’2 packages/hint/tests/lib/utils/dom/get-element-by-url.ts
  143. +2 βˆ’2 packages/hint/tests/lib/utils/resource-loader.ts
  144. +2 βˆ’5 packages/parser-babel-config/src/parser.ts
  145. +1 βˆ’1 packages/parser-html/src/parser.ts
  146. +2 βˆ’4 packages/parser-package-json/src/parser.ts
  147. +2 βˆ’2 packages/parser-package-json/src/types.ts
  148. +1 βˆ’2 packages/parser-package-json/tests/tests.ts
  149. +2 βˆ’4 packages/parser-typescript-config/src/parser.ts
  150. +1 βˆ’2 packages/parser-typescript-config/src/types.ts
  151. +2 βˆ’2 packages/parser-typescript-config/tests/tests.ts
  152. +1 βˆ’2 packages/parser-webpack-config/src/parser.ts
  153. +1 βˆ’1 packages/parser-webpack-config/src/types.ts
  154. +1 βˆ’2 packages/parser-webpack-config/tests/webpack-config.ts
  155. +1 βˆ’0 packages/utils-connector-tools/package.json
  156. +4 βˆ’0 packages/utils-connector-tools/src/index.ts
  157. +2 βˆ’2 packages/utils-connector-tools/src/requester.ts
  158. +1 βˆ’1 packages/utils-connector-tools/tests/requester.ts
  159. +1 βˆ’0 packages/utils-debugging-protocol-common/package.json
  160. +3 βˆ’4 packages/utils-debugging-protocol-common/src/debugging-protocol-connector.ts
  161. +3 βˆ’0 packages/utils-debugging-protocol-common/src/index.ts
  162. +1 βˆ’1 packages/utils-debugging-protocol-common/src/launcher.ts
  163. +4 βˆ’4 packages/utils-debugging-protocol-common/src/request-response.ts
  164. +1 βˆ’1 packages/utils-tests-helpers/src/connectors.ts
  165. +2 βˆ’4 packages/utils-tests-helpers/src/hint-runner.ts
  166. +1 βˆ’1 packages/utils-tests-helpers/src/hint-test-type.ts
  167. +2 βˆ’2 packages/utils/src/fs/is-file.ts
@@ -6,9 +6,8 @@ import * as chromeLauncher from 'chrome-launcher';
import * as isCI from 'is-ci';

import { debug as d, fs, misc } from '@hint/utils';

import { Launcher } from '@hint/utils-debugging-protocol-common/dist/src/launcher';
import { BrowserInfo, LauncherOptions } from 'hint/dist/src/lib/types';
import { Launcher } from '@hint/utils-debugging-protocol-common';
import { BrowserInfo, LauncherOptions } from 'hint';

const { readFileAsync, writeFileAsync } = fs;
const { delay } = misc;
@@ -10,11 +10,11 @@
* ------------------------------------------------------------------------------
*/

import { Connector } from '@hint/utils-debugging-protocol-common/dist/src/debugging-protocol-connector';
import { ILauncher } from 'hint/dist/src/lib/types';
import { Connector } from '@hint/utils-debugging-protocol-common';
import { Engine, ILauncher } from 'hint';

import { CDPLauncher } from './chrome-launcher';

import { Engine } from 'hint';

export default class ChromeConnector extends Connector {
public constructor(server: Engine, config?: object) {
@@ -8,8 +8,7 @@ import * as sinon from 'sinon';
import anyTest, { TestInterface, ExecutionContext } from 'ava';

import { Server, ServerConfiguration } from '@hint/utils-create-server';
import { Events, IConnector, IConnectorConstructor } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector, IConnectorConstructor } from 'hint';
import { test as testUtils } from '@hint/utils';

import ChromeConnector from '../src/connector';
@@ -4,8 +4,7 @@ import test from 'ava';

import { Server } from '@hint/utils-create-server';
import { test as testUtils } from '@hint/utils';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector } from 'hint';

import ChromeConnector from '../src/connector';

@@ -14,8 +14,7 @@ import every = require('lodash/every');
import * as sinon from 'sinon';
import anyTest, { TestInterface } from 'ava';
import { Server } from '@hint/utils-create-server';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector } from 'hint';

import ChromeConnector from '../src/connector';

@@ -6,8 +6,7 @@ import { URL } from 'url';

import test from 'ava';
import { Server } from '@hint/utils-create-server';
import { IConnector, NetworkData, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector, NetworkData } from 'hint';

import ChromeConnector from '../src/connector';

@@ -1,8 +1,8 @@
import { URL } from 'url';

import test from 'ava';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';

import { Engine, Events, IConnector } from 'hint';

import ChromeConnector from '../src/connector';

@@ -12,9 +12,9 @@ import * as zlib from 'zlib';

import * as sinon from 'sinon';
import test from 'ava';

import { Server } from '@hint/utils-create-server';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector } from 'hint';

import ChromeConnector from '../src/connector';

@@ -14,11 +14,12 @@ import * as os from 'os';
import * as path from 'path';
import { promisify } from 'util';

import { debug as d, logger, misc } from '@hint/utils';
import { Launcher } from '@hint/utils-debugging-protocol-common/dist/src/launcher';
import { BrowserInfo, LauncherOptions } from 'hint/dist/src/lib/types';
import * as nodeWindows from 'node-windows';

import { debug as d, logger, misc } from '@hint/utils';
import { Launcher } from '@hint/utils-debugging-protocol-common';
import { BrowserInfo, LauncherOptions } from 'hint';

const { delay } = misc;
const diagnosticsPath = require.resolve('edge-diagnostics-adapter');
const elevate = promisify(nodeWindows.elevate);
@@ -32,30 +32,19 @@ import { fork, ChildProcess } from 'child_process';
import { JSDOM, ResourceLoader, VirtualConsole } from 'jsdom';

import { debug as d, HttpHeaders, network } from '@hint/utils';
import { getContentTypeData, getType } from 'hint/dist/src/lib/utils/content-type';
import {
HTMLDocument,
IConnector,
HTMLElement,
Event, FetchEnd, FetchError,
NetworkData
} from 'hint/dist/src/lib/types';
import { Engine } from 'hint/dist/src/lib/engine';
import createHTMLDocument from 'hint/dist/src/lib/utils/dom/create-html-document';
import traverse from 'hint/dist/src/lib/utils/dom/traverse';

import { Requester } from '@hint/utils-connector-tools/dist/src/requester';
import { Engine, Event, FetchEnd, FetchError, HTMLDocument, HTMLElement, IConnector, NetworkData, utils } from 'hint';
import { Requester } from '@hint/utils-connector-tools';

import CustomResourceLoader from './resource-loader';
import { beforeParse } from './before-parse';


/*
* ------------------------------------------------------------------------------
* Defaults
* ------------------------------------------------------------------------------
*/

const { dom: { createHTMLDocument, traverse }, contentType: { getContentTypeData, getType } } = utils;
const { isHTMLDocument } = network;
const debug: debug.IDebugger = d(__filename);

@@ -4,11 +4,9 @@ import { debug as d } from '@hint/utils';
import { ResourceLoader } from 'jsdom';

import JSDOMConnector from './connector';
import { HTMLDocument } from 'hint/dist/src/lib/types';
import createHTMLDocument from 'hint/dist/src/lib/utils/dom/create-html-document';
import { NetworkData, FetchEnd, FetchError } from 'hint/dist/src/lib/types';
import { getContentTypeData, getType } from 'hint/dist/src/lib/utils/content-type';
import getElementByUrl from 'hint/dist/src/lib/utils/dom/get-element-by-url';
import { FetchEnd, FetchError, HTMLDocument, NetworkData, utils } from 'hint';

const { dom: { createHTMLDocument, getElementByUrl }, contentType: { getContentTypeData, getType } } = utils;

const debug: debug.IDebugger = d(__filename);

@@ -8,9 +8,8 @@ import * as sinon from 'sinon';
import anyTest, { TestInterface, ExecutionContext } from 'ava';

import { ServerConfiguration, Server } from '@hint/utils-create-server';
import { IConnector, IConnectorConstructor, Events } from 'hint/dist/src/lib/types';
import { test as testUtils } from '@hint/utils';
import { Engine } from 'hint';
import { Engine, Events, IConnector, IConnectorConstructor } from 'hint';

import JSDOMConnector from '../src/connector';

@@ -4,8 +4,7 @@ import test from 'ava';

import { Server } from '@hint/utils-create-server';
import { test as testUtils } from '@hint/utils';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector } from 'hint';

import JSDOMConnector from '../src/connector';

@@ -13,11 +13,11 @@ import groupBy = require('lodash/groupBy');
import every = require('lodash/every');
import * as sinon from 'sinon';
import test from 'ava';

import { Server } from '@hint/utils-create-server';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine, Events, IConnector } from 'hint';

import JSDOMConnector from '../src/connector';
import { Engine } from 'hint';

const name: string = 'jsdom';

@@ -5,9 +5,9 @@ import * as path from 'path';
import { URL } from 'url';

import test from 'ava';

import { Server } from '@hint/utils-create-server';
import { IConnector, NetworkData, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';
import { Engine, Events, IConnector, NetworkData } from 'hint';

import JSDOMConnector from '../src/connector';

@@ -1,8 +1,8 @@
import { URL } from 'url';

import test from 'ava';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine } from 'hint';

import { Engine, Events, IConnector } from 'hint';

import JSDOMConnector from '../src/connector';

@@ -12,11 +12,11 @@ import * as zlib from 'zlib';

import * as sinon from 'sinon';
import test from 'ava';

import { Server } from '@hint/utils-create-server';
import { IConnector, Events } from 'hint/dist/src/lib/types';
import { Engine, Events, IConnector } from 'hint';

import JSDOMConnector from '../src/connector';
import { Engine } from 'hint';

const name: string = 'jsdom';

@@ -5,6 +5,29 @@
* It currently only sends `fetch::end::*` events.
*/

/**
* `jsdom` always tries to load `canvas` even though it is not needed for
* the HTML parser. If there is a mismatch between the user's node version
* and where the HTML parser is being executed (e.g.: VS Code extension)
* `canvas` will fail to load and crash the excution. To avoid
* that we hijack `require`'s cache and set an empty `Module` for `canvas`
* so `jsdom` doesn't use it and continues executing
* normally.
*/

try {
const canvasPath = require.resolve('canvas');
const Module = require('module');
const fakeCanvas = new Module('', null);

/* istanbul ignore next */
fakeCanvas.exports = function () { };

require.cache[canvasPath] = fakeCanvas;
} catch (e) {
// `canvas` is not installed, nothing to do
}

/*
* ------------------------------------------------------------------------------
* Requirements
@@ -22,8 +45,9 @@ import globby from 'globby';

import { fs, logger, network } from '@hint/utils';

import { getContentTypeData, isTextMediaType, getType } from 'hint/dist/src/lib/utils/content-type';
import traverse from 'hint/dist/src/lib/utils/dom/traverse';
import { utils } from 'hint';

const { contentType: { getContentTypeData, getType, isTextMediaType }, dom: { traverse } } = utils;

const { cwd, isFile, readFileAsync } = fs;
const { asPathString, getAsUri } = network;
@@ -154,7 +178,7 @@ export default class LocalConnector implements IConnector {
const scanEndEvent: ScanEnd = { resource: href };

await this.engine.emitAsync('scan::end', scanEndEvent);
await this.engine.notify();
await this.engine.notify(href);

logger.log('Watching for file changes.');
}
@@ -7,8 +7,7 @@ import anyTest, { TestInterface } from 'ava';
import * as proxyquire from 'proxyquire';

import { fs, logger, misc, network } from '@hint/utils';
import { Engine } from 'hint';
import { FetchEnd, Problem } from 'hint/dist/src/lib/types';
import { Engine, FetchEnd, Problem } from 'hint';
import { HTMLEvents } from '@hint/parser-html';

const { delay } = misc;
@@ -9,10 +9,7 @@
"bin": {
"create-hint": "./dist/src/create-hint.js"
},
"dependencies": {
"@hint/utils": "^1.0.0",
"hint": "^4.5.0"
},
"dependencies": { },
"description": "webhint's hint initializer package",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^1.4.2",
@@ -21,6 +18,7 @@
"@types/node": "11.12.0",
"@types/proxyquire": "^1.3.28",
"@types/sinon": "^7.0.11",
"@hint/utils": "^1.0.0",
"ava": "^1.4.1",
"cpx": "^1.5.0",
"eslint": "^5.15.1",
@@ -29,6 +27,7 @@
"fork-ts-checker-webpack-plugin": "^1.0.1",
"fs-extra": "^7.0.0",
"handlebars": "^4.1.1",
"hint": "^4.5.0",
"inquirer": "^6.2.2",
"mkdirp": "^0.5.1",
"npm-link-check": "^3.0.0",
@@ -6,8 +6,7 @@ import * as inquirer from 'inquirer';
import * as mkdirp from 'mkdirp';

import { fs, logger, misc, packages } from '@hint/utils';
import { Category } from 'hint/dist/src/lib/enums/category';
import { HintScope } from 'hint/dist/src/lib/enums/hint-scope';
import { Category, HintScope } from 'hint';

import Handlebars, { compileTemplate, escapeSafeString } from './handlebars-utils';

@@ -1,8 +1,9 @@
import * as Handlebars from 'handlebars';

import { fs } from '@hint/utils';
import loadHintPackage from 'hint/dist/src/lib/utils/packages/load-hint-package';
import { utils } from 'hint';

const { packages: { loadHintPackage } } = utils;
const { readFileAsync } = fs;

const pkg = loadHintPackage();
@@ -10,13 +10,12 @@
"create-hintrc": "./dist/src/create-hintrc.js"
},
"dependencies": {
"@hint/utils": "^1.0.0",
"browserslist": "^4.5.4",
"encoding": "^0.1.12",
"hint": "^4.5.0"
"encoding": "^0.1.12"
},
"description": "webhint's configuration file initializer package",
"devDependencies": {
"@hint/utils": "^1.0.0",
"@types/inquirer": "^6.0.0",
"@types/node": "11.12.0",
"@types/proxyquire": "^1.3.28",
@@ -30,6 +29,7 @@
"eslint-plugin-markdown": "^1.0.0",
"fork-ts-checker-webpack-plugin": "^1.0.1",
"fs-extra": "^7.0.0",
"hint": "^4.5.0",
"inquirer": "^6.2.2",
"npm-link-check": "^3.0.0",
"npm-run-all": "^4.1.5",
@@ -14,13 +14,12 @@ import { promisify } from 'util';

import * as inquirer from 'inquirer';

import { UserConfig } from 'hint/dist/src/lib/types';
import { ResourceType, UserConfig, utils } from 'hint';
import { appInsights, debug as d, fs as fsUtils, logger, npm, NpmPackage } from '@hint/utils';

import { getInstalledResources, getCoreResources } from 'hint/dist/src/lib/utils/resource-loader';
import { ResourceType } from 'hint/dist/src/lib/enums/resource-type';
import { generateBrowserslistConfig } from './browserslist';

const { resourceLoader: { getInstalledResources, getCoreResources } } = utils;
const { getOfficialPackages, installPackages } = npm;
const { sendPendingData, trackEvent } = appInsights;
const { cwd } = fsUtils;
@@ -88,7 +88,7 @@ const loadScript = (context: CreateHintRCContext): () => Promise<boolean> => {
},
child_process: context.child, // eslint-disable-line camelcase
fs: context.fs,
'hint/dist/src/lib/utils/resource-loader': context.resourceLoader,
hint: { utils: { resourceLoader: context.resourceLoader } },
inquirer: context.inquirer,
util: context.stubUtilObject
}).default;
Oops, something went wrong.

0 comments on commit d934aeb

Please sign in to comment.
You can’t perform that action at this time.