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

web-config.mddocs/

Web Configuration

ESLint configuration optimized for browser-based React applications. Provides React and JSX support with DOM globals and web-specific environment settings for client-side development.

Capabilities

Universe Web Configuration

Configuration tailored for React web applications running in browser environments.

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

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

Configuration Details:

  • Extends core, TypeScript, React, and Prettier configurations
  • Enables browser and CommonJS environments
  • Includes React and React Hooks linting rules
  • Provides standard web file extension support
  • Uses React version auto-detection

Flat Configuration Web

ESLint 9+ flat configuration format for web React projects.

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

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

Usage Examples:

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

// Next.js project with custom configuration
// .eslintrc.js
module.exports = {
  extends: ['universe/web'],
  rules: {
    'react/react-in-jsx-scope': 'off', // Not needed in Next.js
    'react/jsx-no-target-blank': 'error'
  }
};

// Create React App with TypeScript
// .eslintrc.js
module.exports = {
  extends: ['universe/web'],
  overrides: [
    {
      files: ['src/**/*.test.{js,jsx,ts,tsx}'],
      env: { jest: true }
    }
  ]
};

// Flat config for ESLint 9+
// eslint.config.js
const webConfig = require('eslint-config-universe/flat/web');

module.exports = [
  ...webConfig,
  {
    files: ['src/**/*.{js,jsx,ts,tsx}'],
    rules: {
      'no-console': 'warn' // Allow console in development
    }
  }
];

Environment Settings

Browser Environment

// Traditional config
env: { 
  browser: true,    // Enables browser globals
  commonjs: true    // Supports CommonJS modules
}

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

Available Browser Globals:

  • DOM APIs: document, window, navigator, location
  • Web APIs: fetch, localStorage, sessionStorage, history
  • Event handling: addEventListener, removeEventListener
  • Timer functions: setTimeout, setInterval, requestAnimationFrame
  • Console: console object for debugging

CommonJS Support

Enables CommonJS module system for compatibility with:

  • Webpack bundled applications
  • Node.js-style requires in build scripts
  • Legacy module formats
  • Mixed module environments

React and JSX Configuration

React Settings

// React version detection
settings: {
  react: { version: 'detect' }  // Automatically detects React version
}

JSX Rules

All React JSX rules from the native configuration apply:

// JSX formatting
'react/jsx-boolean-value': ['warn', 'never']
'react/jsx-closing-bracket-location': ['warn', { nonEmpty: 'after-props', selfClosing: 'tag-aligned' }]
'react/jsx-curly-brace-presence': ['warn', 'never']
'react/jsx-curly-spacing': ['warn', { when: 'never' }]
'react/jsx-equals-spacing': ['warn', 'never']
'react/jsx-first-prop-new-line': ['warn', 'multiline']
'react/jsx-fragments': ['warn', 'syntax']
'react/jsx-indent': ['warn', 2]
'react/jsx-indent-props': ['warn', 2]

// JSX best practices
'react/jsx-no-bind': ['warn', { allowArrowFunctions: true, allowFunctions: true }]
'react/jsx-no-duplicate-props': 'error'
'react/jsx-no-undef': 'error'
'react/jsx-props-no-multi-spaces': 'warn'
'react/jsx-tag-spacing': 'warn'
'react/jsx-uses-react': 'warn'
'react/jsx-uses-vars': 'warn'
'react/jsx-wrap-multilines': ['warn', { declaration: false, assignment: false, return: true, arrow: true }]

React Component Rules

// Component lifecycle and state
'react/no-access-state-in-setstate': 'warn'
'react/no-did-mount-set-state': 'warn'
'react/no-did-update-set-state': 'warn'
'react/no-direct-mutation-state': 'warn'
'react/no-redundant-should-component-update': 'warn'
'react/no-this-in-sfc': 'warn'
'react/no-unknown-property': 'warn'
'react/no-will-update-set-state': 'warn'
'react/require-render-return': 'warn'
'react/self-closing-comp': 'warn'

React Hooks Rules

// Hooks enforcement
'react-hooks/rules-of-hooks': 'error'        // Enforce Rules of Hooks
'react-hooks/exhaustive-deps': 'off'         // Disabled for flexibility

File Extensions Support

Standard web development file extensions:

// JavaScript extensions
.js, .jsx

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

Import Resolution

Configured for web application module resolution:

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

Common Use Cases

Single Page Applications (SPA)

Perfect for React SPAs built with Create React App, Vite, or custom Webpack configurations.

Server-Side Rendering (SSR)

Suitable for Next.js, Gatsby, and other SSR React frameworks with browser environment needs.

Progressive Web Apps (PWA)

Provides appropriate linting for PWA features and service worker compatibility.

Component Libraries

Ideal for React component libraries that will be consumed in web applications.