Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish NPM package
on:
push:
branches: [ 'master' ]
release:
types: [ published ]

jobs:
publish:
uses: wavesplatform/publish-to-npm/.github/workflows/publish.yml@7d9462af686d83552d72097bf47a892e43d11f6e
with:
environment: NPMJS
event_name: ${{ github.event_name }}
test: true
version: ${{ github.event.release.tag_name }}
permissions:
id-token: write
contents: read
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ typings/
dist
build/tmp
.idea
sandbox.spec.ts
sandbox.spec.ts
package-lock.json
44 changes: 0 additions & 44 deletions build/build.ts

This file was deleted.

35 changes: 0 additions & 35 deletions build/generateExampleTransactions.ts

This file was deleted.

48 changes: 0 additions & 48 deletions build/utils.ts

This file was deleted.

14 changes: 0 additions & 14 deletions build/verions.ts

This file was deleted.

168 changes: 168 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import importPlugin from 'eslint-plugin-import-x';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';

export default [
{
ignores: [
'node_modules/**',
'dist/**',
'.github/**',
'docs/**',
'coverage/**',
'**/*.d.ts'
],
},
js.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
ecmaVersion: 2020,
},
globals: {
node: true,
es2020: true,
jest: true,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
import: importPlugin,
prettier: prettierPlugin,
},
rules: {
'max-len': 'off',
'no-unused-vars': 'off',
'no-redeclare': 'off',
'no-restricted-globals': ['error', 'Buffer'],
'array-callback-return': 'warn',
'default-case': ['warn', { commentPattern: '^no default$' }],
'dot-location': ['warn', 'property'],
'eqeqeq': ['warn', 'smart'],
'new-parens': 'warn',
'no-caller': 'warn',
'no-eval': 'error',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-label': 'warn',
'no-implied-eval': 'error',
'no-iterator': 'warn',
'no-label-var': 'warn',
'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
'no-lone-blocks': 'warn',
'no-loop-func': 'warn',
'no-multi-str': 'warn',
'no-new-func': 'error',
'no-new-object': 'warn',
'no-new-wrappers': 'warn',
'no-obj-calls': 'warn',
'no-octal-escape': 'warn',
'no-restricted-syntax': ['warn', 'WithStatement'],
'no-script-url': 'warn',
'no-self-assign': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
'no-template-curly-in-string': 'warn',
'no-throw-literal': 'error',
'no-unused-expressions': ['warn', {
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
}],
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-escape': 'warn',
'no-useless-rename': ['warn', {
ignoreDestructuring: false,
ignoreImport: false,
ignoreExport: false,
}],
'no-with': 'warn',
'no-whitespace-before-property': 'warn',
'padding-line-between-statements': ['warn',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] }
],
'radix': ['warn'],
'require-await': 'off',
'require-yield': 'warn',
'rest-spread-spacing': ['warn', 'never'],
'strict': ['warn', 'never'],
'unicode-bom': ['warn', 'never'],
'use-isnan': 'warn',
'valid-typeof': 'warn',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-absolute-path': 'warn',
'import/no-amd': 'warn',
'import/no-default-export': 'warn',
'import/no-extraneous-dependencies': ['warn', {
devDependencies: [
'**/*.test.ts',
'**/*.spec.ts',
'test/**/*',
'scripts/**/*'
],
peerDependencies: true,
optionalDependencies: false,
}],
'import/no-mutable-exports': 'warn',
'import/no-named-default': 'warn',
'import/no-self-import': 'warn',
'import/order': ['warn', {
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always'
}],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/consistent-type-definitions': ['warn', 'type'],
'@typescript-eslint/explicit-function-return-type': ['warn', {
allowExpressions: true,
allowTypedFunctionExpressions: true,
}],
'@typescript-eslint/member-ordering': 'warn',
'@typescript-eslint/no-array-constructor': 'warn',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-empty-interface': ['warn', { allowSingleExtends: true }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'warn',
'@typescript-eslint/no-misused-new': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}],
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-useless-constructor': 'warn',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/prefer-regexp-exec': 'warn',
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
'@typescript-eslint/promise-function-async': 'warn',
'@typescript-eslint/quotes': ['warn', 'single'],
'@typescript-eslint/require-array-sort-compare': 'warn',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/type-annotation-spacing': 'warn',
},
},
{
files: ['**/*.test.ts', '**/*.spec.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/require-await': 'off',
},
},
prettierConfig,
];
24 changes: 2 additions & 22 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
module.exports = {
verbose: true,
roots: [
'<rootDir>/test',
'<rootDir>/test'
],
testRegex: '(/__tests__/.*|(\\.|/)(test))\\.tsx?$',
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest"
'^.+\\.tsx?$': ['ts-jest', {diagnostics: false}]
},
collectCoverage: true,
coverageReporters: [
"json-summary",
"text",
"lcov"
],
globals: {
'ts-jest': {
diagnostics: false,
},
},
preset: 'ts-jest',
testMatch: null,
testEnvironment: 'node',
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
Loading