ssh-keygen -t ed25519 -C "email@example.com"
Note that in this example we use an ed25519 key.
The -c is providing a comment to divide the key amongst others.
I alwas use the suggested path and just klick enter đ
Clean Code Blog – www.harder-it-consulting.de
Clean Code – Tipps, Tricks for Fullstack React / Java / JavaScript / HTML 5 and more…
ssh-keygen -t ed25519 -C "email@example.com"
Note that in this example we use an ed25519 key.
The -c is providing a comment to divide the key amongst others.
I alwas use the suggested path and just klick enter đ
npm install && npm i -g eslint && npx eslint --ext .tsx --ext .ts ./
Please heed that npm install is used here to start my React application, which uses it as a build tool. IMportant
npm i -g eslint will install eslint, if it does not exist yet (for example a CI with Jenkins).
The npx eventually executes eslint for all files with ending .tsx or .ts recursively in the current directory. Please adapt the endings according to your needs – when you do not use TypeScript but JavaScript change it to .js
In your package.json add this example config:
"eslintConfig": {
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"env": {
"browser": true,
"es6": true
},
"globals": {
"Vue": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"plugin:@typescript-eslint/recommended"
],
"rules": {
"quotes": [
"error",
"double",
{
"avoidEscape": true
}
],
"comma-dangle": [
"error",
{
"arrays": "ignore",
"objects": "always-multiline",
"imports": "never",
"exports": "never",
"functions": "ignore"
}
],
"arrow-parens": 0,
"no-tabs": 0,
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"no-console": 1,
"generator-star-spacing": 0
}
}
In your IDE terminal, execute:
npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev
In IntelliJ settings, add:
From now on, when you open your .ts or .tsx files, the ESLint will detect the errors.
You can open the context menu then, by clicking the right mouse tab and click on „Fix ESlint Problems“.
IntelliJ will then automatically fix the problems.
You want reusable components, elements? Flexible structure?
Separation of concerns, decoupling in your JS Code?
A good strategy is to create an NPM Package.
I use JEST and to include the relevant Code, add this to your tsconfig.json:
"include": ["src/**/*"],
"exclude": ["node_modules", "**/__tests__/*"]
Before the package is published, you can test it locally:
npm link
npm link <module_name>
npm unlink --nosave <module_name>
on your main projects directory. This will remove the symbolic link. npm unlink
to also remove the global link.Now you have extracted and published Code as NPM package.
With the Hamcrest Matchers, do this:
//imports
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.StringContains.containsString;
//assert
assertThat(actualData, containsString(expectedData));