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

@data-matters.io/eslint-config

v1.2.0

Published

Shared ESLint flat configurations with integrated Prettier for Data Matters Inc

Readme

@data-matters.io/eslint-config

Shared ESLint flat configurations with integrated Prettier for Data Matters Inc projects. This module provides standardized rules for JavaScript, TypeScript, React, Next.js, and NestJS, exclusively supporting ESLint 9+ flat config format. Prettier is integrated directly into the ESLint configuration.

Features

  • 🎯 Flat Config Only - ESLint 9+ flat config format exclusively
  • 🔒 Version Control - Pinned dependency versions for consistent behavior
  • 📦 All plugins included - No need to install multiple ESLint plugins
  • 🔧 Prettier integrated - Formatting via eslint-plugin-prettier
  • Accessibility rules - jsx-a11y included for React projects
  • 📁 Alias support - Works with @/** path aliases
  • 🗂️ Centralized configs - Prettier and ignore patterns in JSON files

Installation

# npm
npm install --save-dev @data-matters.io/eslint-config

# pnpm
pnpm add -D @data-matters.io/eslint-config

# yarn
yarn add -D @data-matters.io/eslint-config

Note: ESLint, Prettier, and all plugins are included as dependencies with pinned versions. No additional packages required.

Requirements

  • Node.js: >= 18.0.0
  • ESLint: 9+ (included as dependency)
  • TypeScript: >= 5.0.0 (optional, only for TypeScript projects)

Usage

React + TypeScript (Recommended)

// eslint.config.mjs
import { reactTypescript } from '@data-matters.io/eslint-config'

export default reactTypescript

TypeScript

// eslint.config.mjs
import { typescript } from '@data-matters.io/eslint-config'

export default typescript

React (JavaScript)

// eslint.config.mjs
import { react } from '@data-matters.io/eslint-config'

export default react

Pure JavaScript

// eslint.config.mjs
import { base } from '@data-matters.io/eslint-config'

export default base

NestJS

// eslint.config.mjs
import { nestjs } from '@data-matters.io/eslint-config'

export default nestjs

Note: The NestJS configuration uses typed linting (projectService: true), which requires a valid tsconfig.json in your project root. This is standard for NestJS projects created with @nestjs/cli.

Next.js (App Router)

// eslint.config.mjs
import { nextjs } from '@data-matters.io/eslint-config'

export default nextjs

Next.js (Strict - Core Web Vitals)

For performance-critical applications with stricter rules:

// eslint.config.mjs
import { nextjsStrict } from '@data-matters.io/eslint-config'

export default nextjsStrict

Note: The strict configuration upgrades performance-related warnings to errors, enforcing best practices for Core Web Vitals (LCP, FID, CLS, INP).

Available Configurations

| Export | Alias | Description | |--------|-------|-------------| | reactTypescript | reactTs | React + TypeScript (recommended for frontend) | | nextjs | next | Next.js + TypeScript (App Router) | | nextjsStrict | - | Next.js with strict Core Web Vitals rules | | nestjs | nest | NestJS (recommended for backend) | | typescript | ts | TypeScript only | | react | reactJs | React with JavaScript | | base | js, javascript | Pure JavaScript |

Customization

Adding Custom Rules

import { reactTypescript } from '@data-matters.io/eslint-config'

export default [
  ...reactTypescript,
  {
    rules: {
      'no-console': 'off',
      '@typescript-eslint/no-explicit-any': 'error',
    },
  },
]

Overriding for Test Files

import { reactTypescript } from '@data-matters.io/eslint-config'

export default [
  ...reactTypescript,
  {
    files: ['**/*.test.ts', '**/*.spec.ts'],
    rules: {
      '@typescript-eslint/no-explicit-any': 'off',
    },
  },
]

NestJS without Swagger Rules

If your NestJS project doesn't use Swagger/OpenAPI documentation:

import { nestjs, nestjsPluginRulesNoSwagger } from '@data-matters.io/eslint-config'

export default [
  ...nestjs,
  {
    files: ['src/**/*.ts'],
    rules: {
      ...nestjsPluginRulesNoSwagger,
    },
  },
]

Next.js Custom Rules

You can import individual rule sets for fine-grained control:

import { nextjs, nextjsCoreRules, nextjsStrictRules } from '@data-matters.io/eslint-config'

export default [
  ...nextjs,
  {
    // Apply strict rules only to app/ directory
    files: ['app/**/*.{ts,tsx}'],
    rules: {
      ...nextjsStrictRules,
    },
  },
]

Enabling Type-Checked Rules (Optional)

For stricter type-checking rules (slower but more thorough):

import { reactTypescript } from '@data-matters.io/eslint-config'

export default [
  ...reactTypescript,
  {
    files: ['**/*.{ts,tsx}'],
    languageOptions: {
      parserOptions: {
        project: './tsconfig.json',
        tsconfigRootDir: import.meta.dirname,
      },
    },
    rules: {
      '@typescript-eslint/no-floating-promises': 'error',
      '@typescript-eslint/await-thenable': 'error',
    },
  },
]

