Skip to content

Commit

Permalink
Build: Update deps, switch to the ESLint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
mgol committed Jun 14, 2024
1 parent 2910945 commit f42bc16
Show file tree
Hide file tree
Showing 7 changed files with 1,055 additions and 2,399 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

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

This file was deleted.

1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function (grunt) {
eslint: {
all: {
src: [
'*.mjs',
'*.js',
'src/*.js',
],
Expand Down
68 changes: 68 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import globals from "globals";
import eslintConfigMgol from "eslint-config-mgol";

export default [
...eslintConfigMgol,
{
ignores: [
"node_modules/**",
"dist/**",
],
},
{
files: [ "*.js" ],
languageOptions: {
sourceType: "script",
globals: {
...globals.node,
},
},
rules: {
// Strict mode
"strict": ["error", "global"], // "global" in Node, "function" in a browser
},
},
{
files: [ "*.mjs" ],
languageOptions: {
sourceType: "module",
globals: {
...globals.node,
},
},
},
{
files: [ "src/**/*.js" ],
languageOptions: {
ecmaVersion: 5,
sourceType: "script",
globals: {
...globals.browser,
jQuery: false,
},
},
rules: {
// Strict mode
"strict": ["error", "function"], // "global" in Node, "function" in a browser

// Stylistic issues
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline"
}],
"id-blacklist": ["error", "event"],

// ECMAScript 6
"no-var": "off",
"object-shorthand": "off",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
'id-denylist': ['error', 'event'],
},
},
];
Loading

0 comments on commit f42bc16

Please sign in to comment.