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-config-htmlacademy

v10.0.1

Published

ESLint shareable config for the HTML Academy style

Downloads

10,214

Readme

eslint-config-htmlacademy

ESLint shareable config for the HTML Academy courses

Installation

npm install --save-dev eslint-config-htmlacademy

Package requires eslint. You must install it manually.

Usage

Once the eslint-config-htmlacademy package is installed, you can use it by specifying htmlacademy in the extends section of your ESLint configuration.

For validating Vanilla JS project use vanilla version:

{
  "parserOptions": {
    "ecmaVersion": 2023,
    "sourceType": "module"
  },
  "env": {
    "es2023": true,
    "browser": true
  },
  "extends": "htmlacademy/vanilla",
  "rules": {
    // Additional rules...
  }
}

For validating React project use react version (htmlacademy/react includes react/recommended):

{
  "parserOptions": {
    "ecmaVersion": 2019,
    "sourceType": "module"
  },
  "env": {
    "es2017": true,
    "browser": true
  },
  "extends": "htmlacademy/react",
  "rules": {
    // Additional rules...
  }
}

For validating React project with TypeScript use react-typescript version (htmlacademy/react-typescript includes react/recommended, @typescript-eslint/recommended and @typescript-eslint/recommended-requiring-type-checking).

Before using eslint-config-htmlacademy make sure you have TypeScript, @typescript-eslint/parser, @typescript-eslint/eslint-plugin installed:

$ npm i --save-dev typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
{
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint"],
  "parserOptions": {
    "ecmaVersion": 2020,
    "sourceType": "module",
    "project": [
      "tsconfig.json" // path to your tsconfig file
    ]
  },
  "env": {
    "es2017": true,
    "browser": true
  },
  "extends": "htmlacademy/react-typescript",
  "rules": {
    // Additional rules...
  }
}

Caution! htmlacademy/react and htmlacademy/react-typescript doesn't include react-hooks/rules-of-hooks and react-hooks/exhaustive-deps because in our courses we use CRA (Create React App) which includes these plugins out of box. Install them yourself if necessary.

Caution! If you're wanting to use toBeCalled and similar matches in jest tests, you can use next option for eslintConfig:

"eslintConfig": {
  "overrides": [
    {
      "files": ["*test*"], // regExp to answer the question "How to find your tests?"
      "rules": {
        "@typescript-eslint/unbound-method": "off",
        "jest/unbound-method": "error"
      }
    }
  ]
}

Why this is necessary, you can read on the next page.

For validating Node project use node version (htmlacademy/node includes htmlacademy/vanilla, plugin:@typescript-eslint/recommended and plugin:node/recommended).

Before using eslint-config-htmlacademy make sure you have TypeScript and @typescript-eslint/parser installed:

$ npm i --save-dev typescript @typescript-eslint/parser

Then install the plugin:

$ npm i --save-dev @typescript-eslint/eslint-plugin
{
  "env": {
    "es2021": true,
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": 2021,
    "sourceType": "module"
  },
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint"],
  "extends": "htmlacademy/node",
  "rules": {
    // Additional rules...
  }
}

Caution!

  • htmlacademy/node aimed at using Typescript.
  • htmlacademy/node recommends a use of the "engines" field of package.json, because our package includes plugin:node/recomended. The "engines" field is used by node/no-unsupported-features/* rules.
  • htmlacademy/node uses ES6 modules and the rules are aimed precisely at this approach of connecting modules.