Skip to content

Commit f42bc16

Browse files
committed
Build: Update deps, switch to the ESLint flat config
1 parent 2910945 commit f42bc16

7 files changed

+1055
-2399
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc.json

-9
This file was deleted.

Gruntfile.js

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = function (grunt) {
1515
eslint: {
1616
all: {
1717
src: [
18+
'*.mjs',
1819
'*.js',
1920
'src/*.js',
2021
],

eslint.config.mjs

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import globals from "globals";
2+
import eslintConfigMgol from "eslint-config-mgol";
3+
4+
export default [
5+
...eslintConfigMgol,
6+
{
7+
ignores: [
8+
"node_modules/**",
9+
"dist/**",
10+
],
11+
},
12+
{
13+
files: [ "*.js" ],
14+
languageOptions: {
15+
sourceType: "script",
16+
globals: {
17+
...globals.node,
18+
},
19+
},
20+
rules: {
21+
// Strict mode
22+
"strict": ["error", "global"], // "global" in Node, "function" in a browser
23+
},
24+
},
25+
{
26+
files: [ "*.mjs" ],
27+
languageOptions: {
28+
sourceType: "module",
29+
globals: {
30+
...globals.node,
31+
},
32+
},
33+
},
34+
{
35+
files: [ "src/**/*.js" ],
36+
languageOptions: {
37+
ecmaVersion: 5,
38+
sourceType: "script",
39+
globals: {
40+
...globals.browser,
41+
jQuery: false,
42+
},
43+
},
44+
rules: {
45+
// Strict mode
46+
"strict": ["error", "function"], // "global" in Node, "function" in a browser
47+
48+
// Stylistic issues
49+
"comma-dangle": ["error", {
50+
"arrays": "always-multiline",
51+
"objects": "always-multiline",
52+
"imports": "always-multiline",
53+
"exports": "always-multiline"
54+
}],
55+
"id-blacklist": ["error", "event"],
56+
57+
// ECMAScript 6
58+
"no-var": "off",
59+
"object-shorthand": "off",
60+
"prefer-arrow-callback": "off",
61+
"prefer-const": "off",
62+
"prefer-rest-params": "off",
63+
"prefer-spread": "off",
64+
"prefer-template": "off",
65+
'id-denylist': ['error', 'event'],
66+
},
67+
},
68+
];

0 commit comments

Comments
 (0)