git.delta.rocks / unique-network / refs/commits / 086739e0956b

difftreelog

ci use same lint script as in development

Yaroslav Bolyukin2023-11-14parent: #acb1833.patch.diff
in: master

7 files changed

modified.github/workflows/codestyle.ymldiffbeforeafterboth
--- a/.github/workflows/codestyle.yml
+++ b/.github/workflows/codestyle.yml
@@ -44,8 +44,8 @@
       - name: Install modules
         run: cd js-packages && yarn
       - name: Run ESLint
-        # run: cd js-packages && yarn eslint --ext .ts,.js --max-warnings=0 src/
-        run: cd js-packages && yarn eslint --ext .ts,.js ./*/src
+        # run: cd js-packages && yarn lint --max-warnings=0
+        run: cd js-packages && yarn lint
 
   clippy:
     runs-on: [ self-hosted-ci ]
addedjs-packages/.eslintignorediffbeforeafterboth
--- /dev/null
+++ b/js-packages/.eslintignore
@@ -0,0 +1 @@
+*.d.ts
modifiedjs-packages/.eslintrc.jsondiffbeforeafterboth
before · js-packages/.eslintrc.json
1{2    "env": {3        "browser": true,4        "es2020": true5    },6    "extends": [7        "eslint:recommended",8        "plugin:@typescript-eslint/recommended"9    ],10    "parser": "@typescript-eslint/parser",11    "parserOptions": {12        "ecmaVersion": 11,13        "sourceType": "module",14        "project": "**/tsconfig.json"15    },16    "plugins": [17        "@typescript-eslint",18        "mocha"19    ],20    "rules": {21        "@typescript-eslint/no-floating-promises": [22            "error"23        ],24        "indent": [25            "error",26            2,27            {28                "SwitchCase": 129            }30        ],31        "no-trailing-spaces": "warn",32        "keyword-spacing": [33            "error",34            {35                "overrides": {36                    "if": {"after": false},37                    "while": {"after": false},38                    "for": {"after": false}39                }40            }41        ],42        "function-call-argument-newline": [43            "error",44            "consistent"45        ],46        "function-paren-newline": [47            "error",48            "multiline"49        ],50        "linebreak-style": [51            "error",52            "unix"53        ],54        "quotes": [55            "error",56            "single",57            {58                "avoidEscape": true59            }60        ],61        "require-await": 2,62        "mocha/no-async-describe": "error",63        "mocha/no-nested-tests": "error",64        "mocha/no-synchronous-tests": "error",65        "semi": [66            "error",67            "always"68        ],69        "@typescript-eslint/explicit-module-boundary-types": "off",70        "comma-dangle": [71            "error",72            "always-multiline"73        ],74        "no-unused-vars": "off",75        "@typescript-eslint/no-empty-function": "off",76        "@typescript-eslint/no-non-null-assertion": "off",77        "@typescript-eslint/no-explicit-any": "off",78        "@typescript-eslint/no-unused-vars": [79            "warn",80            {81                "varsIgnorePattern": "(?:_.+|__dirname|__filename)",82                "argsIgnorePattern": "_.+"83            }84        ],85        "no-async-promise-executor": "warn",86        "@typescript-eslint/no-empty-interface": "off",87        "prefer-const": [88            "error",89            {90                "destructuring": "all"91            }92        ],93        "@typescript-eslint/ban-ts-comment": "off",94        "object-curly-spacing": ["warn", "never"],95        "arrow-spacing": "warn",96        "array-bracket-spacing": ["warn", "never"],97        "template-curly-spacing": "warn",98        "space-in-parens": "warn",99        "arrow-body-style": ["warn", "as-needed"],100        "no-restricted-syntax": [101            "warn",102            {103                "message": "toHuman results in horrible, hard to debug conversions with no stability guarantees, use Codec/at least .toJson instead",104                "selector": "MemberExpression > Identifier[name=\"toHuman\"]"105            }106        ],107        "@typescript-eslint/naming-convention": [108            "warn",109            {110                "selector": "default",111                "format": [112                    "camelCase"113                ],114                "leadingUnderscore": "allow",115                "trailingUnderscore": "allow"116            },117            {118                "selector": "variable",119                "format": [120                    "camelCase",121                    "UPPER_CASE"122                ],123                "leadingUnderscore": "allow",124                "trailingUnderscore": "allow"125            },126            {127                "selector": "typeLike",128                "format": [129                    "PascalCase"130                ]131            },132            {133                "selector": "memberLike",134                "format": null135            }136        ]137    }138}
modifiedjs-packages/package.jsondiffbeforeafterboth
--- a/js-packages/package.json
+++ b/js-packages/package.json
@@ -42,6 +42,7 @@
     ]
   },
   "scripts": {
+    "prepublish": "yarn tsc",
     "lint": "eslint --ext .ts .",
     "fix": "yarn lint --fix",
     "polkadot-types-fetch-metadata": "yarn ts-node --esm scripts/fetchMetadata.ts",
modifiedjs-packages/playgrounds/package.jsondiffbeforeafterboth
--- a/js-packages/playgrounds/package.json
+++ b/js-packages/playgrounds/package.json
@@ -1,7 +1,7 @@
 {
   "author": "",
   "license": "SEE LICENSE IN ../../../LICENSE",
-  "description": "Interfaces for interacting with contracts and contract ABIs",
+  "description": "Playground scripts",
   "engines": {
     "node": ">=16"
   },
modifiedjs-packages/tsconfig.jsondiffbeforeafterboth
--- a/js-packages/tsconfig.json
+++ b/js-packages/tsconfig.json
@@ -12,4 +12,7 @@
 		"strict": true,
 		"resolveJsonModule": true,
 	},
+	"include": [
+		"./**/*.ts"
+	],
 }
deletedscripts/init.shdiffbeforeafterboth
--- a/scripts/init.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-echo "*** Initializing WASM build environment"
-
-if [ -z $CI_PROJECT_NAME ] ; then
-   rustup update nightly
-   rustup update stable
-fi
-
-rustup target add wasm32-unknown-unknown --toolchain nightly