@pigeon-posse/htmlhint-config
Advanced tools
Comparing version 1.1.2 to 1.1.3
61
index.js
#!/usr/bin/env node | ||
/** | ||
* INDEX FILE | ||
* | ||
* File used to create the cli | ||
* | ||
* since version 1.1.2 | ||
*/ | ||
import * as path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import { execFile } from 'child_process'; | ||
import * as fs from 'fs'; | ||
const __dirname = path.dirname( fileURLToPath( import.meta.url ) ); | ||
const json = path.resolve( __dirname, '.htmlhintrc.json' ); | ||
const htmlhint = path.resolve( __dirname, 'node_modules/.bin/htmlhint' ); | ||
/** | ||
* Get paths and files | ||
*/ | ||
const __dirname = path.dirname( fileURLToPath( import.meta.url ) ); | ||
const json = path.resolve( __dirname, '.htmlhintrc.json' ); | ||
const htmlhintBin = ( () => { | ||
let file; | ||
file = path.resolve( __dirname, 'node_modules/.bin/htmlhint' ); | ||
if ( fs.existsSync( file ) ) { | ||
return file; | ||
} | ||
file = './node_modules/.bin/htmlhint'; | ||
if ( fs.existsSync( file ) ) { | ||
return file; | ||
} | ||
console.error( 'You have to install Htmlhint package' ); | ||
console.log( 'You can install the package with: npm install htmlhint' ); | ||
return false; | ||
} )(); | ||
/** | ||
* Set exec | ||
*/ | ||
const execFunct = ( name, args = {} ) => { | ||
@@ -18,8 +58,2 @@ | ||
// if ( error ) { | ||
// console.error( `error: ${error.message}` ); | ||
// } | ||
if ( stdout ) { | ||
@@ -42,3 +76,10 @@ | ||
execFunct( htmlhint, [ '-c', json ] ); | ||
/** | ||
* Run exec | ||
*/ | ||
if ( htmlhintBin ) { | ||
execFunct( htmlhintBin, [ '-c', json ] ); | ||
} | ||
{ | ||
"name": "@pigeon-posse/htmlhint-config", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "PigeonPosse Htmlhint configuration", | ||
@@ -12,2 +12,15 @@ "main": "index.js", | ||
}, | ||
"dependencies": { | ||
"htmlhint": "^1.1.4" | ||
}, | ||
"devDependencies": { | ||
"@pigeon-posse/eslint-config": "^1.0.1", | ||
"@pigeon-posse/stylelint-config": "^1.0.1", | ||
"eslint": ">= 8", | ||
"eslint-plugin-align-assignments": ">= 1", | ||
"eslint-plugin-align-import": ">= 1", | ||
"eslint-plugin-html": "^7.1.0", | ||
"eslint-plugin-promise": ">= 6", | ||
"stylelint": "^14.10.0" | ||
}, | ||
"keywords": [ | ||
@@ -14,0 +27,0 @@ "html", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43032
7
74
2
8
1
+ Addedhtmlhint@^1.1.4