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

@rushstack/eslint-bulk

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rushstack/eslint-bulk - npm Package Compare versions

Comparing version 0.1.29 to 0.1.30

57

lib/start.js

@@ -31,12 +31,12 @@ "use strict";

const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
function findPatchPath() {
const candidatePaths = [`${process.cwd()}/.eslintrc.js`, `${process.cwd()}/.eslintrc.cjs`];
let eslintrcPath;
if (fs.existsSync(path.join(process.cwd(), '.eslintrc.js'))) {
eslintrcPath = '.eslintrc.js';
for (const candidatePath of candidatePaths) {
if (fs.existsSync(candidatePath)) {
eslintrcPath = candidatePath;
break;
}
}
else if (fs.existsSync(path.join(process.cwd(), '.eslintrc.cjs'))) {
eslintrcPath = '.eslintrc.cjs';
}
else {
if (!eslintrcPath) {
console.error('@rushstack/eslint-bulk: Please run this command from the directory that contains .eslintrc.js or .eslintrc.cjs');

@@ -46,5 +46,42 @@ process.exit(1);

const env = Object.assign(Object.assign({}, process.env), { _RUSHSTACK_ESLINT_BULK_DETECT: 'true' });
let eslintPackageJsonPath;
try {
eslintPackageJsonPath = require.resolve('eslint/package.json', { paths: [process.cwd()] });
}
catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') {
throw e;
}
}
let eslintBinPath;
if (eslintPackageJsonPath) {
eslintPackageJsonPath = eslintPackageJsonPath.replace(/\\/g, '/');
const packagePath = eslintPackageJsonPath.substring(0, eslintPackageJsonPath.lastIndexOf('/'));
const { bin: { eslint: relativeEslintBinPath } = {} } = require(eslintPackageJsonPath);
if (relativeEslintBinPath) {
eslintBinPath = `${packagePath}/${relativeEslintBinPath}`;
}
else {
console.warn(`@rushstack/eslint-bulk: The eslint package resolved at "${packagePath}" does not contain an eslint bin path. ` +
'Attempting to use a globally-installed eslint instead.');
}
}
else {
console.log('@rushstack/eslint-bulk: Unable to resolve the eslint package as a dependency of the current project. ' +
'Attempting to use a globally-installed eslint instead.');
}
let eslintBinCommand;
if (eslintBinPath) {
eslintBinCommand = `${process.argv0} ${eslintBinPath}`;
}
else {
eslintBinCommand = 'eslint'; // Try to use a globally-installed eslint if a local package was not found
}
let stdout;
try {
stdout = (0, child_process_1.execSync)(`eslint --stdin --config ${eslintrcPath}`, { env, input: '', stdio: 'pipe' });
stdout = (0, child_process_1.execSync)(`${eslintBinCommand} --stdin --config ${eslintrcPath}`, {
env,
input: '',
stdio: 'pipe'
});
}

@@ -103,5 +140,3 @@ catch (e) {

try {
const args = process.argv.slice(2).join(' ');
const command = `node ${patchPath} ${args}`;
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
require(patchPath);
}

@@ -108,0 +143,0 @@ catch (e) {

2

package.json
{
"name": "@rushstack/eslint-bulk",
"version": "0.1.29",
"version": "0.1.30",
"description": "Roll out new ESLint rules in a large monorepo without cluttering up your code with \"eslint-ignore-next-line\"",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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