Skip to content

Commit

Permalink
Prettier fixup for easier merge?
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Sep 22, 2023
1 parent df2526d commit 5d8019a
Show file tree
Hide file tree
Showing 35 changed files with 1,791 additions and 1,788 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
env: {
es6: true
es6: true,
},
extends: ["airbnb-base", "prettier"],
plugins: ["@babel", "prettier", "prefer-import"],
parser: "@babel/eslint-parser",
rules: {
"node/no-unpublished-require": 0
}
"node/no-unpublished-require": 0,
},
};
12 changes: 6 additions & 6 deletions config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ module.exports = function (config) {
files: [
"../dist/stellar-sdk.js", // webpack should build this first
"../test/test-browser.js",
"../test/unit/**/*.js"
"../test/unit/**/*.js",
],

preprocessors: {
"../test/**/*.js": ["webpack"]
"../test/**/*.js": ["webpack"],
},

webpack: webpackConfig,
webpackMiddleware: {
noInfo: true
noInfo: true,
},

colors: true,
Expand All @@ -31,8 +31,8 @@ module.exports = function (config) {
coverageReporter: {
type: "text-summary",
instrumenterOptions: {
istanbul: { noCompact: true }
}
}
istanbul: { noCompact: true },
},
},
});
};
4 changes: 2 additions & 2 deletions config/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = {
singleQuote: false,
tabWidth: 2,
parser: "babel",
trailingComma: "none",
useTabs: false
trailingComma: "all",
useTabs: false,
};
40 changes: 20 additions & 20 deletions config/webpack.config.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ const config = {
// https://stackoverflow.com/a/34018909
entry: {
"stellar-sdk": path.resolve(__dirname, "../src/browser.ts"),
"stellar-sdk.min": path.resolve(__dirname, "../src/browser.ts")
"stellar-sdk.min": path.resolve(__dirname, "../src/browser.ts"),
},
resolve: {
fallback: {
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
buffer: require.resolve("buffer")
buffer: require.resolve("buffer"),
},
extensions: [".ts", ".js"]
extensions: [".ts", ".js"],
},
output: {
clean: true,
library: "StellarSdk",
compareBeforeEmit: true,
path: path.resolve(__dirname, "../dist")
path: path.resolve(__dirname, "../dist"),
},
mode: process.env.NODE_ENV ?? "development",
devtool: process.env.NODE_ENV === "production" ? false : "inline-source-map",
Expand All @@ -36,11 +36,11 @@ const config = {
use: {
loader: "babel-loader",
options: {
cacheDirectory: true
}
}
}
]
cacheDirectory: true,
},
},
},
],
},
optimization: {
minimize: true,
Expand All @@ -49,29 +49,29 @@ const config = {
include: /\.min\.js$/,
terserOptions: {
format: {
ascii_only: true
}
}
})
]
ascii_only: true,
},
},
}),
],
},
plugins: [
// this must be first for karma to work (see line 5 of karma.conf.js)
new ESLintPlugin({
overrideConfigFile: path.resolve(__dirname, "../.eslintrc.js")
overrideConfigFile: path.resolve(__dirname, "../.eslintrc.js"),
}),
// Ignore native modules (sodium-native)
new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }),
new NodePolyfillPlugin({
includeAliases: ["http", "https"] // others aren't needed
includeAliases: ["http", "https"], // others aren't needed
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"]
})
Buffer: ["buffer", "Buffer"],
}),
],
watchOptions: {
ignored: /(node_modules|coverage|lib|dist)/
}
ignored: /(node_modules|coverage|lib|dist)/,
},
};

