2.0.15 • Published 4 years ago

tr-core-lib v2.0.15

Weekly downloads
1
License
Unlicense
Repository
github
Last release
4 years ago

TR-CORE 1

Unofficial JavaScript SDK for the transresult api. Written in Typescript.

npm.io Dependency Status Build Status

Prerequisites (installation and usage)

(1) globally install typescript @types/node und eslint to your maschine

um vscode mit typescript, eslint und prettier zu nutzen sollte typescript und eslint global installiert sein

npm install -g eslint typescript @types/node

(2) recommended VSCODE Extentions

darüber hinaus sollten die folgenden extentions in vscode installiert sein

Installation and usage

A) TYPESCRIPT Konfiguration devDependancy npm

typescript und die types als devDependance installieren

npm install typescript @types/node --save-dev

tsconfig.json erstellen

npx tsc --init --rootDir src --outDir dist --esModuleInterop --resolveJsonModule --lib es6 --module commonjs --allowJs true --noImplicitAny true

B) typescript+ESLINT Konfiguration devDependancy npm

npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
echo {} >> .eslintrc.json
mkdir src
echo "console.log('hello');" > src/index.ts
echo {"extends": "../tsconfig.json","include": ["./**/*.ts"]} > src/tsconfig.json

danach kommt dann die Frage ob man global

Tux, the Linux mascot


Philadelphia's Magic Gardens. This place was so cool!

{
  "parser": "@typescript-eslint/parser",
  "plugins": [
    "@typescript-eslint",
  ],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended"
  ],
  // Do not search for further eslint configs in upper directories
  "root": true,
  "rules": {
    "no-console": 1,
  }
}

C) typescript+eslint+PRETTIER Konfiguration devDependancy npm

Install eslint-config-prettier:

npm install --save-dev eslint-config-prettier

Then, add eslint-config-prettier to the "extends" array in your .eslintrc.* file. Make sure to put it last, so it gets the chance to override other configs. eslint-config-prettier#installation

There's also a recommended configuration for VSCode.

{
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint"],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "prettier/@typescript-eslint"
  ],
  // Do not search for further eslint configs in upper directories
  "root": true,
  "rules": {
    "no-console": 1
  }
}

eslint-config-peerigon You can also combine these linting rules with Prettier (see below). There's also a recommended configuration for VSCode.

D) code ersteleln

codine in src ablegen (build in dist)

mkdir src
echo console.log('Hello ') >> src/index.ts
echo console.log('world!') >> src/index.ts

E) package.json anpassen

  ...

  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "files": [    "dist"  ],
  "scripts": {

    "test": "echo \"Error: no test specified\" && exit 1",
    "lint": "eslint src --ext js,ts",
    "build": "tsc -p src/tsconfig.json",
    "build:dev": "tsc --watch --preserveWatchOutput",
    "start": "node dist/index.js"

  },
  "keywords": [],
  "author": "develop@transresult.de",
  "license": "ISC",

  ...

Konfigurieren release-IT

  1. INSTALL npm install dotenv --save-dev
  2. INSTALL npm init release-it
  3. Obtain a personal access token (release-it only needs "repo" access; no "admin" or other scopes).

Examples creating npm packages

Prettier peerigon

https://github.com/peerigon/eslint-config-peerigon https://developer.aliyun.com/mirror/npm/package/eslint-config-peerigon There is a Prettier config in this repository that corresponds to our linting rules as much as possible. Add a .prettierrc file to your repository with the following content:

"eslint-config-peerigon/prettier"

Please note that our linting rules will complain about specific code snippets coming from Prettier. We recommend running eslint --fix afterwards.

VSCode

This is our recommended VSCode configuration using the Prettier extension. Adjust it to the needs of your particular project:

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}
--> not workinbg
{
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[javascriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "prettier.eslintIntegration": true,
  "prettier.tslintIntegration": false,
  "prettier.requireConfig": true
}

License

Unlicense

Credits

Thank you to all the people who have already contributed to Vue.js!

Sponsors

2.0.15

4 years ago

2.0.3

4 years ago

2.0.13

4 years ago

2.0.5

4 years ago

2.0.14

4 years ago

2.0.4

4 years ago

2.0.11

4 years ago

2.0.7

4 years ago

2.0.12

4 years ago

2.0.6

4 years ago

2.0.9

4 years ago

2.0.10

4 years ago

2.0.8

4 years ago

2.0.2

4 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.6

4 years ago

0.2.8

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.0

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago