Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: appease linter #990

Merged
merged 13 commits into from
Jun 25, 2024
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,54 @@ module.exports = {
},
extends: [
"airbnb-base",
"airbnb-typescript/base",
"prettier",
"plugin:jsdoc/recommended",
],
parserOptions: {
parser: "@typescript-eslint/parser",
project: "./config/tsconfig.json",
},
plugins: ["@babel", "prettier", "prefer-import"],
rules: {
// OFF
"node/no-unpublished-require": 0,
"import/prefer-default-export": 0,
"node/no-unsupported-features/es-syntax": 0,
"node/no-unsupported-features/es-builtins": 0,
camelcase: 0,
"class-methods-use-this": 0,
"linebreak-style": 0,
"jsdoc/require-returns": 0,
"jsdoc/require-param": 0,
"jsdoc/require-param-type": 0,
"jsdoc/require-returns-type": 0,
"jsdoc/no-blank-blocks": 0,
"jsdoc/no-multi-asterisks": 0,
"jsdoc/tag-lines": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/no-defaults": "off",
"valid-jsdoc": "off",
"import/extensions": 0,
"new-cap": 0,
"no-param-reassign": 0,
"no-underscore-dangle": 0,
"no-use-before-define": 0,
"prefer-destructuring": 0,
"lines-between-class-members": 0,
"@typescript-eslint/lines-between-class-members": "off",
"spaced-comment": 0,

// WARN
"arrow-body-style": 1,
"no-console": ["warn", { allow: ["assert"] }],
"no-debugger": 1,
"object-shorthand": 1,
"prefer-const": 1,
"prefer-import/prefer-import-over-require": [1],
"require-await": 1,

// ERROR
"no-unused-expressions": [2, { allowTaggedTemplates: true }],
},
};
41 changes: 0 additions & 41 deletions src/.eslintrc.js

This file was deleted.

5 changes: 3 additions & 2 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* tslint:disable:no-var-requires */
/* eslint import/no-import-module-exports: 0 */

import axios from "axios"; // idk why axios is weird

export * from "./index";
export * as StellarBase from "@stellar/stellar-base";

import axios from "axios"; // idk why axios is weird
export { axios };

export default module.exports;
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const defaultConfig: Configuration = {
timeout: 0,
};

let config = Object.assign({}, defaultConfig);
let config = { ...defaultConfig};

/**
* Global config class.
Expand Down Expand Up @@ -82,7 +82,7 @@ class Config {
* @returns {void}
*/
public static setDefault(): void {
config = Object.assign({}, defaultConfig);
config = { ...defaultConfig};
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/contract/assembled_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ import { assembleTransaction } from "../rpc/transaction";
import type { Client } from "./client";
import { Err } from "./rust_result";
import {
DEFAULT_TIMEOUT,
contractErrorPattern,
implementsToString,
getAccount
} from "./utils";
import { DEFAULT_TIMEOUT } from "./types";
import { SentTransaction } from "./sent_transaction";
import { Spec } from "./spec";

export const NULL_ACCOUNT =
"GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";

/**
* The main workhorse of {@link Client}. This class is used to wrap a
* transaction-under-construction and provide high-level interfaces to the most
Expand Down Expand Up @@ -909,7 +906,7 @@ export class AssembledTransaction<T> {
* Client initialization.
* @throws {AssembledTransaction.Errors.RestoreFailure} - Throws a custom error if the
* restore transaction fails, providing the details of the failure.
*/
*/
async restoreFootprint(
/**
* The preamble object containing data required to
Expand Down
3 changes: 1 addition & 2 deletions src/contract/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ export * from "./client";
export * from "./rust_result";
export * from "./sent_transaction";
export * from "./spec";
export * from "./types";
export { DEFAULT_TIMEOUT } from "./utils";
export * from "./types";
3 changes: 2 additions & 1 deletion src/contract/sent_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import type { MethodOptions } from "./types";
import { Server } from "../rpc/server"
import { Api } from "../rpc/api"
import { DEFAULT_TIMEOUT, withExponentialBackoff } from "./utils";
import { withExponentialBackoff } from "./utils";
import { DEFAULT_TIMEOUT } from "./types";
import type { AssembledTransaction } from "./assembled_transaction";

/**
Expand Down
Loading
Loading