Skip to content

Commit

Permalink
#104: Update .eslintrc and bump sdk-as
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandeberg committed Aug 6, 2024
1 parent c979909 commit fac0dcc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 31 deletions.
54 changes: 27 additions & 27 deletions contracts/koin/.eslintrc.js → contracts/koin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
extends: [
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended"
],
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: {}
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {}
},

// === General rules =========================================================

rules: {
"rules": {
// Omitted semicolons are hugely popular, yet within the compiler it makes
// sense to be better safe than sorry.
"semi": "error",
Expand Down Expand Up @@ -56,7 +56,7 @@ module.exports = {

// Typical false-positives here are `do { ... } while (true)` statements or
// similar, but the only option provided here is not checking any loops.
"no-constant-condition": ["error", { checkLoops: false }],
"no-constant-condition": ["error", { "checkLoops": false }],

// Functions are nested in blocks occasionally, and there haven't been any
// problems with this so far, so turning the check off.
Expand All @@ -71,15 +71,15 @@ module.exports = {
// Disabled here, but enabled again for TypeScript files.
"@typescript-eslint/no-unused-vars": "off"
},
overrides: [
"overrides": [

// === TypeScript rules ====================================================

{
files: [
"files": [
"**/assembly/**/*.ts"
],
rules: {
"rules": {
// Enforcing to remove function parameters on stubs makes code less
// maintainable, so we instead allow unused function parameters.
"@typescript-eslint/no-unused-vars": [
Expand All @@ -101,17 +101,17 @@ module.exports = {
"@typescript-eslint/ban-ts-comment": "off",

// Utilized to achieve portability in some cases
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-non-null-assertion": "off"
}
},

// === Compiler rules (extends AssemblyScript rules) =======================

{
files: [
"files": [
"**/assembly/**/*.ts"
],
rules: {
"rules": {
// There is an actual codegen difference here - TODO: revisit
"no-cond-assign": "off",

Expand All @@ -130,10 +130,10 @@ module.exports = {
// === Standard Library rules (extends AssemblyScript rules) ===============

{
files: [
"files": [
"**/assembly/**/*.ts"
],
rules: {
"rules": {
// We are implementing with --noLib, so we shadow all the time
"no-shadow-restricted-names": "off",

Expand All @@ -145,10 +145,10 @@ module.exports = {
// === Standard Definition rules (extends TypeScript rules) ================

{
files: [
"files": [
"**/assembly/**/*.d.ts"
],
rules: {
"rules": {
// Often required to achieve compatibility with TypeScript
"@typescript-eslint/no-explicit-any": "off",

Expand All @@ -165,10 +165,10 @@ module.exports = {
// === Test rules (extends TypeScript rules) ===============================

{
files: [
"files": [
"**/assembly/__tests__/**/*.ts"
],
rules: {
"rules": {
// Tests typically include unusual code patterns on purpose. This is
// very likely not an extensive list, but covers what's there so far.
"no-empty": "off",
Expand All @@ -189,6 +189,6 @@ module.exports = {
"@typescript-eslint/no-extra-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "off"
}
},
}
]
};
}
4 changes: 3 additions & 1 deletion contracts/koin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"license": "MIT",
"type": "module",
"devDependencies": {
"@koinos/sdk-as": "https://github.com/koinos/koinos-sdk-as#nameservice",
"@types/jest": "^27.5.1",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
Expand All @@ -25,5 +24,8 @@
"local-koinos-auto": "local-koinos start -i 5000",
"local-koinos:start": "local-koinos start",
"local-koinos:stop": "local-koinos stop"
},
"dependencies": {
"@koinos/sdk-as": "https://github.com/koinos/koinos-sdk-as#nameservice"
}
}
15 changes: 12 additions & 3 deletions contracts/koin/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@
typescript "^4.6.4"

"@koinos/mock-vm@https://github.com/koinos/koinos-mock-vm#22-nameservice":
version "1.1.0"
resolved "https://github.com/koinos/koinos-mock-vm#c5330cd1bbecac864ebca911b0ebf6345301327f"
version "1.2.0"
resolved "https://github.com/koinos/koinos-mock-vm#15fb4e655ccbe051a9383d4c8aa84618299c2ea0"
dependencies:
"@koinos/proto-js" "2.1.0"
"@noble/hashes" "^1.0.0"
Expand All @@ -791,9 +791,17 @@
resolved "https://registry.yarnpkg.com/@koinos/proto-js/-/proto-js-2.1.0.tgz#38fdbd01519ad1706b5f7edcf697a6ebbbd3db76"
integrity sha512-mp2JmNhp7db6TixVqXF4VrhCW6lRXf6JCojY3c6jyByPyysQgAVJLLx2sUZlPzeUdP6Bnqt23485FMIo46TQ9g==

"@koinos/sdk-as-cli@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@koinos/sdk-as-cli/-/sdk-as-cli-1.0.2.tgz#83fe031dca9a446254096fada278d3f523204c0c"
integrity sha512-ggbPz/LXozvb54G0dVZ9VkgPPmjKlwCI8LamSJXA+MZ8KOggfr2lgKMHT3AcMd0CtmmRN0JzHSM+cgk8sNYltg==
dependencies:
chalk "4.1.2"
commander "^9.0.0"

"@koinos/sdk-as@https://github.com/koinos/koinos-sdk-as#nameservice":
version "1.2.0"
resolved "https://github.com/koinos/koinos-sdk-as#9ac999419b5e36a6fca2ab3f7413fcea78718ca6"
resolved "https://github.com/koinos/koinos-sdk-as#451da2927ae66eabac3ee5ca6ccd62d7681807ea"
dependencies:
"@as-covers/core" "^0.4.2"
"@as-pect/cli" "^8.0.1"
Expand All @@ -802,6 +810,7 @@
"@koinos/as-proto-gen" "1.0.0"
"@koinos/mock-vm" "https://github.com/koinos/koinos-mock-vm#22-nameservice"
"@koinos/proto-as" "2.2.0"
"@koinos/sdk-as-cli" "^1.0.2"
"@roamin/protoc" "^2.4.0"
as-bignum "^0.2.18"
as-proto "npm:@koinos/[email protected]"
Expand Down

0 comments on commit fac0dcc

Please sign in to comment.