Skip to content

Commit

Permalink
Merge pull request privacy-scaling-explorations#887 from privacy-scal…
Browse files Browse the repository at this point in the history
…ing-explorations/chore/linter-integration-tests

chore(intergationTests): apply linter for integration tests package
  • Loading branch information
0xmad authored Dec 7, 2023
2 parents 8bbf93d + ef75ec3 commit 4c4443d
Show file tree
Hide file tree
Showing 13 changed files with 5,320 additions and 1,167 deletions.
2 changes: 2 additions & 0 deletions core/ts/Poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,9 +1059,11 @@ class Poll implements IPoll {
copied.commands = this.commands.map((x) => x.copy());
copied.ballots = this.ballots.map((x) => x.copy());
copied.encPubKeys = this.encPubKeys.map((x) => x.copy());

if (this.ballotTree) {
copied.ballotTree = this.ballotTree.copy();
}

copied.currentMessageBatchIndex = this.currentMessageBatchIndex;
copied.maciStateRef = this.maciStateRef;
copied.messageTree = this.messageTree.copy();
Expand Down
107 changes: 107 additions & 0 deletions integrationTests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
const fs = require("fs");
const path = require("path");

const prettierConfig = fs.readFileSync(path.resolve(__dirname, "../.prettierrc"), "utf8");
const prettierOptions = JSON.parse(prettierConfig);
const isProduction = process.env.NODE_ENV === "production";

module.exports = {
root: true,
extends: [
"airbnb",
"prettier",
"plugin:import/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/typescript",
],
plugins: ["json", "prettier", "unused-imports", "import", "@typescript-eslint"],
parser: "@typescript-eslint/parser",
env: {
node: true,
mocha: true,
es2022: true,
},
settings: {
react: {
version: "999.999.999",
},
"import/resolver": {
typescript: {},
node: {
extensions: [".ts", ".js"],
moduleDirectory: ["node_modules", "ts", "src"],
},
},
},
parserOptions: {
project: path.resolve(__dirname, "./tsconfig.json"),
sourceType: "module",
typescript: true,
ecmaVersion: 2022,
experimentalDecorators: true,
requireConfigFile: false,
ecmaFeatures: {
classes: true,
impliedStrict: true,
},
warnOnUnsupportedTypeScriptVersion: true,
},
reportUnusedDisableDirectives: isProduction,
rules: {
"import/no-cycle": ["error"],
"unused-imports/no-unused-imports": "error",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["**/*.test.ts"],
},
],
"no-debugger": isProduction ? "error" : "off",
"no-console": "error",
"no-underscore-dangle": "error",
"no-redeclare": ["error", { builtinGlobals: true }],
"import/order": [
"error",
{
groups: ["external", "builtin", "internal", "type", "parent", "sibling", "index", "object"],
alphabetize: {
order: "asc",
caseInsensitive: true,
},
warnOnUnassignedImports: true,
"newlines-between": "always",
},
],
"prettier/prettier": ["error", prettierOptions],
"import/prefer-default-export": "off",
"import/extensions": ["error", { json: "always" }],
"class-methods-use-this": "off",
"prefer-promise-reject-errors": "off",
"max-classes-per-file": "off",
"no-use-before-define": ["off"],
"no-shadow": "off",
curly: ["error", "all"],

"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-use-before-define": ["error", { functions: false, classes: false }],
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }],
"@typescript-eslint/no-shadow": [
"error",
{
builtinGlobals: true,
allow: ["location", "event", "history", "name", "status", "Option", "test", "expect"],
},
],
},
};
3 changes: 2 additions & 1 deletion integrationTests/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { HardhatUserConfig } from "hardhat/types";
import "@nomicfoundation/hardhat-toolbox";

import type { HardhatUserConfig } from "hardhat/types";

const WALLET_MNEMONIC = "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat";
const GAS_LIMIT = 30000000;

Expand Down
Loading

0 comments on commit 4c4443d

Please sign in to comment.