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

v1.0.2

Published

Eslint configuration for Amity

Downloads

9

Readme

eslint-config-amity

ESLint config for Amity orgnization.

Install

yarn add --dev eslint-config-amity eslint prettier
# npm i --dev eslint-config-amity eslint prettier

Usage

// .eslintrc.js

// for javascript project
{
  "extends": "amity"
}

// for typescript project
{
  "extends": "amity/typescript"
}

// for react project
{
  "extends": "amity/react"
}

Best practice:

Add .prettierrc file at the root of your project

{
  "tabWidth": 2,
  "useTabs": false,
  "singleQuote": true,
  "trailingComma": "all",
  "quoteProps": "as-needed",
  "semi": true,
  "bracketSpacing": true,
  "arrowParens": "avoid",
  "printWidth": 120
}

For VS code developers, add .vscode/settings.json file at the root of your project

// See VS Code settings in https: //code.visualstudio.com/docs/getstarted/settings#_default-settings
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "search.exclude": {
    "**/node_modules": true,
    "**/dist": true
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true
  },
  "typescript.tsdk": "node_modules/typescript/lib",
  "typescript.format.semicolons": "remove"
}

Add package.json scripts

"scripts": {
  "lint": "eslint . --ext .js,.ts",
  "lint:fix": "eslint . --ext .js,.ts --fix",
  "prettier": "prettier --write '{src,test}/**/*.{ts,json,md}'"
}

Setup project for auto-linting on commit hooks:

yarn add --dev husky lint-staged
# npm i --dev husky lint-staged

In package.json:

"husky": {
  "hooks": {
    "post-commit": "git update-index --again",
    "pre-commit": "lint-staged",
    "pre-push": "yarn test",
    "commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"
  }
},
"lint-staged": {
  "*.{ts,js,jsx}": [
    "yarn prettier",
    "yarn lint"
  ],
  "*.{json,md}": [
    "yarn prettier"
  ]
}

Use commitlint

yarn add --dev @commitlint/cli @commitlint/config-angular
# npm i --dev @commitlint/cli @commitlint/config-angular

add .commitlintrc.json at the root:

{
  "extends": ["@commitlint/config-angular"],
  "rules": {
    "subject-case": [2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"]],
    "type-enum": [2, "always", ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "sample"]]
  }
}

In package.json:

"husky": {
  "hooks": {
    ...
    "commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"
  }
}