Recommended NPM Scripts

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

Note: The lint:fix command applies both ESLint and Prettier fixes. A separate format command is not needed.

VS Code / Cursor Integration

Create .vscode/settings.json in your project:

{
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "eslint.useFlatConfig": true
}

EditorConfig

The module includes an .editorconfig file aligned with the Prettier settings. Copy it to your project:

cp node_modules/@data-matters.io/eslint-config/configs/shared/.editorconfig .editorconfig

Or create your own with these settings:

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

Main Rules

JavaScript/TypeScript

  • ✅ Use const and let (not var)
  • ✅ Prefer arrow functions
  • ✅ Prefer template literals
  • ✅ Automatic import sorting with alias support (@/**)
  • ✅ TypeScript strict rules (non-type-checked by default)

React

  • ✅ React 17+ JSX transform (no need to import React)
  • ✅ Hooks rules enforcement
  • ✅ JSX best practices
  • ✅ Accessibility (jsx-a11y) warnings

Next.js

  • ✅ App Router support (Next.js 13+)
  • ✅ Use next/link instead of <a> for navigation
  • ✅ Use next/image instead of <img> for optimization
  • ✅ Use next/script for third-party scripts
  • ✅ Google Fonts optimization rules
  • ✅ No async Client Components
  • ✅ Core Web Vitals focused rules (strict mode)
  • ✅ Automatic detection of Server/Client Components

NestJS

  • Typed linting enabled - Uses projectService for type-aware rules
  • ✅ Node.js globals and Jest support
  • ✅ Injectable classes must be provided in modules
  • ✅ DTO validation decorators enforcement
  • ✅ Swagger/OpenAPI decorator rules (optional, can be disabled)
  • ✅ Parameter decorator validation (@Param matches route params)
  • ✅ Relaxed rules for test files (.spec.ts, .test.ts, .e2e-spec.ts)
  • @typescript-eslint/consistent-type-imports disabled (required for DI)
  • ✅ Empty constructors allowed (common in DI patterns)
  • ✅ Empty classes allowed (DTOs with decorators only)

Prettier (Integrated)

  • Single quotes (')
  • No semicolons
  • No trailing commas
  • Tab width: 2 spaces
  • Print width: 80 characters
  • LF line endings

Import Organization

  • Groups: builtinexternalinternalparentsiblingindextype
  • React imports first
  • Alias @/** imports in internal group
  • Alphabetical ordering within groups
  • Newlines between groups

Project Structure

@data-matters.io/eslint-config/
├── configs/
│   ├── shared/
│   │   ├── rules/
│   │   │   ├── a11y-rules.mjs       # Accessibility rules
│   │   │   ├── base-rules.mjs       # Base JavaScript rules
│   │   │   ├── typescript-rules.mjs # TypeScript rules
│   │   │   ├── react-rules.mjs      # React rules
│   │   │   ├── nestjs-rules.mjs     # NestJS rules
│   │   │   ├── nextjs-rules.mjs     # Next.js rules
│   │   │   └── node-rules.mjs       # Node.js rules
│   │   ├── prettier-options.json    # Centralized Prettier config
│   │   ├── ignore-patterns.json     # Centralized ignore patterns
│   │   └── .editorconfig            # EditorConfig template
│   ├── base.mjs                     # Base JavaScript
│   ├── typescript.mjs               # TypeScript
│   ├── react.mjs                    # React
│   ├── react-typescript.mjs         # React + TypeScript
│   ├── nestjs.mjs                   # NestJS
│   └── nextjs.mjs                   # Next.js
├── index.mjs                        # Main entry point
├── CHANGELOG.md                     # Version history
└── README.md                        # Documentation

Shared Configurations

The configs/shared/ folder contains centralized configuration files used by all ESLint configs:

prettier-options.json

Centralized Prettier options used by all configurations:

{
  "semi": false,
  "singleQuote": true,
  "quoteProps": "as-needed",
  "trailingComma": "none",
  "tabWidth": 2,
  "useTabs": false,
  "printWidth": 80,
  "jsxSingleQuote": true,
  "bracketSameLine": false,
  "arrowParens": "always",
  "endOfLine": "lf",
  "bracketSpacing": true,
  "proseWrap": "preserve",
  "htmlWhitespaceSensitivity": "css",
  "embeddedLanguageFormatting": "auto"
}

You can import this file directly if needed:

import prettierOptions from '@data-matters.io/eslint-config/prettier-options'

ignore-patterns.json

Centralized ignore patterns for flat configs:

{
  "patterns": [
    "node_modules",
    "dist",
    "build",
    "coverage",
    "deploy/*",
    ".__mf__temp",
    ".vscode",
    "**/*.css",
    "**/*.min.js",
    ".next",
    "out"
  ]
}

You can import this file directly if needed:

import ignorePatterns from '@data-matters.io/eslint-config/ignore-patterns'

.editorconfig

EditorConfig template aligned with Prettier settings. See EditorConfig section for usage.

Exports

The module exports the following:

