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

@ongov/eslint-config-ontario-frontend

v1.1.0

Published

ESLint configuration for Ontario.ca Frontend projects

Downloads

14

Readme

@ongov/eslint-config-ontario-frontend

This package provides the shared ESLint configuration used by Ontario.ca Frontend projects. It enforces a consistent code style for JavaScript projects to help keep code clean and readable.

Table of Contents

Features

  • Print width: Set to 80 characters to maintain readability across various devices and editors.

  • Tab width: Uses 2 spaces for indentation to ensure code is clean and readable.

  • Semicolons: Requires semicolons at the end of statements for clarity.

  • Single quotes: Enforces the use of single quotes for strings, except in Markdown files where double quotes are preferred.

  • Trailing commas: Requires trailing commas in multi-line objects, arrays, etc., which makes version control diffs cleaner.

  • Bracket spacing: Ensures spaces are present inside object literal braces for better readability.

  • Bracket same line: Places the closing angle bracket of elements on the same line as the last prop.

  • Overrides for markdown: For .md files, double quotes are used instead of single quotes.

Installation

To use the @ongov/eslint-config-ontario-frontend in your project, follow the steps for based on your package manager:

Using npm

  1. First, you need to install ESLint if it's not already installed:

    npm install eslint --save-dev
  2. Next, install the @ongov/eslint-config-ontario-frontend package:

    npm install @ongov/eslint-config-ontario-frontend --save-dev

Using pnpm

  1. First, you need to install ESLint if it's not already installed:

    pnpm add eslint -D
  2. Next, install the @ongov/eslint-config-ontario-frontend package:

    pnpm add @ongov/eslint-config-ontario-frontend -D

Usage

After installation, you'll need to set up your ESLint configuration file if you haven't already. Here's how:

  1. Create a file named .eslintrc.json in your project's root directory.

  2. Add the following content to .eslintrc.json to extend the @ongov/eslint-config-ontario-frontend configuration:

    {
      "extends": "@ongov/eslint-config-ontario-frontend"
    }

This line tells ESLint to use the @ongov/eslint-config-ontario-frontend rules for your project.

Customizing

If you need to override any rules, you can do so within your project's .eslintrc file. For example:

{
  "extends": "@ongov/eslint-config-ontario-frontend",
  "rules": {
    "no-unused-vars": "warn",
    "semi": ["error", "never"]
  }
}

This customization will change the handling of unused variables to a warning and remove the requirement for semicolons.

Documentation

Explore the documentation to learn about every aspect of the toolkit--from installation and file structure to adding analytics and preparing for deployment. The documentation is available at developer.ontario.ca.

Contributing

Contributions to the Ontario.ca Frontend ESLint Config are welcome. Whether it's bug reports, feature requests, or contributions to code, we appreciate your input.

Check out our CONTRIBUTING.md file for guidelines on how to contribute.

License

This project is licensed under the Open Government Licence - Ontario. Feel free to use, modify, and distribute it as needed.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.