commit: bb2de0f56789f19be92dda03c458d9573832b092
parent da48e1ecbff14a7337fb09f9d8c9e77c7b986aa2
Author: Henry Jameson <me@hjkos.com>
Date: Tue, 4 Feb 2025 14:13:26 +0200
migrate to eslint 9
Diffstat:
5 files changed, 45 insertions(+), 31 deletions(-)
diff --git a/.eslintignore b/.eslintignore
@@ -1,2 +0,0 @@
-build/*.js
-config/*.js
diff --git a/.eslintrc.js b/.eslintrc.js
@@ -1,27 +0,0 @@
-module.exports = {
- root: true,
- parserOptions: {
- parser: '@babel/eslint-parser',
- sourceType: 'module'
- },
- // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
- extends: [
- 'standard',
- 'plugin:vue/recommended'
- ],
- // required to lint *.vue files
- plugins: [
- 'vue'
- ],
- // add your custom rules here
- rules: {
- // allow paren-less arrow functions
- 'arrow-parens': 0,
- // allow async-await
- 'generator-star-spacing': 0,
- // allow debugger during development
- 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
- 'vue/require-prop-types': 0,
- 'vue/multi-word-component-names': 0
- }
-}
diff --git a/eslint.config.mjs b/eslint.config.mjs
@@ -0,0 +1,37 @@
+import vue from "eslint-plugin-vue";
+import js from "@eslint/js";
+import globals from "globals";
+
+
+export default [
+ ...vue.configs['flat/recommended'],
+ js.configs.recommended,
+ {
+ files: ["**/*.js", "**/*.mjs", "**/*.vue"],
+ ignores: ["build/*.js", "config/*.js"],
+
+ languageOptions: {
+ ecmaVersion: 2024,
+ sourceType: "module",
+
+ parserOptions: {
+ parser: "@babel/eslint-parser",
+ },
+ globals: {
+ ...globals.browser,
+ ...globals.mocha,
+ ...globals.chai,
+ ...globals.commonjs,
+ ...globals.serviceworker
+ }
+ },
+
+ rules: {
+ 'arrow-parens': 0,
+ 'generator-star-spacing': 0,
+ 'no-debugger': 0,
+ 'vue/require-prop-types': 0,
+ 'vue/multi-word-component-names': 0,
+ }
+ }
+]
diff --git a/package.json b/package.json
@@ -12,8 +12,8 @@
"e2e": "node test/e2e/runner.js",
"test": "yarn run unit && yarn run e2e",
"stylelint": "yarn exec stylelint '**/*.scss' '**/*.vue'",
- "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
- "lint-fix": "eslint --fix --ext .js,.vue src test/unit/specs test/e2e/specs"
+ "lint": "eslint src test/unit/specs test/e2e/specs",
+ "lint-fix": "eslint --fix src test/unit/specs test/e2e/specs"
},
"dependencies": {
"@babel/runtime": "7.26.7",
@@ -32,6 +32,7 @@
"click-outside-vue3": "4.0.1",
"cropperjs": "1.6.2",
"escape-html": "1.0.3",
+ "globals": "^15.14.0",
"hash-sum": "^2.0.0",
"js-cookie": "3.0.5",
"localforage": "1.10.0",
diff --git a/yarn.lock b/yarn.lock
@@ -4337,6 +4337,11 @@ globals@^14.0.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==
+globals@^15.14.0:
+ version "15.14.0"
+ resolved "https://registry.yarnpkg.com/globals/-/globals-15.14.0.tgz#b8fd3a8941ff3b4d38f3319d433b61bbb482e73f"
+ integrity sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==
+
globalthis@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236"