Skip to content

Commit

Permalink
Updated eslint, Jimp, and other dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
n1474335 committed Jun 11, 2024
1 parent 7eb887c commit 2b275f0
Show file tree
Hide file tree
Showing 35 changed files with 2,952 additions and 1,939 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

116 changes: 0 additions & 116 deletions .eslintrc.json

This file was deleted.

12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,18 @@ module.exports = function (grunt) {
}
},
stdout: false
},
fixJimpModule: {
command: function () {
switch (process.platform) {
case "darwin":
// Space added before comma to prevent multiple modifications
return `sed -i '' 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`;
default:
return `sed -i 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`;
}
},
stdout: false
}
},
});
Expand Down
129 changes: 129 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
import babelParser from "@babel/eslint-parser";
import jsdoc from "eslint-plugin-jsdoc";
import js from "@eslint/js";
import globals from "globals";

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2022,
parser: babelParser,
parserOptions: {
ecmaVersion: 2022,
ecmaFeatures: {
impliedStrict: true
},
sourceType: "module",
allowImportExportEverywhere: true
},
globals: {
...globals.browser,
...globals.node,
...globals.es6,
"$": false,
"jQuery": false,
"log": false,
"app": false,

"COMPILE_TIME": false,
"COMPILE_MSG": false,
"PKG_VERSION": false
},
},
ignores: ["src/core/vendor/**"],
plugins: {
jsdoc
},
rules: {
// enable additional rules
"no-eval": "error",
"no-implied-eval": "error",
"dot-notation": "error",
"eqeqeq": ["error", "smart"],
"no-caller": "error",
"no-extra-bind": "error",
"no-unused-expressions": "error",
"no-useless-call": "error",
"no-useless-return": "error",
"radix": "warn",

// modify rules from base configurations
"no-unused-vars": ["error", {
"args": "none",
"vars": "all",
"caughtErrors": "none"
}],
"no-empty": ["error", {
"allowEmptyCatch": true
}],

// disable rules from base configurations
"no-control-regex": "off",
"require-atomic-updates": "off",
"no-async-promise-executor": "off",

// stylistic conventions
"brace-style": ["error", "1tbs"],
"space-before-blocks": ["error", "always"],
"block-spacing": "error",
"array-bracket-spacing": "error",
"comma-spacing": "error",
"spaced-comment": ["error", "always", { "exceptions": ["/"] }],
"comma-style": "error",
"computed-property-spacing": "error",
"no-trailing-spaces": "warn",
"eol-last": "error",
"func-call-spacing": "error",
"key-spacing": ["warn", {
"mode": "minimum"
}],
"indent": ["error", 4, {
"ignoreComments": true,
"ArrayExpression": "first",
"SwitchCase": 1
}],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double", {
"avoidEscape": true,
"allowTemplateLiterals": true
}],
"camelcase": ["error", {
"properties": "always"
}],
"semi": ["error", "always"],
"unicode-bom": "error",
"jsdoc/require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": false
}
}],
"keyword-spacing": ["error", {
"before": true,
"after": true
}],
"no-multiple-empty-lines": ["warn", {
"max": 2,
"maxEOF": 1,
"maxBOF": 0
}],
"no-whitespace-before-property": "error",
"operator-linebreak": ["error", "after"],
"space-in-parens": "error",
"no-var": "error",
"prefer-const": "error",
"no-console": "error"
},
},
// File-pattern specific overrides
{
files: ["tests/**/*"],
rules: {
"no-unused-expressions": "off",
"no-console": "off"
}
},
];
Loading

0 comments on commit 2b275f0

Please sign in to comment.