Skip to content

Commit

Permalink
fix: Build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Feb 8, 2021
1 parent 51d60d8 commit aec0056
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 36 deletions.
10 changes: 4 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:promise/recommended",
"plugin:eslint-comments/recommended",
"prettier",
"prettier/@typescript-eslint"
],
Expand All @@ -19,12 +17,12 @@
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "jest"],
"plugins": ["@typescript-eslint", "jest", "import"],
"rules": {
"sort-imports": ["error", {"ignoreDeclarationSort": true}],
"sort-imports": ["error", { "ignoreDeclarationSort": true }],
"import/order": [
"error",
{"alphabetize": {"order": "asc"}, "newlines-between": "never"}
{ "alphabetize": { "order": "asc" }, "newlines-between": "never" }
],
"no-return-await": "error",
"no-console": "error",
Expand All @@ -33,7 +31,7 @@
"import/no-unassigned-import": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{"argsIgnorePattern": "^_", "caughtErrors": "all"}
{ "argsIgnorePattern": "^_", "caughtErrors": "all" }
],
"@typescript-eslint/no-unused-expressions": "error"
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions jest.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"test": "jest",
"test": "jest --passWithNoTests",
"all": "yarn run build && yarn run format && yarn run lint && yarn run test"
},
"repository": {
Expand Down Expand Up @@ -37,6 +37,7 @@
"@vercel/ncc": "^0.27.0",
"eslint": "~7.18.0",
"eslint-config-prettier": "~7.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "~24.1.3",
"faker": "^5.1.0",
"jest": "~26.6.3",
Expand Down
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as core from '@actions/core'
import { makeConfig } from './config'
import * as core from '@actions/core';
import { makeConfig } from './config';
import { matcher } from './matcher';

async function run(): Promise<void> {
Expand All @@ -8,8 +8,8 @@ async function run(): Promise<void> {
const out = matcher(config.key, config.map);
core.setOutput('out', out);
} catch (error) {
core.setFailed(error.message)
core.setFailed(error.message);
}
}

run()
run();
7 changes: 2 additions & 5 deletions src/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ export function isMatch(value: string, matchValue: string): boolean {
return value === matchValue || Boolean(value.match(matchValue));
}

export function matcher(
key: string,
map: Record<string, string>,
): string {
export function matcher(key: string, map: Record<string, string>): string {
const mapKeys = Object.keys(map);
let m = mapKeys.find(mapKey => isMatch(key, mapKey));
const m = mapKeys.find(mapKey => isMatch(key, mapKey));

if (!m && map['_default']) {
return map['_default'];
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function invariant(
condition: any,
condition: unknown,
message?: string,
): asserts condition {
if (!condition) {
Expand Down
Loading

0 comments on commit aec0056

Please sign in to comment.