Skip to content

playcanvas/eslint-config

Repository files navigation

PlayCanvas ESLint Config

NPM Version NPM Downloads License Discord Reddit X

| User Manual | API Reference | Blog | Forum |

ESLint configuration developed by the PlayCanvas team and leveraged by many PlayCanvas-related projects, including the PlayCanvas Engine. However, you can use it for any JavaScript-based project if you approve of the PlayCanvas coding style.

Usage

  1. Install the package:
npm install -D @playcanvas/eslint-config eslint
  1. Create an eslint.config.js file in your project root:
import playcanvasConfig from '@playcanvas/eslint-config';

export default [
    ...playcanvasConfig.typescript,
    // ...playcanvasConfig.react, // Uncomment if using react
    // ...playcanvasConfig.legacy, // Uncomment if using legacy javascript rules
    // Your custom configurations here
];

Features

Warning

The typescript and react rules are incomplete and are still being developed based on current practises and existing legacy rules

  • Full flat config format support for ESLint 9+
  • Comprehensive rule configuration
  • Support for ESM Script JSDoc tags used in PlayCanvas
  • Import ordering and validation
  • Strict JSDoc validation
  • Regular expression pattern enforcement

Requirements

  • ESLint 9 or later
  • Node.js 18 or later

About

ESLint configuration used by PlayCanvas

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10