or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

basic-config.mdextension-utilities.mdindex.mdnative-config.mdnode-config.mdtypescript-analysis.mdweb-config.md
tile.json

node-config.mddocs/

Node.js Configuration

ESLint configuration tailored for Node.js applications and server-side JavaScript/TypeScript development. Provides Node.js-specific environment settings and linting rules for backend services, CLI tools, and server applications.

Capabilities

Universe Node Configuration

Configuration optimized for Node.js runtime environments with server-side specific rules and settings.

// Traditional ESLint config (.eslintrc.js)
module.exports = {
  extends: ['universe/node']
};

// Package.json configuration
{
  "eslintConfig": {
    "extends": "universe/node"
  }
}

Configuration Details:

  • Extends core, TypeScript, and Prettier configurations
  • Enables Node.js environment with server-side globals
  • Includes Node.js-specific linting rules via eslint-plugin-node (traditional) or eslint-plugin-n (flat)
  • Excludes React-specific rules (no JSX support)
  • Provides Buffer and path manipulation safety rules

Flat Configuration Node

ESLint 9+ flat configuration format for Node.js projects.

// eslint.config.js
const { defineConfig } = require('eslint/config');
const config = require('eslint-config-universe/flat/node');
module.exports = defineConfig(config);

// Or with ES modules
import { defineConfig } from 'eslint/config';
import config from 'eslint-config-universe/flat/node';
export default defineConfig(config);

Usage Examples:

// Basic Node.js application
// .eslintrc.js
module.exports = {
  extends: ['universe/node']
};

// Express.js API server
// .eslintrc.js
module.exports = {
  extends: ['universe/node'],
  rules: {
    'no-console': 'off', // Allow console.log in server applications
    'node/no-missing-import': 'error'
  }
};

// Node.js CLI tool
// .eslintrc.js
module.exports = {
  extends: ['universe/node'],
  overrides: [
    {
      files: ['bin/**/*.js'],
      rules: {
        'no-process-exit': 'off' // Allow process.exit in CLI tools
      }
    }
  ]
};

// TypeScript Node.js project
// .eslintrc.js
module.exports = {
  extends: ['universe/node'],
  overrides: [
    {
      files: ['*.ts'],
      parserOptions: {
        project: './tsconfig.json'
      }
    }
  ]
};

Node.js Environment

Environment Settings

// Traditional config
env: { node: true }

// Flat config
languageOptions: {
  globals: { ...globals.node }
}

Available Node.js Globals:

  • Core modules: require, module, exports, __dirname, __filename
  • Process: process, global, Buffer
  • Timers: setTimeout, setInterval, setImmediate, clearTimeout, clearInterval, clearImmediate
  • Console: console object for logging
  • URL: URL, URLSearchParams

Node.js Plugins

// Traditional config uses eslint-plugin-node
plugins: ['node']

// Flat config uses eslint-plugin-n  
plugins: {
  n: nodePlugin
}

Node.js Specific Rules

Buffer Safety

// Prevents deprecated Buffer constructor usage
'no-buffer-constructor': 'warn'

// Example of what this prevents:
// ❌ new Buffer(size)        // Deprecated and unsafe
// ✅ Buffer.alloc(size)      // Preferred safe alternative
// ✅ Buffer.from(data)       // Preferred for data conversion

Path Manipulation Safety

// Traditional config - prevents unsafe path concatenation
'node/no-path-concat': 'warn'

// Flat config - prevents unsafe path concatenation
'n/no-path-concat': 'warn'

// Example of what this prevents:
// ❌ __dirname + '/file.txt'           // Unsafe path concatenation
// ✅ path.join(__dirname, 'file.txt')  // Preferred cross-platform approach
// ✅ path.resolve(__dirname, 'file.txt') // Alternative safe method

Node.js API Safety

// Flat config - warns about deprecated Node.js APIs
'n/no-deprecated-api': 'warn'

// Example of what this prevents:
// ❌ fs.exists()                      // Deprecated, use fs.access() or fs.stat()
// ❌ Buffer()                         // Deprecated constructor
// ✅ fs.access()                      // Modern alternative
// ✅ Buffer.from() / Buffer.alloc()   // Safe alternatives

File Extensions Support

Standard JavaScript and TypeScript extensions for Node.js:

// JavaScript extensions
.js, .jsx

// TypeScript extensions
.ts, .tsx, .d.ts

Note: While .jsx and .tsx are supported for completeness, React/JSX rules are not included in the Node.js configuration.

Import Resolution

Configured for Node.js module resolution:

// Import/export settings
settings: {
  'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
  'import/resolver': {
    node: { extensions: ['.js', '.jsx', '.ts', '.tsx'] }
  }
}

Common Use Cases

Express.js Applications

Perfect for Express.js web servers, REST APIs, and GraphQL backends.

CLI Tools

Suitable for command-line applications and build tools with Node.js-specific considerations.

Microservices

Ideal for Node.js microservices, serverless functions, and backend services.

Build Scripts

Appropriate for build scripts, automation tools, and development utilities.

Database Applications

Suitable for applications using databases with Node.js drivers (MongoDB, PostgreSQL, etc.).

Real-time Applications

Perfect for WebSocket servers, chat applications, and real-time communication services.

Integration with Other Configs

Can be combined with other universe configurations for full-stack projects:

// Full-stack project with Node.js backend and React frontend
module.exports = {
  extends: ['universe/node'],
  overrides: [
    {
      files: ['client/**/*', 'frontend/**/*'],
      extends: ['universe/web']
    },
    {
      files: ['mobile/**/*', 'app/**/*'],  
      extends: ['universe/native']
    }
  ]
};