Skip to content

Commit

Permalink
Update dependencies and linting rules (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeirola authored Aug 17, 2019
1 parent 25ba5f7 commit 0e59017
Show file tree
Hide file tree
Showing 9 changed files with 526 additions and 527 deletions.
12 changes: 6 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ module.exports = {
project: "./tsconfig.json"
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
rules: {
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
allowExpressions: true
}
]
// Following rules have issues with async generators
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/require-await": "off",
}
};
1,011 changes: 504 additions & 507 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@
"@babel/preset-env": "^7.5.5",
"@babel/preset-typescript": "^7.3.3",
"@types/fs-extra": "^8.0.0",
"@types/jest": "^24.0.15",
"@types/node": "^12.6.8",
"@types/jest": "^24.0.17",
"@types/node": "^12.7.2",
"@types/pixelmatch": "^5.0.0",
"@types/sharp": "^0.22.2",
"@types/tmp": "^0.1.0",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"babel-jest": "^24.8.0",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"babel-jest": "^24.9.0",
"babel-plugin-dynamic-import-node": "^2.3.0",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.1.0",
"glob": "^7.1.4",
"glob-promise": "^3.4.0",
"jest": "^24.8.0",
"jest": "^24.9.0",
"pixelmatch": "^5.0.2",
"prettier": "^1.18.2",
"tmp": "^0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/cli-test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import main from "../cli";

describe("cli", () => {
it("fails on missing file", async () => {
it("fails on missing file", () => {
expect(main()).rejects.toThrow();
});
});
4 changes: 2 additions & 2 deletions src/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("index", () => {
});

const generatedFiles = [];
for await (let file of generator) {
for await (const file of generator) {
generatedFiles.push(file);
}

Expand Down Expand Up @@ -75,7 +75,7 @@ describe("index", () => {
});

const generatedFiles = [];
for await (let file of generator) {
for await (const file of generator) {
const localPath = path.relative(tmpDir.name, file);
const fixturePath = path.join(fixtureDir, localPath);
await expectFilesToEqual(file, fixturePath, threshold);
Expand Down
4 changes: 2 additions & 2 deletions src/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ export async function* generate(
config: Partial<Config>,
fileInput: input.FileInput
): AsyncIterable<string> {
const fullConfig = await getConfig(config);
const fullConfig = getConfig(config);
yield* generateLegacyIcons(fileInput, fullConfig);
yield* generateRoundIcons(fileInput, fullConfig);
yield* generateAdaptiveIcon(fileInput, fullConfig);
}

async function getConfig(config: Partial<Config>): Promise<Config> {
function getConfig(config: Partial<Config>): Config {
return {
resDirPath: config.resDirPath || "./android/app/src/main/res",
vectorDrawables:
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function main(): Promise<void> {
icon: "./icon.svg"
});

for await (let file of generatedFiles) {
for await (const file of generatedFiles) {
console.log("Wrote " + file);
}
console.log("Done");
Expand Down
4 changes: 3 additions & 1 deletion src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ async function warmupSharp(
"utf-8"
)
).metadata();
} catch {}
} catch {
// Error only occurs once, so now safe to use sharp
}

return sharp;
}
Expand Down
2 changes: 1 addition & 1 deletion src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function* genaratePngs(
fileInput: GenerateInput,
outputs: GenerateConfig[]
): AsyncIterable<string> {
for (let output of outputs) {
for (const output of outputs) {
yield* genaratePng(fileInput, output);
}
}
Expand Down

0 comments on commit 0e59017

Please sign in to comment.