npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@serverless/eslint-config

v5.1.0

Published

ESLint & Prettier config for Serveless projects

Downloads

22,370

Readme

@serverless/eslint-config

Common ESLint, Prettier configuration for Serverless projects

Configuration in a project

1. Install needed dependencies & the config itself

npm i --save-dev eslint eslint-plugin-import prettier git-list-updated @serverless/eslint-config

2. Configure ESLint

Add eslintConfig to package.json:

For Node.js projects:

{
  "eslintConfig": {
    "extends": "@serverless/eslint-config/node",
    "root": true
  }
}

For Browser projects:

{
  "eslintConfig": {
    "extends": "@serverless/eslint-config/browser",
    "root": true
  }
}

3. Configure Prettier

Add prettier.config.js file with following content:

'use strict';

module.exports = require('@serverless/eslint-config/prettier.config');

4. Configure npm scripts

{
  "scripts": {
    "lint": "eslint  --ignore-path .gitignore .",
    "lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-path .gitignore",
    "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
    "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
    "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
    "prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write"
  }
}

5. Ensure to validate changes in CI

Run following validation of PR's in CI build.

Note: following should be run only for PR's (as *:updated) scripts may fail on branch or tag builds due to lack of existing reference to main)

npm run lint:updated && npm run prettier-check:updated

Commitlint and automation of release process (experimental)

Commit messages in context of this project should follow Convention Commits Convention

See proposed Commit Message Guidelines

Release process automation with help of Travis CI

  1. Commit messages are validated (with commitlint) in context of PR's that are coming from local branches. To not increase difficulty of contribution, we do not enforce that on external contributors. Still in turn PR's coming from forks (if commit messages do not follow CC), are expected to be squash merged with a valid CC commit message.
  2. In Release PR by running npm run prepare-release command developer bumps version in package.json and generates the changelog entry (which can be altered if needed).
  3. Release PR's are automatically detected in CI by fact of version in package.json file being changed. In context of that build, existence of new version changelog entry (in CHANGELOG.md) is validated.
  4. Once release PR is merged, main build detects that release PR was merged by fact that it covers change of version field in package.json file. In such case (after tests pass) version tag is created and pushed to the repository
  5. In context fo version tag build, new version is published to npm, and release notes are retrieved from CHANGELOG.md and pushed to GitHub.
  6. If needed release notes can be updated at any time afterwards. They should be updated in CHANGELOG.md and change can be pushed to GitHub release notes by running: npx github-release-from-cc-changelog <version>