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

eslint-plugin-actions-on-google

v1.0.1

Published

Linter for Actions on Google response generation.

Downloads

3

Readme

eslint-plugin-actions-on-google

This repository provides implementation of rules to check for common errors in response generation inside of your webhook code on Actions on Google platform using the official Actions on Google Node.js client library.

NPM Version

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-actions-on-google:

$ npm install eslint-plugin-actions-on-google --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-actions-on-google globally.

Usage

Add actions-on-google to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "actions-on-google"
    ]
}

Then configure the rules you want to use under the rules section. In the snippet below, rule-name is a placeholder value for an actual name of a rule)

{
    "rules": {
        "actions-on-google/rule-name": "error"
    }
}

Supported Rules

  • always-return-promise
    • If intent handler uses a Promise, it must return it.
  • at-most-two-simple-responses
    • The response returned by Actions on Google fulfillment must have <=2 simple responses per turn.
  • first-item-simple-response-or-helper
    • The first item in webhook response must be a simple response, or a helper
  • must-return-response
    • The response returned by Actions on Google fulfillment must return a client library response.

For source code of the rules refer to lib/rules/

References & Issues

Make Contributions

Please read and follow the steps in the CONTRIBUTING.md.

Developer's Guide

The plugin was implemented using the official ESLint guide. Please refer to those docs on how to get started with writing new rules.

The rules were created based on:

  • The official Actions on Google Responses documentation.
  • The most common issues reported by developers

Most of the rules regarding the Actions on Google response generation has to do with:

  • How many of a kind the final response contains. For example, it's only allowed to have at most 2 simple responses, or at most 8 suggestions chips.
  • Was something returned or not. For example, suggestion chips are not allowed in a FinalResponse. Please refer for a full list of rules in the documentation.

As such, we implemented useful library modules to assist with those 2 tasks, located in count-scope-manager and presence-scope-manager. Additionally, we provide library for classifying simple and helper responses. Together those modules can be reused to create more rules.

Note

  • Performing robust checks is difficult on a dynamically typed language, such as JavaScript. As such, linter is not guaranteed to raise 100% of the issues in your code. However, we provide guarantees that those errors reported by the linter are valid.
  • Linter entirely relies on the Action code written using Actions on Google Node.js client library.

License

See LICENSE.

Terms

Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the Google APIs Terms of Service.