generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Setup] Init Prettier, ESLint, .vscode folder
- Loading branch information
1 parent
270c8ab
commit b97d62d
Showing
5 changed files
with
147 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} | ||
"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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid" | ||
"trailingComma": "all", | ||
"printWidth": 100 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"streetsidesoftware.code-spell-checker", | ||
"wayou.vscode-todo-highlight" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<void> { | ||
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(); |