diff --git a/.eslintrc.json b/.eslintrc.json index 71ee545..affc479 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,55 +1,109 @@ { - "plugins": ["jest", "@typescript-eslint"], - "extends": ["plugin:github/recommended"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module", - "project": "./tsconfig.json" - }, - "rules": { - "i18n-text/no-en": "off", - "eslint-comments/no-use": "off", - "import/no-namespace": "off", - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], - "@typescript-eslint/no-require-imports": "error", - "@typescript-eslint/array-type": "error", - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-ts-comment": "error", - "camelcase": "off", - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], - "@typescript-eslint/func-call-spacing": ["error", "never"], - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/no-extraneous-class": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-assertion": "warn", - "@typescript-eslint/no-unnecessary-qualifier": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-useless-constructor": "error", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/prefer-function-type": "warn", - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-string-starts-ends-with": "error", - "@typescript-eslint/promise-function-async": "error", - "@typescript-eslint/require-array-sort-compare": "error", - "@typescript-eslint/restrict-plus-operands": "error", - "semi": "off", - "@typescript-eslint/semi": ["error", "never"], - "@typescript-eslint/type-annotation-spacing": "error", - "@typescript-eslint/unbound-method": "error" - }, - "env": { - "node": true, - "es6": true, - "jest/globals": true - } - } \ No newline at end of file + "plugins": ["jest", "@typescript-eslint"], + "extends": ["plugin:github/recommended"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "rules": { + "i18n-text/no-en": "off", + "eslint-comments/no-use": "off", + "import/no-namespace": "off", + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], + "@typescript-eslint/no-require-imports": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/ban-ts-comment": "error", + "no-case-declarations": "warn", + "no-console": "warn", + "no-debugger": "warn", + "no-else-return": "warn", + "no-param-reassign": "warn", + "no-undef": "off", + "no-unused-vars": "off", + "no-var": "warn", + "object-shorthand": "warn", + "@typescript-eslint/consistent-type-assertions": "error", + "@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }], + "@typescript-eslint/func-call-spacing": ["error", "never"], + "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-extraneous-class": "error", + "@typescript-eslint/no-for-in-array": "error", + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-unnecessary-qualifier": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/no-useless-constructor": "error", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-for-of": "warn", + "@typescript-eslint/prefer-function-type": "warn", + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-string-starts-ends-with": "error", + "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/require-array-sort-compare": "error", + "@typescript-eslint/restrict-plus-operands": "error", + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unbound-method": "error", + "prefer-const": "warn", + "padding-line-between-statements": [ + "warn", + { + "blankLine": "always", + "prev": "*", + "next": "class" + }, + { + "blankLine": "always", + "prev": "*", + "next": "for" + }, + { + "blankLine": "always", + "prev": "*", + "next": "function" + }, + { + "blankLine": "always", + "prev": "*", + "next": "if" + }, + { + "blankLine": "always", + "prev": "*", + "next": "return" + }, + { + "blankLine": "always", + "prev": "*", + "next": "switch" + }, + { + "blankLine": "always", + "prev": "*", + "next": "try" + }, + { + "blankLine": "always", + "prev": "*", + "next": "while" + }, + { + "blankLine": "always", + "prev": "block-like", + "next": ["let", "const"] + } + ] + }, + "env": { + "node": true, + "es6": true, + "jest/globals": true + } +} diff --git a/.prettierrc.json b/.prettierrc.json index c34bafc..2fec1f2 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,10 +1,5 @@ { - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": false, "singleQuote": true, - "trailingComma": "none", - "bracketSpacing": false, - "arrowParens": "avoid" + "trailingComma": "all", + "printWidth": 100 } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c2772fe --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "streetsidesoftware.code-spell-checker", + "wayou.vscode-todo-highlight" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ef9170b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "cSpell.words": ["beemail", "equitybee"], + "typescript.validate.enable": true, + "editor.formatOnSave": true, + "search.exclude": { + "**/node_modules": true, + "**/dist": true, + "**/lib": true, + "**/temp": true, + "**/coverage": true + } +} diff --git a/src/main.ts b/src/main.ts index 98325c4..48f9d5d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,19 +1,19 @@ -import * as core from '@actions/core' -import {wait} from './wait' +import * as core from '@actions/core'; +import { wait } from './wait'; async function run(): Promise { try { - const ms: string = core.getInput('milliseconds') - core.debug(`Waiting ${ms} milliseconds ...`) // debug is only output if you set the secret `ACTIONS_STEP_DEBUG` to true + const ms: string = core.getInput('milliseconds'); + core.debug(`Waiting ${ms} milliseconds ...`); // debug is only output if you set the secret `ACTIONS_STEP_DEBUG` to true - core.debug(new Date().toTimeString()) - await wait(parseInt(ms, 10)) - core.debug(new Date().toTimeString()) + core.debug(new Date().toTimeString()); + await wait(parseInt(ms, 10)); + core.debug(new Date().toTimeString()); - core.setOutput('time', new Date().toTimeString()) + core.setOutput('time', new Date().toTimeString()); } catch (error) { - if (error instanceof Error) core.setFailed(error.message) + if (error instanceof Error) core.setFailed(error.message); } } -run() +run();