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

@synatic/eslint-config-synatic-node

v2.0.0

Published

Global repo for how code should be linted and styled

Downloads

205

Readme

lint-and-code-style

Global repo for how linting and code styling should be done for Synatic projects.

Making changes

In the root of the project is a .eslintrc.json file, this is where the majority of the rules, plugins and config will live and where you should primarily be making changes. The base file is for node projects that use mocha. You can test out changes to the base config by adding code to the ./lib-examples/ folder and your editor should be able to pick up any issues with the code which will allow you to refine the rules and verify that they work the way you would like them too.

Once you have the rules setup the way you would like to you can run the npm run copy command and this will take the config in the .eslintrc.json file and copy it to ./lib/index.js where it will be used in other projects once published.

The library also supports more advanced configuration for other project types, for example projects that use jest can make use of both the base configuration file in the root together with the jest specific config in ./lib/jest.js by having their project extend @synatic/eslint-config-synatic-node/lib/jest. Currently there is no way to test these specific configurations in this project without copying them to the .eslintrc.json file and testing them, but do not leave them there when committing or else they will apply to the shared base configuration.

Once you have made all the above changes and ran the npm run copy command you can commit to git run the npm version <major,minor,patch> command to increment the version, push to develop and submit a PR as normal.

Adding to your project

To add the shared configuration to your project you can do the following:

  1. run npm i -D @synatic/eslint-config-synatic-node in your project
  2. create a .eslintrc.json file in your project
  3. Add the following code:
    {
        "env": {},
        "extends": ["@synatic/eslint-config-synatic-node"],
        "globals": {},
        "parserOptions": {},
        "overrides": [],
        "rules": {}
    }
  4. If you would prefer to use a different config from the base one, simply replace the extends in the above example with your desired one.
  5. create a .prettierrc.json in your project and inside it add the code from this repositories version of the file as this will be the most up to date version
  6. Install the peer dependencies listed in this project's package.json file, which can be found under peerDependencies
  7. Ensure your package.json has the correct engine section, e.g.:
    "engines": {
        "node": ">=14.0.0",
        "npm": ">=6.0.0"
    },
  1. Ensure your package.json has the required scripts:
    "lint": "eslint .",
    "lint-fix": "eslint . --fix",
    "lint-errors": "eslint . --quiet",
    "prettier": "prettier . --write"

Configs available

  • @synatic/eslint-config-synatic-node
  • @synatic/eslint-config-synatic-node/lib/jest