Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-lint-staged

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-lint-staged - npm Package Compare versions

Comparing version 0.1.6 to 7.0.0

75

ng-lint-staged.js

@@ -5,3 +5,3 @@ #!/usr/bin/env node

const {spawn} = require('child_process');
const { spawn } = require('child_process');
const path = require('path');

@@ -15,54 +15,39 @@

let filesSwitch = false;
for (let i = 3, iz = process.argv.length; i < iz; i++) {
const arg = process.argv[i];
for (const arg of process.argv) {
if (arg === '--') {
filesSwitch = true;
continue;
}
if (arg === '--') {
filesSwitch = true;
continue;
}
if (filesSwitch) {
fileArgs.push(arg);
} else {
scriptArgs.push(arg);
}
if (filesSwitch) {
fileArgs.push(arg);
} else {
scriptArgs.push(arg);
}
}
const files = fileArgs
.map((file) => {
// ng lint's --files argument only works with relative paths
// strip cwd and leading path delimiter
return `--files="${path.relative(process.cwd(), file)}"`;
})
;
const files = fileArgs.map(file => {
// ng lint's --files argument only works with relative paths
// strip cwd and leading path delimiter
return `--files="${path.relative(process.cwd(), file)}"`;
});
const npm = spawn('npm', ['run', script, '--', ...scriptArgs, ...files], {
cwd: process.cwd(),
env: process.env,
shell: true,
});
const npm = spawn(
'npm',
[
'run',
script,
'--',
...scriptArgs,
...files,
],
{
cwd: process.cwd(),
env: process.env,
shell: true,
}
);
npm.stdout.on('data', (data) => {
console.log(data.toString());
npm.stdout.on('data', data => {
console.log(data.toString());
});
npm.stderr.on('data', (data) => {
console.error(data.toString());
npm.stderr.on('data', data => {
console.error(data.toString());
});
npm.on('close', (code) => {
if (code) {
console.error(`Child process existed with code ${code}`);
process.exit(1);
}
npm.on('close', code => {
if (code) {
console.error(`Child process existed with code ${code}`);
process.exit(1);
}
});

2

package.json
{
"name": "ng-lint-staged",
"version": "0.1.6",
"version": "7.0.0",
"description": "Shim to run lint-staged with ng-lint",

@@ -5,0 +5,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc