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

@newrelic/eslint-plugin-newrelic

v0.3.1

Published

Eslint plugin for New Relic.

Downloads

5,597

Readme

New Relic Experimental header

@newrelic/eslint-plugin-newrelic

This package provides New Relic's Eslint configuration as an extensible shared config.

About this project

This eslint configuration is in early development for use in new open source projects.

Table of Contents generated with DocToc

Getting started

  • Install the plugin npm install --save-dev @newrelic/eslint-plugin-newrelic
  • Install required peer dependencies:
    • In all cases, you need eslint.
    • If you prefer to enforce styles with prettier, you will also need to install it.
  • Create a file named .eslintrc.js in the root of your project and configure it to extend from the base eslint config and addons that are right for your project. For example, if your project uses react, jest, and prettier, the file should look something like this. See eslint's configuration documentation for more details.
module.exports = {
  extends: [
    'plugin:@newrelic/eslint-plugin-newrelic/react',
    'plugin:@newrelic/eslint-plugin-newrelic/jest',
    'plugin:@newrelic/eslint-plugin-newrelic/prettier'
  ]
}
  • Run eslint against your files. The exact arguments will vary based on the configuration of your project. For example, to process all files with the extension .js in the current directory: npx eslint . --ext .js. See eslint's cli documentation for more details.
  • To automate fixing issues (where possible -- these are mostly style issues), use the --fix flag. For example: npx eslint . --ext .js --fix
  • Consider adding linting-related items to scripts in your package.json. A simple example in your package.json might look something like this.
"scripts": {
  "lint": "eslint . --ext .js",
  "lint:fix": "npm run lint -- --fix"
}
  • Consider configuring your text editor to use eslint plugins to highlight issues and fix on saving a file. This helps catch issues as you go instead of trying to fix them all at the end.

Available configs

Base

Base eslint configurations cover the majority of linting configuration for common JavaScript development use cases. You SHOULD pick one of these.

  • core - Generic base linting configuration. The other base configurations extend from this one. Use this if none of the other base configs make sense for your use case.
  • react - Base linting configuration for react projects.
  • node - Base linting configuration for node projects. This config is currently very minimalist and needs work.

Addons

Addon eslint configurations provide additional linting configuration for optional tools/libraries/etc. that you may use on top of a base use case (e.g. a specific testing library). You may use as many of these as is appropriate for your project.

  • jest - Linting for projects using jest for testing. This is commonly used with the react base config.
  • prettier - For projects that would like to use prettier to manage style considerations instead of eslint. Make sure you include this config last to ensure it disables all conflicting eslint rules. It is configured to run prettier through eslint and output problems as eslint errors. Likewise, it will fix using prettier when you use the --fix option with eslint.
  • typescript - For projects that would like to use TypeScript instead of ES6.

Directory structure

.
├── /lib/                           # Plugin source code
│   ├── /config/                    # Shared configs go here
│   │   ├── /rules/                 # Rules for shared configs
│   │   │   └── *.js                # Config specific to chunk of related eslint rules.
│   │   ├── core.js                 # Core shared eslint config.
│   │   └── *.js                    # Shared eslint config.
│   └── /index.js                   # Main file - exports plugin configuration
├── /node_modules/                  # 3rd-party libraries and utilities
├── package.json                    # The list of 3rd party libraries and utilities
└── README.md                       # Info about the project