ESLint Plugin Foundry VTT

raw JSON →
0.0.1 verified Fri May 01 auth: no javascript

An ESLint plugin for linting Foundry Virtual Tabletop (VTT) modules. v0.0.1 is the initial release. It provides rules and configurations that enforce best practices specific to Foundry VTT development, such as avoiding deprecated APIs and following module conventions. The plugin is designed to be used with ESLint 0.10.0 or later and ships with a 'recommended' configuration. As an early release, users should expect potential breaking changes.

error Failed to load plugin 'foundry-vtt' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-foundry-vtt'
cause Plugin not installed or installed globally while ESLint is local.
fix
Run npm install eslint-plugin-foundry-vtt --save-dev in your project directory.
breaking Initial release (v0.0.1) may have unstable rules or configurations.
fix Pin version and test thoroughly.
npm install eslint-plugin-foundry-vtt
yarn add eslint-plugin-foundry-vtt
pnpm add eslint-plugin-foundry-vtt

Shows how to install and configure the ESLint plugin for Foundry VTT modules using the recommended ruleset.

// .eslintrc.json
{
  "extends": [
    "plugin:foundry-vtt/recommended"
  ]
}

// Install
git init
npm init -y
npm install eslint eslint-plugin-foundry-vtt --save-dev
npx eslint .