
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@springernature/util-eslint-runner
Advanced tools
As of ESLint v5
a breaking behaviour change (8b7c6ea) was introduced where a fatal error is thrown if any file pattern returns no files. We would like to use a generic linting implementation on all our component monorepos without having to turn JS linting on/off depending on the presence of Javascript.
This small utility will check for the existence of Javascript files in a repo and then run an npm script
command if any are found. The npm script should run your eslint setup.
$ npm install @springernature/util-eslint-runner
Installing util-eslint-runner
adds command line exectuables to ./node_modules/.bin/
.
$ ./node_modules/.bin/util-eslint-runner [options]
Options:
-n --name [string] NPM script to execute (default: null)
-p --pattern [string] Glob pattern to search (default: **/*.js)
-h, --help output usage information
.eslintignore
ESLint runner will check for an .eslintignore
file, and ignore any patterns it finds.
You always need to specify the --name
option, otherwise nothing will run on completion. The default search pattern is **/*.js
, which you can override with the --pattern
option. Some examples using different options
$ util-eslint-runner --name 'lint-js'
$ util-eslint-runner -n 'lint-js'
$ util-eslint-runner --name 'lint-js' --pattern 'packages/**/*.js'
$ util-eslint-runner -n 'lint-js' -p 'packages/**/*.js'
Below is an example set of example scripts from a monorepo package.json
file:
"scripts": {
"lint": "util-eslint-runner -n 'lint-js' -p 'packages/**/*.js' && npm run lint-sass",
"lint-sass": "sass-lint 'packages/**/*.scss'",
"lint-js": "eslint 'packages/**/*.js'"
}
MIT License © 2018, Springer Nature
FAQs
Run ESLint only if Javascript files are found
We found that @springernature/util-eslint-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.