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

@lambdaschool/eslint-config

v7.0.0

Published

Eslint configuration options to be shared across internal projects

Downloads

388

Readme

eslint

Eslint + Prettier configuration options to be shared across internal projects

Usage

Using with a JavaScript project

npm i -D eslint @lambdaschool/eslint-config
echo "module.exports = { extends: '@lambdaschool' };" > .eslintrc.js
echo "module.exports = require('@lambdaschool/eslint-config/.prettierrc.js');" > .prettierrc.js

Using with React

npm i -D eslint @lambdaschool/eslint-config
echo "module.exports = { extends: '@lambdaschool/eslint-config/react' };" > .eslintrc.js
echo "module.exports = require('@lambdaschool/eslint-config/.prettierrc.js');" > .prettierrc.js

Using with Typescript

npm i -D eslint @lambdaschool/eslint-config
echo "module.exports = { extends: '@lambdaschool/eslint-config/typescript', parserOptions: { project: './tsconfig.json' } };" > .eslintrc.js
echo "module.exports = require('@lambdaschool/eslint-config/.prettierrc.js');" > .prettierrc.js

IDE Integration

Visual Studio Code

You will need to have your settings.json file open to make several settings adjustments. To find your settings.json file do the following:

  1. Click on the gear icon in the lower left of the VS Code window
  2. Select "Settings"
  3. Ensure that you on the "User" tab so that the settings will be applied globally (not "Workspace")
  4. Search for "Code Actions On Save"
  5. In the search results click on a link to "Edit in settings.json"
  6. Now you should have your settings.json file open.

Format on save

Setting up VSCode to format on save is a huge time saver. These settings make it so that every time your cursor leaves the file, the file is saved. Furthermore, every time the file is saved, it gets formatted using our eslint and prettier configuration! :tada: Just add the following to your settings.json file:

    "files.autoSave": "onFocusChange",
    "editor.formatOnSave": true,
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },

Install and configure the Prettier extension

  1. Install the "Prettier - Code formatter" extension by Prettier (note that there are currently more than 10 Prettier extensions. You want the one by Prettier. This extension uses your local .prettierrc.js file and uses your locally installed prettier package in your node_modules folder. The fact that it reads the local files is what makes this package work better than the default prettier implementation that ships with VSCode.
  2. Make this extension the default formatter by adding the following to your settings.json file:
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[javascript]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

Install and configure the Eslint extension

  1. Install the "ESLint" extension by Dirk Baeumer.
  2. Make this extension work by adding the following to your settings.json file:
  "eslint.alwaysShowStatus": true,
  "eslint.codeAction.showDocumentation": {
      "enable": true
  },
  "eslint.validate": [
      "javascript",
      "javascriptreact",
      "typescript",
      "typescriptreact"
  ],

Install and configure the Markdown Extension

  1. Install the "Markdown Extension Pack" extension by bat67. This extension installs many other markdown extensions including a linter.
  2. Configure the markdown linter to not modify bare urls. MD034/no-bare-urls, when enabled, does not allow bare urls such as https://github.com. When enabled, bare urls will be converted to [https://github.com/](https://github.com/).
  "markdownlint.config": {
      "MD034": false
  },

Development

npm i
npm test

There are test files that various linting rules can be tried out on. When adding rules, add to these files or create new ones to verify that the linting behavior is as desired.

Publishing

When ready to publish, follow these steps:

  1. Verify that all PRs have been merged into the staging branch.
  2. Open up a PR to merge the staging branch into the master branch. Typically the PR is named after the version that will be published, for example v2.1.0.
  3. After reviewing the changes that will be merged into master, determine the appropriate version change, major, minor, or patch.
  4. While on the staging branch locally, update the CHANGELOG.md file with an entry for the new version you're about to publish and commit your changes.
  5. While still on the staging branch locally, version the project using npm version <semver> where <semver> is major, minor, or patch. For example: npm version patch.
  6. git push your local staging branch up to origin.
  7. When the PR has been reviewed and merged into master, the package will be published by CI after the tests pass.