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

@actinc/eslint-config

v4.16.0

Published

ACT's preferred configs for TypeScript, Prettier, ESLint, CommitLint, and MarkdownLint.

Downloads

2,514

Readme

ESLint Config

Version Build Status License Downloads

ACT's preferred configs for TypeScript, Prettier, ESLint, CommitLint, and MarkdownLint.

Getting Started

Install this package, husky, and lint-staged as dev dependencies:

npm install --save-dev @actinc/eslint-config husky lint-staged

Configure husky by adding the following to your package.json file:

...
"husky": {
  "hooks": {
    "pre-commit": "lint-staged"
  }
},
...

Configure CommitLint

To configure CommitLint, create a commitlint.config.js file in the root of your project that contains the following:

module.exports = require('@actinc/eslint-config/commitlint.config');

This will allow CommitLint to discover the configuration this repository provides from within your node_modules folder.

Next, add the following to your package.json file so that CommitLint will check for infractions in your commit messages every time you create a new commit:

...
"husky": {
  "hooks": {
    ...
    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
    ...
  }
},
...

Configure ESLint

To configure ESLint, add the following to your .eslintrc.js and package.json files. This will allow ESLint to discover the configuration this repository provides from within your node_modules folder, and will check your *.js, *.ts, and *.tsx files for infractions every time you create a new commit:

module.exports = {
  extends: [
    // For front-end (React / Next.js) projects:
    '@actinc/eslint-config'
    // For back-end (Nest.js) projects:
    '@actinc/eslint-config/nest'
  ]
  ...
  // Add any custom rules/plugins/configuration here
}
...
"lint-staged": {
  ...
  "*.{js,jsx,ts,tsx}": "eslint",
  ...
},
...

Configure MarkdownLint

To configure MarkdownLint, add the following to your package.json file. This will allow MarkdownLint to discover the configuration this repository provides from within your node_modules folder, and will check your *.md files for infractions every time you create a new commit:

...
"lint-staged": {
  ...
  "*.{md}": "markdownlint --config node_modules/@actinc/eslint-config/markdownlint.config.json",
  ...
},
...

Configure Prettier

To configure prettier, create a prettier.config.js file in the root of your project that contains the following:

module.exports = require('@actinc/eslint-config/prettier.config');

This will allow Prettier to discover the configuration this repository provides from within your node_modules folder.

Next, add the following to your package.json file so that prettier will check your files for infractions every time you create a new commit:

...
"lint-staged": {
  ...
  "*.{js,json,md,ts,tsx}": [
    "prettier --write",
    "git add"
  ]
  ...
},
...

Configure TypeScript

To configure TypeScript, add the following to your tsconfig.json file. This will allow TypeScript to discover the configuration this repository provides from within your node_modules folder:

...
"extends": "node_modules/@actinc/eslint-config/tsconfig.json",
...

Local Development

npm Scripts

There are several npm scripts at your disposal during local development. Here are some of the more important ones:

| Script | Description | | :------- | :------------- | | npm test | Run all tests. |

Release Process

Upon merge, semantic-release will scan the main branch for new commits and will use those commits to choose a new version for this library and write automated changelog documentation. Thus, it is important that we accurately capture what type of development we are doing via our commit messages.

  • For changes to documentation, use the docs tag:
git commit -m "docs: Updated documentation to clarify XYZ"
  • For patches, use fix:
git commit -m "fix: Updated an eslint rule to fix false positives in downstream projects"
  • For new functionality, use feat:
git commit -m "feat: Added new eslint rules around async/await and promises"