Skip to content

Commit

Permalink
chore: merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kittybest committed Jan 10, 2024
2 parents b6c9701 + 8cb022e commit 1db9d5b
Show file tree
Hide file tree
Showing 208 changed files with 41,496 additions and 19,932 deletions.
115 changes: 99 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +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 = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
root: true,
extends: [
"eslint:recommended",
"airbnb",
"prettier",
"plugin:import/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"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: {
"no-console": "off",
"no-debugger": "off",
"no-prototype-builtins": "off",
"no-constant-condition": ["error", { checkLoops: false }],
"no-empty": ["error", { allowEmptyCatch: true }],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"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"],
},
],
},
};
16 changes: 16 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# More details are here: https://help.github.com/articles/about-codeowners/

# The '*' pattern is global owners.

# Order is important. The last matching pattern has the most precedence.
# The folders are ordered as follows:

# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.

# Global:

* @ctrlc03 @kittybest @0xmad @samajammin
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "dev"
schedule:
interval: "weekly"

- package-ecosystem: "npm"
directory: "/"
versioning-strategy: increase
open-pull-requests-limit: 5
target-branch: "dev"
schedule:
interval: "weekly"
14 changes: 7 additions & 7 deletions .github/scripts/ceremony-param-tests-c-witness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js setVerifyingKeys
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js create -s 6 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployPoll \
-pk macipk.4d9929621583dd9b8cac251fdc7bf58050330f37e1f407b327e711d5e32ba3a9 \
-pk macipk.ea638a3366ed91f2e955110888573861f7c0fc0bb5fb8b8dca9cd7a08d7d6b93 \
--duration 30 \
--max-messages 390625 \
--max-vote-options 125 \
Expand All @@ -27,20 +27,20 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js deployPoll \
--vote-option-tree-depth 3 \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js signup \
--pubkey macipk.5e304c40fbf7f84fe09b8a21b6d0454a9606fca1d34977e0b68b8e5fe1c9460a \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
--pubkey macipk.5e304c40fbf7f84fe09b8a21b6d0454a9606fca1d34977e0b68b8e5fe1c9460a \
--privkey macisk.251a97d4d2ffde8673102572e530d0293afdc3394e2db8fd5b3029ec00c7c739 \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
--privkey macisk.0ab0281365e01cff60afc62310daec765e590487bf989a7c4986ebc3fd49895e \
--state-index 1 \
--vote-option-index 0 \
--new-vote-weight 9 \
--nonce 1 \
--poll-id 0 \
-q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js publish \
--pubkey macipk.5e304c40fbf7f84fe09b8a21b6d0454a9606fca1d34977e0b68b8e5fe1c9460a \
--privkey macisk.251a97d4d2ffde8673102572e530d0293afdc3394e2db8fd5b3029ec00c7c739 \
--pubkey macipk.e743ffb5298ef0f5c1f63b6464a48fea19ea7ee5a885c67ae1b24a1d04f03f07 \
--privkey macisk.0ab0281365e01cff60afc62310daec765e590487bf989a7c4986ebc3fd49895e \
--state-index 1 \
--vote-option-index 1 \
--new-vote-weight 9 \
Expand All @@ -51,7 +51,7 @@ HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js timeTravel -s 10
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeSignups --poll-id 0 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js mergeMessages --poll-id 0 -q true
HARDHAT_CONFIG=./build/hardhat.config.js node build/ts/index.js genProofs \
--privkey macisk.02115a4e210f81195aec6e6e9375bd1028f89dd873e6ee62bc5af298e13fd2e7 \
--privkey macisk.1751146b59d32e3c0d7426de411218172428263f93b2fc4d981c036047a4d8c0 \
--poll-id 0 \
--rapidsnark ~/rapidsnark/build/prover \
--process-zkey ./zkeys/processMessages_6-8-2-3.zkey \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
command: ["prettier", "lint:ts"]
command: ["prettier", "types", "lint:ts", "lint:sol"]

runs-on: ubuntu-22.04

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ jobs:
run: npm run ${{ matrix.command }}

- name: Stop Hardhat
if: always()
run: kill $(lsof -t -i:8545)
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
npx lint-staged && npm run types
1 change: 1 addition & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"**/*.{ts,js}": ["prettier --ignore-unknown --write", "eslint --fix"],
"**/*.sol": ["prettier --ignore-unknown --write", "solhint --fix --noPrompt"],
"*": ["prettier --ignore-unknown --write"]
}
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"avoid-suicide": "error",
"avoid-sha3": "warn",
"max-line-length": ["warn", 120],
"quotes": ["error", "single"],
"quotes": ["error", "double"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"state-visibility": "error"
}
Expand Down
89 changes: 1 addition & 88 deletions circuits/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
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"],
extends: ["../.eslintrc.js"],
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",
Expand All @@ -52,56 +17,4 @@ module.exports = {
},
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"],
},
],
},
};
Loading

0 comments on commit 1db9d5b

Please sign in to comment.