| Export | Description | |--------|-------------| | @data-matters.io/eslint-config | Main configurations (flat config only) | | @data-matters.io/eslint-config/nestjs | NestJS configuration (direct import) | | @data-matters.io/eslint-config/nextjs | Next.js configuration (direct import) | | @data-matters.io/eslint-config/prettier-options | Prettier options JSON | | @data-matters.io/eslint-config/ignore-patterns | Ignore patterns JSON | | @data-matters.io/eslint-config/editorconfig | EditorConfig file |

NestJS Specific Exports

| Export | Description | |--------|-------------| | nestjsPluginRules | All NestJS plugin rules (with Swagger) | | nestjsPluginRulesNoSwagger | NestJS rules without Swagger requirements | | nestjsTypescriptOverrides | TypeScript rule overrides for NestJS patterns | | nodeRules | Node.js/backend specific rules (shared with NestJS) |

Next.js Specific Exports

| Export | Description | |--------|-------------| | nextjsCoreRules | Standard Next.js plugin rules | | nextjsStrictRules | Strict rules (Core Web Vitals focused) | | nextjsSettings | Next.js ESLint settings | | nextjsIgnorePatterns | Next.js-specific ignore patterns |

Dependencies

This package includes all required dependencies with pinned versions to ensure consistency across all Data Matters projects:

| Package | Version | Included | |---------|---------|----------| | eslint | 9.39.0 | ✅ Yes | | prettier | 3.6.2 | ✅ Yes | | typescript-eslint | 8.48.0 | ✅ Yes | | eslint-plugin-react | 7.37.0 | ✅ Yes | | eslint-plugin-react-hooks | 5.0.0 | ✅ Yes | | eslint-plugin-jsx-a11y | 6.10.0 | ✅ Yes | | eslint-plugin-import-x | 4.16.1 | ✅ Yes | | eslint-plugin-prettier | 5.0.0 | ✅ Yes | | @darraghor/eslint-plugin-nestjs-typed | ^6.1.0 | ✅ Yes | | @next/eslint-plugin-next | ^15.1.0 | ✅ Yes |

Optional Peer Dependency

| Package | Version | Required | |---------|---------|----------| | typescript | >=5.0.0 | ⚪ Only for TypeScript projects |

Why pinned versions? To ensure all projects use the same tested and approved versions, preventing inconsistencies and unexpected behavior from automatic updates.

Testing the Module Locally

Using pnpm link

# In the module directory
pnpm link --global

# In your test project
pnpm link --global @data-matters.io/eslint-config

Using file: protocol (Recommended)

In your test project's package.json:

{
  "devDependencies": {
    "@data-matters.io/eslint-config": "file:/path/to/eslint-config"
  }
}

Then run pnpm install.

Using npm pack (For final testing)

# In the module directory
npm run test:pack:create

# In your test project
pnpm add -D /path/to/eslint-config-1.0.1.tgz

Publishing

Versioning Scripts

npm run version:patch     # 1.0.0 → 1.0.1
npm run version:minor     # 1.0.0 → 1.1.0
npm run version:major     # 1.0.0 → 2.0.0
npm run version:patch:beta # 1.0.0 → 1.0.1-beta.0

Publishing Scripts

npm run publish:dry-run   # Preview what will be published
npm run publish:public    # Publish to npm
npm run publish:beta      # Publish as beta

Troubleshooting

ESLint not finding the config

Make sure you're using ESLint 9+ and the flat config format:

npx eslint --version  # Should be 9.x.x

Prettier not working

The Prettier rules are applied via ESLint. Run:

npm run lint:fix
# or
pnpm lint:fix

Note: Since Prettier is included as a dependency, you don't need to install it separately.

Import order not working

Make sure your tsconfig.json has the correct baseUrl and paths for alias resolution:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

Version conflicts

If you have ESLint or Prettier already installed in your project, you may see version conflicts. Since this package includes all dependencies with pinned versions, you can safely remove them from your project:

npm uninstall eslint prettier
# or
pnpm remove eslint prettier

NestJS: "requires type information" error

If you see an error like:

Error: You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file.

This means the TypeScript parser can't find your tsconfig.json. Make sure:

  1. You have a valid tsconfig.json in your project root
  2. The file being linted is included in tsconfig.json's include array

For NestJS projects, your tsconfig.json should include:

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "ES2021",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true
  },
  "include": ["src/**/*", "test/**/*"]
}

Version Policy

This package follows semantic versioning with controlled releases:

| Version Type | Description | Example | |--------------|-------------|---------| | MAJOR | Breaking changes in rules (warn → error) | 1.0.02.0.0 | | MINOR | New rules added (warn/off by default) | 1.0.01.1.0 | | PATCH | Dependency updates without behavior changes | 1.0.01.0.1 |

Recommendation: Pin to the MAJOR version in your projects:

{
  "devDependencies": {
    "@data-matters.io/eslint-config": "^1.0.0"
  }
}

Contributing

To modify the configurations, edit the files in configs/ and test in real projects before publishing a new version.

Author

Márcio Barroso

License

ISC