Browse Source

project created

develop
Rob Colbert 3 years ago
parent
commit
228cf9e546
  1. 1
      .gitignore
  2. 25
      .jshintrc
  3. 2
      LICENSE
  4. 34
      README.md
  5. 31
      dtp-jshint-reporter.js
  6. 12
      package.json
  7. 42
      yarn.lock

1
.gitignore

@ -0,0 +1 @@
node_modules

25
.jshintrc

@ -0,0 +1,25 @@
{
"bitwise": true,
"browser": true,
"curly": true,
"eqeqeq": true,
"latedef": true,
"noarg": true,
"node": true,
"strict": "global",
"undef": true,
"unused": true,
"futurehostile": true,
"esversion": 9,
"mocha": true,
"globals": {
"markdown": true,
"moment": true,
"numeral": true,
"io": true,
"Chart": true,
"CodeMirror": true,
"UIkit": true,
"twttr": true
}
}

2
LICENSE

@ -0,0 +1,2 @@
dtp-jshint-reporter Copyright (C) 2021 Digital Telepresence, LLC
All Rights Reserved

34
README.md

@ -0,0 +1,34 @@
# Digital Telepresence jshint reporter
A jshint error/warning reporter using an output format that is friendly to VS Code and other editors to use when navigating to the error in your source code.
## Getting started
First, make sure Yarn has linked the module in your workspace as follows:
```sh
cd ~/projects/dtp/dtp-jshint-reporter
yarn link
```
This will expose the project in that directory to Yarn for linking elsewhere on your system.
Next, add `dtp-jshint-reporter` to your project as follows:
```sh
cd ~/projects/dtp/[your-project]
yarn link dtp-jshint-reporter
```
In your gulpfile, do something like:
```js
function dtp_jshint_services ( ) {
var jsrc = 'app/services/**/*.js';
return gulp
.src(jsrc)
.pipe(jshint())
.pipe(jshint.reporter('dtp-jshint-reporter'))
;
}
```

31
dtp-jshint-reporter.js

@ -0,0 +1,31 @@
// dtp-jshint-reporter.js
// Copyright (C) 2021 Digital Telepresence, LLC
// All Rights Reserved
// Generates gulp output that is useful within a terminal in VS Code.
'use strict';
const chalk = require('chalk');
const separator = chalk.gray(':');
module.exports = {
toString: function ( ) {
return __filename;
},
reporter: function (errors) {
console.log('');
errors.forEach((error) => {
let file = chalk.white(error.file);
let line = chalk.blue(error.error.line);
let character = chalk.blue(error.error.character);
let id = error.error.id === '(error)' ? chalk.red(error.error.id) : chalk.yellow(error.error.id);
let reason = error.error.reason;
console.log(`${id} ${file}${separator}${line}${separator}${character}${separator} ${reason}`);
});
console.log('');
},
};

12
package.json

@ -0,0 +1,12 @@
{
"name": "dtp-jshint-reporter",
"version": "0.1.0",
"description": "Digital Telepresence jshint reporter",
"main": "dtp-jshint-reporter.js",
"author": "Digital Telepresence, LLC",
"license": "LicenseRef-LICENSE",
"private": true,
"dependencies": {
"chalk": "^4.1.1"
}
}

42
yarn.lock

@ -0,0 +1,42 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-styles@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
chalk@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad"
integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
dependencies:
has-flag "^4.0.0"
Loading…
Cancel
Save