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-lottery

v1.1.1

Published

Offical Lottery.com ESLint Configuration

Downloads

5

Readme

eslint-config-lottery

This is the official ESLint config for Lottery.com

Installation

Install Package

yarn add --dev eslint-config-lottery

Install Peer Dependencies

yarn add --dev eslint lint-staged husky
yarn add --dev --exact [email protected]

It is recommended that you install an exact version of Prettier as they may introduce formatting changes in minor versions.

Make ESLint Config File

Add .eslintrc to project root

{
  "extends": "eslint-config-lottery"
}

Make Prettier Config File

Add .prettierrc to project root

{
  "printWidth": 120,
  "singleQuote": true
}

Optional: If there are any files you want to exclude from Prettier add .prettierignore to project root

Make Editorconfig File

Recommended: Add .editorconfig to project root

# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0

Add Scripts

Add scripts for linting and formatting to package.json

scripts: {
  "precommit": "lint-staged",
  "lint": "eslint .",
  "format:all": "prettier --write \"**/*.{js,json,graphql}\"",
  "format:check": "prettier --debug-check \"**/*.{js,json,graphql}\""
}

Add Precommit Hook

Add a precommit hook to package.json to automatically lint and format any files staged for commit

"lint-staged": {
  "concurrent": false,
  "linters": {
    "*.js": [
      "eslint --quiet",
      "git add"
    ],
    "*.{js,json,graphql}": [
      "prettier --write",
      "git add"
    ]
  }
}

Format Code

If you've added Prettier to an existing project you will want to format all the code. The precommit hook only updates files that have been changed and staged for commit. To format the entire codebase run

npm run format:all

FAQ

Should I override the rule blah-blah? I don't like it.

No. If you want to do this, you have to ask the team. If a rule really doesn't make sense then we should remove it from this config.

Can I disable the rule on one line in my code, I have a good reason.

Yes. That's ok. Use a single-line disable.

Are we or can we use the airbnb eslint configuration?

What is this 2015?

No, we are using the core "best practice" config packages.