diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..cfdeb70 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,28 @@ +import globals from 'globals'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends('eslint:recommended'), { + languageOptions: { + globals: { + ...globals.browser, + ...globals.commonjs, + ...globals.node + }, + + ecmaVersion: 8, + sourceType: 'module' + }, + + rules: {} +}]; diff --git a/package-lock.json b/package-lock.json index b4c9837..8058451 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,11 @@ "semistandard": "^17.0.0", "standard-engine": "^15.1.0" }, + "devDependencies": { + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.16.0", + "globals": "^15.13.0" + }, "engines": { "node": ">=18.20.5 || >=20.0.0 || >=22.0.0 || >=24.0.0" } @@ -1869,15 +1874,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "15.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", + "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", + "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4010,6 +4013,21 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/semistandard/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/semistandard/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/package.json b/package.json index ce583cc..db06b6c 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,9 @@ "eslint": "^9.16.0", "express": "^5.0.1", "express-rate-limit": "^7.4.1", + "jshint": "^2.13.6", "semistandard": "^17.0.0", - "standard-engine": "^15.1.0", - "jshint": "^2.13.6" + "standard-engine": "^15.1.0" }, "repository": { "url": "https://glitch.com/edit/#!/meowing-holy-carbon" @@ -37,5 +37,10 @@ "node > 14", "fully supports es6-module", "maintained node versions" - ] + ], + "devDependencies": { + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.16.0", + "globals": "^15.13.0" + } } diff --git a/server.js b/server.js index 3a80309..61bad84 100644 --- a/server.js +++ b/server.js @@ -8,7 +8,7 @@ const rateLimit = require('express-rate-limit'); const { JSHINT } = require('jshint'); const isGlitch = !!process.env.PROJECT_DOMAIN; -const projectDomain = process.env.PROJECT_DOMAIN || "localhost"; +const projectDomain = process.env.PROJECT_DOMAIN || 'localhost'; console.log(projectDomain); // run the same functions on the front & back diff --git a/yarn.lock b/yarn.lock index 7d91300..23a2e0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -58,16 +58,16 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@^9.16.0", "@eslint/js@9.16.0": + version "9.16.0" + resolved "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz" + integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg== + "@eslint/js@8.57.1": version "8.57.1" resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz" integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== -"@eslint/js@9.16.0": - version "9.16.0" - resolved "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz" - integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg== - "@eslint/object-schema@^2.1.4": version "2.1.4" resolved "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz" @@ -1293,6 +1293,11 @@ globals@^14.0.0: resolved "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz" integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== +globals@^15.13.0: + version "15.13.0" + resolved "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz" + integrity sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g== + globalthis@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz"