Unofficial JavaScript SDK for the transresult api. Written in Typescript.
um vscode mit typescript, eslint und prettier zu nutzen sollte typescript und eslint global installiert sein
npm install -g eslint typescript @types/node
darüber hinaus sollten die folgenden extentions in vscode installiert sein
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
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
{
"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,
}
}
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.
codine in src ablegen (build in dist)
mkdir src
echo console.log('Hello ') >> src/index.ts
echo console.log('world!') >> src/index.ts
...
"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",
...
- INSTALL npm install dotenv --save-dev
- INSTALL npm init release-it
- Obtain a personal access token (release-it only needs "repo" access; no "admin" or other scopes).
- 1903-How to publish packages to npm (the way the industry does things)
- 1810-Build and publish your first NPM package
- 1803-Step by step: Building and publishing an NPM Typescript package.
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.
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
}
Unlicense
Thank you to all the people who have already contributed to Vue.js!