Skip to content

Commit

Permalink
💄 Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Jan 14, 2025
1 parent f8289d8 commit 41a42a0
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 51 deletions.
38 changes: 19 additions & 19 deletions packages/sdk/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
env: {
node: true,
jest: true,
},
rules: {
// Allow empty interfaces
'@typescript-eslint/no-empty-interface': 'off',
"@typescript-eslint/no-empty-interface": "off",

// Allow any type where necessary
'@typescript-eslint/no-explicit-any': 'off',
"@typescript-eslint/no-explicit-any": "off",

// Warn about unused variables instead of error
'@typescript-eslint/no-unused-vars': ['warn', {
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true
}],

"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],

// Allow empty object type
'@typescript-eslint/no-empty-object-type': 'off'
"@typescript-eslint/no-empty-object-type": "off",
},
ignorePatterns: ['dist/*', 'node_modules/*']
};
ignorePatterns: ["dist/*", "node_modules/*"],
};
2 changes: 1 addition & 1 deletion packages/sdk/src/classes/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export class Metadata {
return new Metadata("", "", "", "", "");
}
}
}
}
2 changes: 1 addition & 1 deletion packages/sdk/src/classes/socials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export class Socials {
return new Socials("", "", "", "", "");
}
}
}
}
2 changes: 1 addition & 1 deletion packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export * from "./provider";
export * from "./bindings";
export * from "./manifests";
export * from "./modules";
export * from "./classes";
export * from "./classes";
3 changes: 1 addition & 2 deletions packages/sdk/src/modules/registry/achievement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,5 @@ export const Achievement = {
{ name: "whitelist_achievement", entrypoint: "whitelist_achievement", description: "Whitelist an achievement." },
{ name: "blacklist_achievement", entrypoint: "blacklist_achievement", description: "Blacklist an achievement." },
{ name: "remove_achievement", entrypoint: "remove_achievement", description: "Remove an achievement." },
]
],
};

2 changes: 1 addition & 1 deletion packages/sdk/src/modules/registry/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,5 @@ export const Game = {
{ name: "whitelist_game", entrypoint: "whitelist_game", description: "Whitelist a game." },
{ name: "blacklist_game", entrypoint: "blacklist_game", description: "Blacklist a game." },
{ name: "remove_game", entrypoint: "remove_game", description: "Remove a game." },
]
],
};
3 changes: 1 addition & 2 deletions packages/sdk/src/modules/social/alliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,5 @@ export const Alliance = {
{ name: "request_alliance", entrypoint: "request_alliance", description: "Request to join an alliance." },
{ name: "cancel_alliance", entrypoint: "cancel_alliance", description: "Cancel a request to join an alliance." },
{ name: "leave_alliance", entrypoint: "leave_alliance", description: "Leave an alliance." },
]
],
};

2 changes: 1 addition & 1 deletion packages/sdk/src/modules/social/follow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ export const Follow = {
methods: () => [
{ name: "follow", entrypoint: "follow", description: "Follow another player." },
{ name: "unfollow", entrypoint: "unfollow", description: "Unfollow a player." },
]
],
};
3 changes: 1 addition & 2 deletions packages/sdk/src/modules/social/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,5 @@ export const Guild = {
{ name: "demote_member", entrypoint: "demote_member", description: "Demote an officer to member." },
{ name: "hire_member", entrypoint: "hire_member", description: "Hire a member to the guild." },
{ name: "fire_member", entrypoint: "fire_member", description: "Fire a member from the guild." },
]
],
};

8 changes: 7 additions & 1 deletion packages/sdk/src/modules/social/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ export const Social = {
[Social.address]: {
name: "Social",
description: "Social contract to manage your social activities",
methods: [...Pin.methods(), ...Follow.methods(), ...Member.methods(), ...Guild.methods(), ...Alliance.methods()],
methods: [
...Pin.methods(),
...Follow.methods(),
...Member.methods(),
...Guild.methods(),
...Alliance.methods(),
],
},
},
};
Expand Down
3 changes: 1 addition & 2 deletions packages/sdk/src/modules/social/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,5 @@ export const Member = {
};
},

methods: () => []
methods: () => [],
};

2 changes: 1 addition & 1 deletion packages/sdk/src/modules/social/pin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ export const Pin = {
methods: () => [
{ name: "pin", entrypoint: "pin", description: "Pin an achievement." },
{ name: "unpin", entrypoint: "unpin", description: "Unpin an achievement." },
]
],
};
20 changes: 16 additions & 4 deletions packages/sdk/src/policies/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ export const policies = {
{ name: "update_achievement", entrypoint: "update_achievement", description: "Update an achievement." },
{ name: "publish_achievement", entrypoint: "publish_achievement", description: "Publish an achievement." },
{ name: "hide_achievement", entrypoint: "hide_achievement", description: "Hide an achievement." },
{ name: "whitelist_achievement", entrypoint: "whitelist_achievement", description: "Whitelist an achievement." },
{ name: "blacklist_achievement", entrypoint: "blacklist_achievement", description: "Blacklist an achievement." },
{
name: "whitelist_achievement",
entrypoint: "whitelist_achievement",
description: "Whitelist an achievement.",
},
{
name: "blacklist_achievement",
entrypoint: "blacklist_achievement",
description: "Blacklist an achievement.",
},
{ name: "remove_achievement", entrypoint: "remove_achievement", description: "Remove an achievement." },
],
},
Expand All @@ -48,7 +56,11 @@ export const policies = {
{ name: "hire_guild", entrypoint: "hire_guild", description: "Hire a guild in the alliance." },
{ name: "fire_guild", entrypoint: "fire_guild", description: "Fire a guild from the alliance." },
{ name: "request_alliance", entrypoint: "request_alliance", description: "Request to join an alliance." },
{ name: "cancel_alliance", entrypoint: "cancel_alliance", description: "Cancel a request to join an alliance." },
{
name: "cancel_alliance",
entrypoint: "cancel_alliance",
description: "Cancel a request to join an alliance.",
},
{ name: "leave_alliance", entrypoint: "leave_alliance", description: "Leave an alliance." },
{ name: "create_guild", entrypoint: "create_guild", description: "Create a guild." },
{ name: "open_guild", entrypoint: "open_guild", description: "Open a guild." },
Expand All @@ -70,4 +82,4 @@ export const policies = {
[constants.StarknetChainId.SN_MAIN]: {
contracts: {},
},
};
};
16 changes: 3 additions & 13 deletions packages/sdk/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"test/**/*.ts",
"test/**/*.tsx",
"*.js",
"*.ts"
],
"exclude": [
"node_modules",
"dist"
],
"include": ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts", "test/**/*.tsx", "*.js", "*.ts"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"noEmit": true,
"resolveJsonModule": true
}
}
}

0 comments on commit 41a42a0

Please sign in to comment.