Skip to content

Commit

Permalink
Adjusted linting process
Browse files Browse the repository at this point in the history
* Define globals in .eslintrc.js rather than in each script (only
  includes already used globals for now, but should include all globals
  available in Tiled).

* Disable the quotes lint, since it's not clear why one style should be
  enforced.
  • Loading branch information
bjorn committed Mar 15, 2024
1 parent 9b0393f commit e7fb73f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 20 deletions.
13 changes: 9 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ module.exports = {
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
},
"globals": {
"File": "readonly",
"FileInfo": "readonly",
"MapObject": "readonly",
"TextFile": "readonly",
"TileLayer": "readonly",
"TileMap": "readonly",
"tiled": "readonly"
}
};
2 changes: 0 additions & 2 deletions find-layer-by-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* you know its ID.
*/

/* global tiled */

function findLayerById(thing, id) {
for (let i = thing.layerCount - 1; i >= 0; i--) {
const layer = thing.layerAt(i);
Expand Down
2 changes: 0 additions & 2 deletions find-object-by-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* function to work properly for isometric maps.
*/

/* global tiled */

function findObjectById(thing, id) {
for (let i = thing.layerCount - 1; i >= 0; i--) {
const layer = thing.layerAt(i);
Expand Down
2 changes: 0 additions & 2 deletions follow-warp.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
* with some adjustments it probably could!
*/

/* global tiled */

/**
* @param thing {TileMap | GroupLayer}
* @param name {string}
Expand Down
2 changes: 0 additions & 2 deletions rectangle-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* the map.
*/

/* global tiled, MapObject */

tiled.registerTool("RectangleChain", {
name: "Draw Rectangle Chain",
icon: "rectangle-chain.svg",
Expand Down
2 changes: 0 additions & 2 deletions remove-unused-tilesets.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
* automatically on save.
*/

/* global tiled */

/**
* @param {TileMap} map
*/
Expand Down
2 changes: 0 additions & 2 deletions shortcuts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
* the Preferences dialog.
*/

/* global tiled */

/**
* @param {Tileset} tileset
*/
Expand Down
2 changes: 0 additions & 2 deletions tile-rectangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* brush is repeated in all directions.
*/

/* global tiled, TileLayer, TileMap */

tiled.registerTool("PaintTileRectangle", {
name: "Paint Tile Rectangle",
icon: "tile-rectangle.svg",
Expand Down
2 changes: 0 additions & 2 deletions videogame-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* method from the videogame library (https://github.com/diogoeichert/videogame)
*/

/* global tiled, FileInfo, TextFile */

tiled.registerMapFormat("videogame", {
name: "videogame map format",
extension: "json",
Expand Down

0 comments on commit e7fb73f

Please sign in to comment.