module.exports = config;
10 changes: 5 additions & 5 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
env: {
es6: true
es6: true,
},
rules: {
// OFF
Expand All @@ -26,14 +26,14 @@ module.exports = {
"valid-jsdoc": [
1,
{
requireReturnDescription: false
}
requireReturnDescription: false,
},
],
"prefer-const": 1,
"object-shorthand": 1,
"require-await": 1,

// ERROR
"no-unused-expressions": [2, { allowTaggedTemplates: true }]
}
"no-unused-expressions": [2, { allowTaggedTemplates: true }],
},
};
10 changes: 5 additions & 5 deletions src/soroban/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
env: {
es6: true
es6: true,
},
parser: "@babel/eslint-parser",
extends: ["airbnb-base", "prettier"],
Expand Down Expand Up @@ -29,14 +29,14 @@ module.exports = {
"valid-jsdoc": [
1,
{
requireReturnDescription: false
}
requireReturnDescription: false,
},
],
"prefer-const": 1,
"object-shorthand": 1,
"require-await": 1,

// ERROR
"no-unused-expressions": [2, { allowTaggedTemplates: true }]
}
"no-unused-expressions": [2, { allowTaggedTemplates: true }],
},
};
8 changes: 4 additions & 4 deletions test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module.exports = {
env: {
mocha: true
mocha: true,
},
globals: {
StellarSdk: true,
axios: true,
chai: true,
sinon: true,
expect: true,
HorizonAxiosClient: true
HorizonAxiosClient: true,
},
rules: {
"no-unused-vars": 0
}
"no-unused-vars": 0,
},
};
4 changes: 2 additions & 2 deletions test/integration/apiary.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("tests the /liquidity_pools endpoint", function () {
effects: server.effects(),
operations: server.operations(),
trades: server.trades(),
transactions: server.transactions()
transactions: server.transactions(),
};

Object.keys(testCases).forEach((suffix) => {
Expand Down Expand Up @@ -158,7 +158,7 @@ describe("tests the /accounts endpoint", function () {
.then((resp) => {
// find the pool share balance(s)
const poolShares = resp.balances.filter(
(b) => b.asset_type === "liquidity_pool_shares"
(b) => b.asset_type === "liquidity_pool_shares",
);

expect(poolShares).to.have.lengthOf(1);
Expand Down
4 changes: 2 additions & 2 deletions test/integration/client_headers_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ describe("integration tests: client headers", function (done) {
}

closeStream = new HorizonServer(`http://localhost:${port}`, {
allowHttp: true
allowHttp: true,
})
.operations()
.stream({
onerror: (err) => {
done(err);
}
},
});
});
});
Expand Down
12 changes: 6 additions & 6 deletions test/integration/streaming_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ describe("integration tests: streaming", function (done) {
}

closeStream = new HorizonServer(`http://localhost:${port}`, {
allowHttp: true
allowHttp: true,
})
.operations()
.stream({
onerror: (err) => {
server.close();
closeStream();
done();
}
},
});
});
});
Expand All @@ -61,7 +61,7 @@ describe("integration tests: streaming", function (done) {
response.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
Connection: "keep-alive"
Connection: "keep-alive",
});
response.write("retry: 10\nevent: close\ndata: byebye\n\n");
};
Expand All @@ -74,7 +74,7 @@ describe("integration tests: streaming", function (done) {
}

closeStream = new HorizonServer(`http://localhost:${port}`, {
allowHttp: true
allowHttp: true,
})
.operations()
.stream({
Expand All @@ -83,7 +83,7 @@ describe("integration tests: streaming", function (done) {
},
onerror: (err) => {
done(err);
}
},
});
});
});
Expand Down Expand Up @@ -124,7 +124,7 @@ describe("end-to-end tests: real streaming", function (done) {
onmessage: (msg) => {
transactions.push(msg);
},
onerror: finishTest
onerror: finishTest,
});

let timeout = setTimeout(finishTest, DURATION * 1000);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/call_builders_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("CallBuilder functions", function () {

expect(arg.toString()).not.to.be.equal("https://onedom.ain/one_segment"); // https://onedom.ain/
expect(builder.url.toString()).to.be.equal(
"https://onedom.ain/one_segment"
"https://onedom.ain/one_segment",
);
});
});
Loading

0 comments on commit 5d8019a

Please sign in to comment.