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 🙏

© 2025 – Pkg Stats / Ryan Hefner

stijnklomp-linting-formatting-config

v7.0.3

Published

Linting and formatting configuration for Typescript projects using typescript-eslint.

Downloads

63

Readme

ESLint configuration

Installation

You can install the package via npm by running the following command:

npm install stijnklomp-linting-formatting-config --save-dev

Use the following to install all peer dependencies not marked as optional:

npx install-peerdeps --dev stijnklomp-linting-formatting-config --only-peers

Dependencies

This package uses peer dependencies. These are packages that the project expects to be provided by the user. They are not installed automatically and must be manually installed.

Check the peerDependencies section of the package.json file to ensure you have compatible versions of the required dependencies.

Required dependencies

The below dependencies are required for both JavaScript and TypeScript.

  • @typescript-eslint/parser
  • eslint
  • eslint-config-prettier
  • eslint-plugin-jsonc
  • eslint-plugin-package-json
  • eslint-plugin-prettier
  • eslint-plugin-yml
  • prettier
  • prettier-plugin-packagejson
  • typescript-eslint

Optional dependencies

  • JavaScript:
    • @eslint/js (Will not be used when using TypeScript)
  • Testing:
    • eslint-plugin-jest (Jest)
  • Markdown:
    • eslint-plugin-markdown (Markdown)
  • React:
    • eslint-plugin-react
    • eslint-plugin-react-hooks
  • CSS/SASS:
    • stylelint
    • stylelint-config-prettier-scss
    • stylelint-config-standard-scss
  • TypeScript:
    • typescript

Usage

Find usage examples below for everything that requires its own configuration file. (ESLint, Prettier, Typedoc, editor config and Stylelint)

ESLint (Mandatory)

To use ESLint in your project, you need to create an ESLint configuration file (eslint.config.(m)js) and use the ESLint config. (stijnklomp-linting-formatting-config/dist/index.js)

eslint.config.(m)js

import tseslint from "typescript-eslint"
import config from "stijnklomp-linting-formatting-config/dist/index.js"

export default tseslint.config(
	...config({
		strict: true,
		tsconfigRootDir: ".",
		typescript: true,
	}),
)

Optional configurations can be used by specifying them in the configs parameter. For a full list of available configs please refer to the optionalConfigs variable in index.ts.

// Example of no optional configurations
// Not specifying any optional configurations will use the default values
// Refer to the `optionalConfigs` variable in `index.ts` for default values
config({
	strict: false, // Defaults to 'false' - Available only with TypeScript
	tsconfigRootDir: ".", // Defaults to '.'
	typescript: true, // Defaults to 'true'
})

// Example of some optional configurations
config({
	configs: {
		includeRemainder: false, // Include any optional configurations not specified - Defaults to 'false'
		jest: true,
		yml: true,
	},
	strict: false,
	tsconfigRootDir: ".",
	typescript: true,
})

// Example of some optional configurations with `includeRemainder` set to `true`
config({
	configs: {
		includeRemainder: true,
		jsx: false,
		react: false,
	},
	typescript: false,
})

Prettier (Mandatory)

To use Prettier in your project, you need to create a Prettier configuration file (.prettierrc.(m)js) and extend the Prettier config (stijnklomp-linting-formatting-config/dist/settings/prettier.js).

.prettierrc.(m)js

import { prettierSettings } from "stijnklomp-linting-formatting-config/dist/settings/prettier.js"

export default prettierSettings

Typedoc (Optional)

To use Typedoc in your project, you need to create a Typedoc configuration file (typedoc.(m)js) and extend the Typedoc config (stijnklomp-linting-formatting-config/dist/settings/typedoc.js).

typedoc.(m)js

import { typedocSettings } from "stijnklomp-linting-formatting-config/dist/settings/typedoc.js"

export default typedocSettings

Editor config (Optional)

To use the provided editor config in your project, you need to create an editor config file (.editorconfig) and copy over the entire contents of the provided editor config. (stijnklomp-linting-formatting-config/.editorconfig)

Stylelint (Optional)

To use Stylelint in your project, you need to create a Stylelint configuration file (.stylelintrc.js) and extend the Stylelint settings. (stijnklomp-linting-formatting-config/dist/settings/stylelint.js) Note: Flat config is currently not supported.

.stylelintrc.js

module.exports = {
	extends: [
		"./node_modules/stijnklomp-linting-formatting-config/dist/settings/stylelint.js",
	],
}

JSON sort

This package comes with a JSON sort Bash script that will go through all specified JSON files and sort the keys in alphabetical order.

Ensure the script has execution permissions:

chmod +x sortJson.sh

To use it just call it from the command line:

./sortJson.sh

You can specify which directories and/or files to exclude by specifying them directly after the script call:

./sortJson.sh "./custom/path/*" "./another/exclude.json"

License

This project is licensed under the MIT License. Feel free to customize and use it for your own projects.