Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
scriptlint
Advanced tools
Enforceable standards for your package.json scripts – like eslint for npm run
⚠️ Requires nodejs >= 14.x.x
package.json
scripts are an integral part of the Node dev experience: we use them to start our projects, run our dev environments and for all kinds of formatting, linting and tooling in general. They are just as important as our code. Yet we don't treat them with the same meticulous attention to detail. Scripts need :heart: too!
One of the main goals for scriptlint was to enable people to use memorable and consistent script names across their projects. Tools like nps are great when you have to organize scripts with a certain level of complexity, but they don't help you with the structure and naming of your scripts.
This is where the scriptlint CLI shines: it makes best practices outlined in this documentation enforceable throughout your project(s). Think of it as eslint for your "scripts"
section.
Here's the tl;dr of all the best practices we consider the "scriptlint
standard"
Your package.json
's "scripts"
section should…
test
script that is not the default script from npm init
dev
script and a start
scripttest
, not jest
)"test:unit": "jest"
):
as a namespace separatorprefoobar
, there must be a foobar
script)camelCase
for all script namesdevDependencies
(no "jest": "jest"
)&&
or &
for sequential or parallel script execution(italic = strict rule)
Read more about the standard rules here
Install locally:
npm install scriptlint -D
(or yarn add scriptlint -D
)
… then run npx scriptlint --strict
Would you like a scriptlint badge for your project readme? No problem: have a look at https://scriptlint.peerigon.io/ or adapt the snippet below:
[![scriptlint status](https://img.shields.io/endpoint?url=https://scriptlint.peerigon.io/api/shield/scriptlint/latest)](https://scriptlint.peerigon.io/issues/scriptlint/latest)
FAQs
an enforcable script naming standard for package.json
The npm package scriptlint receives a total of 413 weekly downloads. As such, scriptlint popularity was classified as not popular.
We found that scriptlint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.