diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 87a4f88..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "extends": "eslint:recommended", - "overrides": [ - ], - "parserOptions": { - "sourceType": "module", - "ecmaVersion": "latest" - }, - "rules": { - "indent": [ - "error", - 4 - ], - "linebreak-style": [ - "error", - "unix" - ], - "quotes": [ - "error", - "double" - ], - "semi": [ - "error", - "always" - ], - "no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_", - "caughtErrorsIgnorePattern": "^_" - } - ] - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..1359ebb --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,34 @@ +import js from "@eslint/js"; +import globals from "globals"; + +export default [ + js.configs.recommended, + { + files: [ + "**/*.js", + "**/*.ts", + "**/*.cjs", + "**/*.mjs", + ], + languageOptions: { + sourceType: "module", + ecmaVersion: 2024, + globals: { + ...globals.node, + ...globals.es2021, + ...globals.browser, + } + }, + rules: { + "semi": ["error", "always"], + "indent": ["error", 4], + "quotes": ["error", "double"], + "linebreak-style": ["error", "unix"], + "no-unused-vars": ["error" , { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + }], + } + }, +]; diff --git a/package.json b/package.json index 2522a95..72821a8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "type": "module", "scripts": { "lint": "npm-run-all --parallel lint:*", - "lint:js": "eslint routes/* util/*", + "lint:js": "eslint .", "lint:css": "stylelint stylelint public/css/*.css", "lint:md": "markdownlint *.md", "minify": "npm-run-all --parallel minify:*",