Socket
Socket
Sign inDemoInstall

@freshheads/eslint-plugin-freshheads-analytics

Package Overview
Dependencies
197
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @freshheads/eslint-plugin-freshheads-analytics

make sure we track all user events


Version published
Maintainers
1
Created

Readme

Source

eslint-plugin-freshheads-analytics

make sure we track all user events

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-freshheads-analytics:

npm install eslint-plugin-freshheads-analytics --save-dev

Usage

Default usage

add plugin:freshheads-analytics/recommended to te extends section of your .eslintrc configuration file.

{
    "extends": ["plugin:@freshheads/freshheads-analytics/recommended"]
}

custom usage

Add freshheads-analytics to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": ["@freshheads/freshheads-analytics"]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "@freshheads/freshheads-analytics/element-has-required-eventprop": [
            "error",
            {
                "elementsToCheck": [
                    "a",
                    "button",
                    "input",
                    "select",
                    "textarea",
                    "Button",
                    "Link",
                    "ChakraLink",
                    "NextLink",
                    "IconButton"
                ],
                "alternativeTrackingMethodProps": [
                    "onClick",
                    "onMouseDown",
                    "onMouseUp",
                    "onSubmit",
                    "onDblClick",
                    "onDoubleClick",
                    "onDrag",
                    "onPause",
                    "onPlay",
                    "onKeyDown",
                    "onKeyPress",
                    "onKeyUp"
                ]
            }
        ],
        "@freshheads/freshheads-analytics/eventprop-has-tracking-event": [
            "error",
            {
                "eventsToTrack": [
                    "onClick",
                    "onMouseDown",
                    "onMouseUp",
                    "onSubmit",
                    "onDblClick",
                    "onDoubleClick",
                    "onDrag",
                    "onPause",
                    "onPlay",
                    "onKeyDown",
                    "onKeyPress",
                    "onKeyUp"
                ],
                "trackingFunctionName": "pushTrackingEvent"
            }
        ]
    }
}

Keywords

FAQs

Last updated on 16 Aug 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc