From dfe93f58d3eb2e6f2fb7f1155f5586b2b6906e65 Mon Sep 17 00:00:00 2001 From: Pavol Hejny Date: Sat, 26 Dec 2020 23:57:37 +0100 Subject: [PATCH] Workflows + LF --- .eslintrc.js | 22 +++++++++ .prettierrc | 1 + .vscode/terminals.json | 6 ++- README.md | 14 ++++-- package.json | 104 ++++++++++++++++++++--------------------- 5 files changed, 88 insertions(+), 59 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3d90ba3 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 12, + sourceType: 'module', + }, + plugins: ['@typescript-eslint'], + rules: { + indent: ['error', 4], + 'linebreak-style': ['error', 'unix'], + quotes: ['error', 'single'], + semi: ['error', 'always'], + 'no-constant-condition': 0, + '@typescript-eslint/no-non-null-assertion': 0, + '@typescript-eslint/no-explicit-any': 0, + }, +}; diff --git a/.prettierrc b/.prettierrc index 552465c..707cb41 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { + "endOfLine": "lf", "tabWidth": 4, "singleQuote": true, "trailingComma": "all", diff --git a/.vscode/terminals.json b/.vscode/terminals.json index 4acf2bc..e76cbf8 100644 --- a/.vscode/terminals.json +++ b/.vscode/terminals.json @@ -7,11 +7,13 @@ }, { "name": "prettier-watch", - "command": "npm run prettier-watch" + "command": "npm run prettier-watch", + "onlySingle": true }, { "name": "test-watch", - "command": "npm run test-watch" + "command": "npm run test-watch", + "onlySingle": true }, { "name": "generate-main-exports", diff --git a/README.md b/README.md index 5892a0c..c549cb3 100644 --- a/README.md +++ b/README.md @@ -12,19 +12,22 @@ npm i waitasecond # Usage - - ```typescript -import { } from 'waitasecond'; +import {} from 'waitasecond'; // TODO: ``` - # Contributing I am opened to your pull requests, feedback, suggestions and donations :) . Contact to me is on my [personal page](https://www.pavolhejny.com) +Please install theese plugins: + +- [Terminals Manager](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-terminals) +- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) +- [ESlint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + ## Publishing a new version Just do @@ -32,4 +35,5 @@ Just do ```bash npm version patch ``` -on *minor* or *major*. Scripts defined in package.json will test, lint, build, create documentation and push the whole project for you. + +on _minor_ or _major_. Scripts defined in package.json will test, lint, build, create documentation and push the whole project for you. diff --git a/package.json b/package.json index 9db474a..a2e4b56 100644 --- a/package.json +++ b/package.json @@ -1,54 +1,54 @@ { - "name": "waitasecond", - "version": "1.5.0", - "description": "Simple tool library for the waiting using Promises.", - "main": "dist/main.js", - "typings": "dist/main.d.ts", - "sideEffects": false, - "files": [ - "dist/**" - ], - "directions": { - "functions": "dist/functions" - }, - "scripts": { - "start": "npm run build-watch", - "build": "tsc", - "build-watch": "tsc --watch", - "prettier": "prettier --config .prettierrc --write \"{src,test,.vscode}/**/*.{ts,json}\"", - "pretty-imports": "npx organize-imports-cli tsconfig.json", - "prettier-watch": "onchange \"{src,test,.vscode}/**/*.{ts,json}\" -- prettier --config .prettierrc --write {{changed}}", - "prettier-commit": "git diff --exit-code && npm run pretty-imports && npm run prettier && git add src && git commit --allow-empty -m \"Prettier\"", - "documentation": "typedoc --excludePrivate --hideGenerator --mode file --theme minimal --out docs --name \"Wait second\" ./src", - "documentation-commit": "git diff --exit-code && npm run documentation && git add docs && git commit --allow-empty -m \"Documentation\"", - "test": "jest --config jestconfig.json", - "test-watch": "jest --config jestconfig.json --watchAll", - "lint": "tslint -p tsconfig.json", - "generate-main-exports": "ts-node ./scripts/generate-main-exports/generate-main-exports.ts", - "generate-main-exports-commit": "git diff --exit-code && npm run generate-main-exports && npm run prettier && git add src && git commit --allow-empty -m \"Updating exports\"", - "preversion": "npm test && npm run lint && npm run generate-main-exports-commit && npm run build && npm run prettier-commit && npm run documentation-commit", - "postversion": "git push && git push --tags && npm publish" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com:hejny/waitasecond.git" - }, - "author": "Pavol Hejný", - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "@types/jest": "^24.0.13", - "codecov": "^3.5.0", - "glob-promise": "^3.4.0", - "jest": "^24.8.0", - "onchange": "^3.3.0", - "organize-imports-cli": "^0.8.0", - "prettier": "github:prettier/prettier", - "ts-jest": "^24.0.2", - "ts-node": "^9.0.0", - "tslint": "^5.17.0", - "tslint-config-prettier": "^1.18.0", - "typedoc": "^0.14.2", - "typescript": "^3.5.1" - } + "name": "waitasecond", + "version": "1.5.0", + "description": "Simple tool library for the waiting using Promises.", + "main": "dist/main.js", + "typings": "dist/main.d.ts", + "sideEffects": false, + "files": [ + "dist/**" + ], + "directions": { + "functions": "dist/functions" + }, + "scripts": { + "start": "npm run build-watch", + "build": "tsc", + "build-watch": "tsc --watch", + "prettier": "prettier --config .prettierrc --write \"{src,test,.vscode}/**/*.{ts,json}\"", + "pretty-imports": "npx organize-imports-cli tsconfig.json", + "prettier-watch": "onchange \"{src,test,.vscode}/**/*.{ts,json}\" -- prettier --config .prettierrc --write {{changed}}", + "prettier-commit": "git diff --exit-code && npm run pretty-imports && npm run prettier && git add src && git commit --allow-empty -m \"Prettier\"", + "documentation": "typedoc --excludePrivate --hideGenerator --mode file --theme minimal --out docs --name \"Wait second\" ./src", + "documentation-commit": "git diff --exit-code && npm run documentation && git add docs && git commit --allow-empty -m \"Documentation\"", + "test": "jest --config jestconfig.json", + "test-watch": "jest --config jestconfig.json --watchAll", + "lint": "tslint -p tsconfig.json", + "generate-main-exports": "ts-node ./scripts/generate-main-exports/generate-main-exports.ts", + "generate-main-exports-commit": "git diff --exit-code && npm run generate-main-exports && npm run prettier && git add src && git commit --allow-empty -m \"Updating exports\"", + "preversion": "npm test && npm run lint && npm run generate-main-exports-commit && npm run build && npm run prettier-commit && npm run documentation-commit", + "postversion": "git push && git push --tags && npm publish" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com:hejny/waitasecond.git" + }, + "author": "Pavol Hejný", + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "@types/jest": "^24.0.13", + "codecov": "^3.5.0", + "glob-promise": "^3.4.0", + "jest": "^24.8.0", + "onchange": "^3.3.0", + "organize-imports-cli": "^0.8.0", + "prettier": "github:prettier/prettier", + "ts-jest": "^24.0.2", + "ts-node": "^9.0.0", + "tslint": "^5.17.0", + "tslint-config-prettier": "^1.18.0", + "typedoc": "^0.14.2", + "typescript": "^3.5.1" + } }