mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-11-24 06:25:46 +00:00
fix: port eslint config
This commit is contained in:
parent
3c0ed48aac
commit
60a6ad92d9
File diff suppressed because it is too large
Load Diff
46
eslint.config.js
Normal file
46
eslint.config.js
Normal file
@ -0,0 +1,46 @@
|
||||
const {
|
||||
defineConfig,
|
||||
} = require("eslint/config");
|
||||
|
||||
const globals = require("globals");
|
||||
const tsParser = require("@typescript-eslint/parser");
|
||||
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
|
||||
const js = require("@eslint/js");
|
||||
|
||||
const {
|
||||
FlatCompat,
|
||||
} = require("@eslint/eslintrc");
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
module.exports = defineConfig([{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
},
|
||||
|
||||
parser: tsParser,
|
||||
ecmaVersion: 12,
|
||||
sourceType: "module",
|
||||
parserOptions: {},
|
||||
},
|
||||
|
||||
extends: compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended"),
|
||||
|
||||
plugins: {
|
||||
"@typescript-eslint": typescriptEslint,
|
||||
},
|
||||
|
||||
rules: {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
indent: ["error", 2],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
quotes: ["error", "double"],
|
||||
semi: ["error", "always"],
|
||||
},
|
||||
}]);
|
||||
38
package-lock.json
generated
38
package-lock.json
generated
@ -14,6 +14,8 @@
|
||||
"@mcaptcha/vanilla-glue": "^0.1.0-rc1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/jsdom": "^27.0.0",
|
||||
"@types/node": "^22.0.0",
|
||||
@ -24,6 +26,7 @@
|
||||
"css-loader": "^7.0.0",
|
||||
"css-minimizer-webpack-plugin": "^7.0.0",
|
||||
"eslint": "^9.0.0",
|
||||
"globals": "^16.4.0",
|
||||
"jest": "^30.0.0",
|
||||
"jest-environment-jsdom": "^30.0.0",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
@ -907,7 +910,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz",
|
||||
"integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
@ -926,12 +928,23 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc/node_modules/globals": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
|
||||
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "9.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.36.0.tgz",
|
||||
"integrity": "sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
@ -8317,11 +8330,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
|
||||
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
||||
"version": "16.4.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz",
|
||||
"integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@ -17831,6 +17843,14 @@
|
||||
"js-yaml": "^4.1.0",
|
||||
"minimatch": "^3.1.2",
|
||||
"strip-json-comments": "^3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"globals": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
|
||||
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@eslint/js": {
|
||||
@ -22801,9 +22821,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"globals": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
|
||||
"integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
|
||||
"version": "16.4.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz",
|
||||
"integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==",
|
||||
"dev": true
|
||||
},
|
||||
"gopd": {
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/jsdom": "^27.0.0",
|
||||
"@types/node": "^22.0.0",
|
||||
@ -20,6 +22,7 @@
|
||||
"css-loader": "^7.0.0",
|
||||
"css-minimizer-webpack-plugin": "^7.0.0",
|
||||
"eslint": "^9.0.0",
|
||||
"globals": "^16.4.0",
|
||||
"jest": "^30.0.0",
|
||||
"jest-environment-jsdom": "^30.0.0",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
@ -38,7 +41,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@mcaptcha/pow_sha256-polyfill": "^0.1.0-rc2",
|
||||
"@mcaptcha/vanilla-glue": "^0.1.0-rc1",
|
||||
"@mcaptcha/pow-wasm": "^0.1.0-rc2"
|
||||
"@mcaptcha/pow-wasm": "^0.1.0-rc2",
|
||||
"@mcaptcha/vanilla-glue": "^0.1.0-rc1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"use strict";
|
||||
|
||||
import createError from "./index";
|
||||
import * as e from "./index";
|
||||
|
||||
import setup from "./setUpTests";
|
||||
|
||||
"use strict";
|
||||
|
||||
jest.useFakeTimers();
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"use strict";
|
||||
|
||||
import {Router} from "./router";
|
||||
|
||||
"use strict";
|
||||
|
||||
const result = {
|
||||
result: "",
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"use strict";
|
||||
|
||||
import genJsonPayload from "./genJsonPayload";
|
||||
|
||||
"use strict";
|
||||
|
||||
const payload = {
|
||||
username: "Jhon",
|
||||
|
||||
@ -2,12 +2,11 @@
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"use strict";
|
||||
|
||||
import getFormUrl from "./getFormUrl";
|
||||
import {getLoginFormHtml} from "../setUpTests";
|
||||
|
||||
"use strict";
|
||||
|
||||
const formClassName = "form__box";
|
||||
const formURL = "/api/v1/signin";
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"use strict";
|
||||
|
||||
import isBlankString from "./isBlankString";
|
||||
import {mockAlert} from "../setUpTests";
|
||||
@ -9,7 +10,6 @@ import {mockAlert} from "../setUpTests";
|
||||
|
||||
import setup from "../components/error/setUpTests";
|
||||
|
||||
"use strict";
|
||||
|
||||
mockAlert();
|
||||
|
||||
|
||||
@ -2,11 +2,10 @@
|
||||
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
"use strict";
|
||||
|
||||
import isNumber from "./isNumber";
|
||||
|
||||
"use strict";
|
||||
|
||||
it("getFromUrl workds", () => {
|
||||
expect(isNumber("test")).toBe(false);
|
||||
expect(isNumber("1test213")).toBe(false);
|
||||
|
||||
@ -30,7 +30,7 @@ const prove = async (
|
||||
config.string,
|
||||
config.difficulty_factor,
|
||||
STEPS,
|
||||
(nonce: BigInt | number) => progress(Number(nonce))
|
||||
(nonce: bigint | number) => progress(Number(nonce))
|
||||
);
|
||||
const t1 = performance.now();
|
||||
time = t1 - t0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user