Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

eslint-config-ts-mailonline

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-ts-mailonline

ESLint TS config for MailOnline

latest
Source
npmnpm
Version
6.0.0
Version published
Weekly downloads
450
29.31%
Maintainers
4
Weekly downloads
 
Created
Source

eslint-config-ts-mailonline

NPM version Build status

MailOnline ESLint Typescript configuration for ESLint 9+ (flat config).

Requirements

  • ESLint >= 9.0.0
  • TypeScript >= 5.0.0
  • Node.js >= 18.18.0

Usage

  • Add eslint-config-ts-mailonline, eslint, typescript, prettier, husky, and pretty-quick as development dependencies:
yarn add --dev eslint-config-ts-mailonline eslint typescript prettier husky pretty-quick
  • Create a tsconfig.eslint.json file at the root of your project:
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "allowJs": true,
    "noEmit": true
  },
  "include": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/*.js", "**/*.jsx", "**/*.mjs", "**/*.cjs"],
  "exclude": ["node_modules", "dist", "coverage"]
}

Why is this needed? This configuration uses @typescript-eslint/parser with type-aware linting, which requires TypeScript to know about all files being linted. Many projects exclude test files and config files from their main tsconfig.json to avoid compiling them. The tsconfig.eslint.json ensures all files are included for linting purposes without affecting your build configuration.

tsconfig.eslint.json is now required: You must create a tsconfig.eslint.json file in your project root. This is necessary because the configuration uses @typescript-eslint/parser with project: './tsconfig.eslint.json' for type-aware linting rules.

  • Create an eslint.config.mjs file at the root of your project using defineConfig (defineConfig is the standard way to define ESLint configurations since ESLint 9):
import { defineConfig } from 'eslint/config';
import { baseConfig, reactConfig } from 'eslint-config-ts-mailonline';

// defineConfig accepts both a config object or an array of config objects
export default defineConfig({
  // extends automatically flattens configuration arrays, so no spread operator needed
  extends: [
    baseConfig,
    reactConfig // optional, only if using React
  ]
  // your custom overrides here:
  // rules: { 'no-console': 'warn' }
});
  • Create prettier.config.mjs at the root of your project:
export { default } from 'eslint-config-ts-mailonline/prettierConfig';
  • Add the following script command to your package.json:
{
  "scripts": {
    "lint": "tsc --noEmit && eslint ."
  }
}
  • Add the following hooks to your husky scripts:

Pre-commit (.husky/pre-commit):

pretty-quick --staged && yarn run lint

Pre-push (.husky/pre-push):

yarn run test

Ignoring files

With ESLint 9 flat config, ignores are defined in your eslint.config.mjs using globalIgnores:

import { defineConfig, globalIgnores } from 'eslint/config';
import { baseConfig } from 'eslint-config-ts-mailonline';

export default defineConfig([
  // These ignores will be merged with the ones in baseConfig global ignores object
  // ending up in: ['**/node_modules/**', '**/coverage/**', '**/dist/**', 'bin/**', 'legacy/**']
  globalIgnores(['bin/**', 'legacy/**']),
  {
    extends: [
      baseConfig
      // other configs...
    ]
  }
]);

Bundled dependencies

This package includes the following ESLint plugins and configurations as direct dependencies. You should remove these from your project's devDependencies if you have them:

  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint-config-prettier
  • eslint-import-resolver-typescript
  • eslint-plugin-import
  • eslint-plugin-no-only-tests
  • eslint-plugin-prefer-arrow
  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • eslint-plugin-unicorn

Why? By bundling these dependencies, we:

  • Guarantee compatibility: The config package ensures all plugins work correctly together
  • Avoid version conflicts: No risk of peer dependency mismatches or duplicate packages
  • Simplify adoption: Consumers don't need to manage ESLint plugin versions
  • Single source of truth: Updates to plugins are handled centrally in this package

Breaking changes

Any changes to this package that might cause code using it to not validate anymore, will be a semver-major change.

Migration from v4.x to v5.x

See Migration Guide for instructions on upgrading from v4.x (ESLint 8) to v5.x (ESLint 9).

Keywords

eslint

FAQs

Package last updated on 24 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts