diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 7b40364..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = { - "env": { - "browser": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 5 - }, - "rules": { - "no-console" : "off", - "no-empty" : ["warn", { "allowEmptyCatch": true }] - }, - "overrides": [ - { - "files": ["test/*"], - "parserOptions": { - "ecmaVersion": 2017 - }, - "globals": { - "describe": "readonly", - "it": "readonly" - } - }, - { - "files": ["javascript/*"], - "globals": { - "define": "readonly" - }, - "rules": { - "no-prototype-builtins" : "off" - } - } - ] -}; \ No newline at end of file diff --git a/.npmignore b/.npmignore index a387b57..3841d55 100644 --- a/.npmignore +++ b/.npmignore @@ -5,6 +5,7 @@ web-midi-api test* coverage Gruntfile.js +eslint.config.mjs *.html *.bat !test diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..f37f309 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,38 @@ +import globals from "globals"; +import js from "@eslint/js"; + +export default [ + js.configs.recommended, + { + ignores: ["**/.instrumented/*"] + }, + { + files: ["javascript/*.js", "test/*.js"], + languageOptions: { + ecmaVersion: 2015, + globals: { + ...globals.browser, + ...globals.node, + define: "readonly", + JZZ: "readonly" + } + }, + rules: { + "no-empty" : ["error", { "allowEmptyCatch": true }], + "no-prototype-builtins": "off", + "no-unused-vars": ["error", { caughtErrors: "none"}] + } + }, + { + files: ["test/*.js"], + languageOptions: { + ecmaVersion: 2017, + globals: { + describe: "readonly", + it: "readonly", + before: "readonly", + after: "readonly" + } + } + } +]; \ No newline at end of file diff --git a/package.json b/package.json index 800a15e..9f27f98 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,17 @@ ], "author": "jazz-soft (https://jazz-soft.net/)", "dependencies": { - "@types/webmidi": "^2.0.10", + "@types/webmidi": "^2.1.0", "jazz-midi": "^1.7.9" }, "devDependencies": { - "eslint": "^9.2.0", + "eslint": "^9.5.0", "grunt": "^1.6.1", "grunt-contrib-jshint": "^3.2.0", "grunt-contrib-uglify": "^5.2.2", "midi-test": "^1.3.1", "mocha": "^10.4.0", - "nyc": "^15.1.0", + "nyc": "^17.0.0", "web-audio-test": "^0.0.8", "web-midi-test": "^1.2.8" },