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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anmiles/eslint-config

v10.0.3

Published

Base eslint config for all projects

Downloads

920

Readme

@anmiles/eslint-config

Base eslint config for all projects

Flat config

This config is based on ESLint 9 flat config. To keep using legacy config, please consider installing @anmiles/[email protected]

Configs

| Config | Code | |--------|--------------------| | Base | ...configs.base | | TS | ...configs.ts | | React | ...configs.react | | Jest | ...configs.jest |

For JS-only projects (without TS, Jest, React) use base config. For more complex projects use combination of configs. Note that base config is mandatory in all cases.

Installation

  1. Install this package
    npm install --save-dev @anmiles/eslint-config
  2. Install required devDependencies
    • Base dependencies for all files:
      npm install --save-dev eslint eslint-plugin-align-assignments eslint-plugin-i18next eslint-plugin-import eslint-plugin-n eslint-plugin-promise @eslint/compat @eslint/css @eslint/js @eslint/json @eslint/markdown @stylistic/eslint-plugin
    • Additional dependencies for TS:
      npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript jiti typescript
    • Additional dependencies for React:
      npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-redux eslint-plugin-react-refresh
    • Additional dependencies for Jest:
      npm install --save-dev eslint-plugin-jest jest

Usage

  1. Extend all needed configs in your ./eslint.config.mjs (or ./eslint.config.js for ESM projects)

    • For JS-only projects (without TS, React, Jest) use base config:
      import { configs } from '@anmiles/eslint-config';
      
      export default [
      	...configs.base,
      
      	/* your own config */
      ];
    • For more complex projects use combination of configs
      • Backend TS project with Jest:
        import { configs } from '@anmiles/eslint-config';
        
        export default [
        	...configs.base,
        	...configs.ts,
        	...configs.jest,
        
        	/* your own config */
        ];
      • Frontend TS project with React and Jest:
        import { configs } from '@anmiles/eslint-config';
        
        export default [
        	...configs.base,
        	...configs.ts,
        	...configs.jest,
        	...configs.react,
        
        	/* your own config */
        ];
    • Also you can use type-checked config - ./eslint.config.mts (or ./eslint.config.ts for ESM projects). This requires jiti (why?)
      import type { Linter } from 'eslint';
      import { configs } from '@anmiles/eslint-config';
      
      export default [
      		...configs.base,
      		...configs.ts,
      		...configs.jest,
      		...configs.react,
      
      	/* your own config */
      
      ] as Linter.Config[];
  2. Specify npm commands

    "lint": "eslint",
    "lint:fix": "eslint --fix"
    • --ext parameter is not used in Flat Config mode
    • Specifying target directory (.) is not needed in Flat Config mode

Example

Javascript:

import stylisticEslintPlugin from '@stylistic/eslint-plugin';
import { patterns, configs } from '@anmiles/eslint-config';

export default [
	...configs.base,
	...configs.ts,
	...configs.jest,

	{
		ignores : [
			'coverage/*',
			'dist/*',
			'**/__snapshots__/*',
		],
	},

	{
		files : patterns.base,
		rules : {
			'@stylistic/max-len' : [ 'error', {
				code           : 100,
				tabWidth       : 4,
				ignoreComments : true,
			} ],
			'@stylistic/object-property-newline' : [ 'error', {
				allowAllPropertiesOnSameLine : true,
			} ],
			// override for TS-ESM project
			'import/extensions' : [ 'error', 'ignorePackages', {
				'js'  : 'always',
				'mjs' : 'always',
				'ts'  : 'never',
				'mts' : 'never',
			} ],
		},
	},

	{
		files : patterns.ts,
		rules : {
			'@typescript-eslint/no-unsafe-type-assertion' : [ 'off' ],
		},
	},
];

Typescript:

import stylisticEslintPlugin from '@stylistic/eslint-plugin';
import type { Linter } from 'eslint';
import { patterns, configs } from '@anmiles/eslint-config';

export default [
	...configs.base,
	...configs.ts,
	...configs.jest,

	{
		ignores : [
			'coverage/*',
			'dist/*',
			'**/__snapshots__/*',
		],
	},

	{
		files : patterns.base,
		rules : {
			'@stylistic/max-len' : [ 'error', {
				code           : 100,
				tabWidth       : 4,
				ignoreComments : true,
			} ],
			'@stylistic/object-property-newline' : [ 'error', {
				allowAllPropertiesOnSameLine : true,
			} ],
			// override for TS-ESM project
			'import/extensions' : [ 'error', 'ignorePackages', {
				'js'  : 'always',
				'mjs' : 'always',
				'ts'  : 'never',
				'mts' : 'never',
			} ],
		},
	},

	{
		files : patterns.ts,
		rules : {
			'@typescript-eslint/no-unsafe-type-assertion' : [ 'off' ],
		},
	},
] as Linter.Config[];

Exported constants

Patterns and extensions are also exported.

import { patterns, configs } from '@anmiles/eslint-config';

console.log(extensions.base); // [ '.js', '.mjs', '.cjs', '.jsx', '.ts', '.cts', '.mts', '.tsx' ]
console.log(extensions.jest); // [ '.test.js', '.test.mjs', '.test.cjs', '.test.jsx', '.test.ts', '.test.cts', '.test.mts', '.test.tsx' ]
console.log(patterns.ts);     // [ '**/*.ts', '**/*.cts', '**/*.mts', '**/*.tsx' ]
console.log(patterns.react);  // [ '**/*.js', '**/*.mjs', '**/*.cjs', '**/*.jsx', '**/*.ts', '**/*.cts', '**/*.mts', '**/*.tsx' ]

Notes

  • package-lock.json doesn't have to be ignored. It's already ignored in configuration for json plugin inside base config.
  • node_modules doesn't have to be ignored. It's implicitly ignored by ESLint.
  • Remember to provide files option in override sections to specify a set of extensions for which the section applies.
  • Don't keep .eslintignore file when using Flat Config. Use ignores config key instead (see the example above).

Migration to ESLint V9 flat configuration

Version 9 is based on ESLint V9 flat configuration. See migration guide if you had been using version 8 or below.

Links

Release notes of ESLint plugins