0.3.1 • Published 3 years ago

@typhonjs-fvtt/eslint-foundry.js v0.3.1

Weekly downloads
113
License
MIT
Repository
github
Last release
3 years ago

@typhonjs-fvtt/eslint-foundry.js

NPM License

Why:

This module provides shared ESLint configuration files for Foundry VTT / foundry.js containing all exported globals for module / system development. This configuration file is designed as an addon to other configuration files of your choice as it only defines the foundry.js globals for use with directives like no-shadow or @typescript-eslint/no-shadow if you are using Typescript. Enable ESLint in your IDE of choice and feel relief that you are not overwriting any globals defined in foundry.js!

Please see the .eslintrc file in demo-rollup-module for a complete example.

Latest version: 0.7.8

All versions:

  • 0.7.8

Installation:

npm install --save-dev @typhonjs-fvtt/eslint-foundry.js or add to package.json.

To use:

Create a minimal .eslintrc file in the root path of a project.

/**
 * Loads https://github.com/typhonjs-fvtt/eslint-foundry.js/blob/main/config/latest/.eslintrc
 * NPM: https://www.npmjs.com/package/@typhonjs-fvtt/eslint-foundry.js
 *
 * Note: specific versions are located in /config/<VERSION>/.eslintrc
 */
{
  "extends": "./node_modules/@typhonjs-fvtt/eslint-foundry.js/config/latest/.eslintrc"

  // Prevents overwriting any built in globals particularly from `@typhonjs-fvtt/eslint-foundry.js`. 
  // `event / window.event` shadowing is allowed due to being a common variable name and an uncommonly used browser 
  // feature.
  //
  // Note: if you are using Typescript you must use `@typescript-eslint/no-shadow`
  "rules": {
    "no-shadow": ["error", { "builtinGlobals": true, "hoist": "all", "allow": ["event"] }]
  }
}

Example IDE Integration

IDE Integration

IDE Integration 2

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago