CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-rushstack--eslint-config

A TypeScript ESLint ruleset designed for large teams and projects

Pending
Overview
Eval results
Files

profiles.mddocs/

Profile Configurations

Profile configurations provide the foundational ESLint rule sets optimized for different runtime environments and security requirements. Each profile is designed to be used as the primary configuration with optional mixins layered on top.

Capabilities

Node.js Profile

ESLint configuration for general Node.js projects, typically web services. Enables security rules assuming the service could receive malicious inputs from untrusted users.

// Legacy format
module.exports = {
  extends: ["@rushstack/eslint-config/profile/node"],
  parserOptions: { tsconfigRootDir: __dirname }
};

// Flat format
import nodeProfile from "@rushstack/eslint-config/flat/profile/node";
export default [...nodeProfile];

Path: @rushstack/eslint-config/profile/node
Flat Path: @rushstack/eslint-config/flat/profile/node
Security Level: High - assumes untrusted inputs
Use Cases: Web services, APIs, general Node.js applications

Node.js Trusted Tool Profile

ESLint configuration for Node.js projects whose inputs always come from developers or trusted sources. Relaxes certain security rules that would otherwise prohibit resource-intensive operations or unsafe filesystem interactions.

// Legacy format
module.exports = {
  extends: ["@rushstack/eslint-config/profile/node-trusted-tool"],
  parserOptions: { tsconfigRootDir: __dirname }
};

// Flat format
import trustedToolProfile from "@rushstack/eslint-config/flat/profile/node-trusted-tool";
export default [...trustedToolProfile];

Path: @rushstack/eslint-config/profile/node-trusted-tool
Flat Path: @rushstack/eslint-config/flat/profile/node-trusted-tool
Security Level: Relaxed - assumes trusted inputs
Use Cases: Build tools, CLI applications, development utilities
Warning: Do not use for libraries that might be loaded by Node.js services

Web Application Profile

ESLint configuration for web applications running in browser environments. Enables security rules relevant to web browser APIs such as DOM manipulation and includes considerations for client-side security.

// Legacy format
module.exports = {
  extends: ["@rushstack/eslint-config/profile/web-app"],
  parserOptions: { tsconfigRootDir: __dirname }
};

// Flat format
import webAppProfile from "@rushstack/eslint-config/flat/profile/web-app";
export default [...webAppProfile];

Path: @rushstack/eslint-config/profile/web-app
Flat Path: @rushstack/eslint-config/flat/profile/web-app
Security Level: High - includes browser-specific security rules
Use Cases: Web applications, browser-based libraries, universal libraries for both Node.js and browsers

Profile Selection Guide

Choose node when:

  • Building web services or APIs
  • Handling untrusted user inputs
  • Need maximum security rules
  • General Node.js applications

Choose node-trusted-tool when:

  • Building CLI tools or build scripts
  • All inputs come from developers
  • Need to perform resource-intensive operations
  • Working exclusively with trusted files

Choose web-app when:

  • Building browser applications
  • Creating libraries that run in browsers
  • Need browser-specific security rules
  • Building universal libraries for Node.js and browsers

Usage Examples

Basic Node.js web service:

// .eslintrc.js
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
  extends: ["@rushstack/eslint-config/profile/node"],
  parserOptions: { tsconfigRootDir: __dirname }
};

Build tool with relaxed security:

// .eslintrc.js
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
  extends: ["@rushstack/eslint-config/profile/node-trusted-tool"],
  parserOptions: { tsconfigRootDir: __dirname }
};

React web application:

// .eslintrc.js
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
  extends: [
    "@rushstack/eslint-config/profile/web-app",
    "@rushstack/eslint-config/mixins/react"
  ],
  parserOptions: { tsconfigRootDir: __dirname },
  settings: {
    react: {
      version: "18.0"
    }
  }
};

Flat configuration for modern ESLint:

// eslint.config.js
import nodeProfile from "@rushstack/eslint-config/flat/profile/node";
import reactMixin from "@rushstack/eslint-config/flat/mixins/react";

export default [
  ...nodeProfile,
  ...reactMixin
];

Internal Implementation

All profiles are built using a common rule builder function that accepts a profile type parameter and generates the appropriate configuration object. The flat configuration versions export arrays of configuration objects compatible with ESLint's flat config format.

// Internal structure (not directly exported)
interface ProfileConfig {
  extends?: string[];
  plugins: string[];
  parser: string;
  parserOptions: {
    ecmaVersion: number;
    sourceType: 'module';
    project: string;
  };
  env: Record<string, boolean>;
  rules: Record<string, RuleConfig>;
  overrides: Array<{
    files: string[];
    rules: Record<string, RuleConfig>;
  }>;
}

Requirements

  • ESLint: ^8.57.0 || ^9.25.1 (for flat config)
  • TypeScript: >=4.7.0
  • Required patch: @rushstack/eslint-config/patch/modern-module-resolution
  • Parser options: tsconfigRootDir: __dirname must be specified for proper TypeScript integration

Install with Tessl CLI

npx tessl i tessl/npm-rushstack--eslint-config

docs

index.md

mixins.md

patches.md

profiles.md

tile.json