Small fixes (#234)

* Migrate to ESLint. Update Dependencies.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Remove orga directory.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Fix markdown errors.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Update pipeline triggers.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
pull/235/head
Jerome Luckenbach 2021-01-15 18:54:15 +01:00 committed by GitHub
parent 8c11a32d45
commit 2dc028fc3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 1042 additions and 3100 deletions

View File

@ -12,7 +12,7 @@ trigger:
branches: branches:
include: ['*'] include: ['*']
tags: tags:
include: ['*'] exclude: ['*']
pr: pr:
- master - master
@ -24,13 +24,12 @@ pool:
steps: steps:
# tag CI-produced packages with a version number pointing to the commit which was built. # tag CI-produced packages with a version number pointing to the commit which was built.
# for PRs, also include the PR #. # for PRs, also include the PR #.
# Temporary remove ci naming for non pr builds
- bash: | - bash: |
PACKAGE_VERSION=$(node -p "require('./package.json').version") PACKAGE_VERSION=$(node -p "require('./package.json').version")
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then
VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD) VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD)
else else
VERSION_STRING=${PACKAGE_VERSION} VERSION_STRING=${PACKAGE_VERSION}-ci-$(git rev-parse --short HEAD)
fi fi
npm --no-git-tag-version version $VERSION_STRING npm --no-git-tag-version version $VERSION_STRING
echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}" echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}"

View File

@ -8,8 +8,11 @@
# https://github.com/microsoft/azure-pipelines-vscode # https://github.com/microsoft/azure-pipelines-vscode
# #
# #
# Only trigger manually # Only trigger on tag creation
trigger: none trigger:
tags:
include: ['*']
pr: none pr: none
pool: pool:

45
.eslintrc.js Normal file
View File

@ -0,0 +1,45 @@
export default {
"env": {
"browser": true,
"node": true
},
"extends": [
"prettier",
"prettier/@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/member-delimiter-style": [
"off",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/naming-convention": "error",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/semi": [
"off",
null
],
"curly": "error",
"eqeqeq": [
"error",
"always"
],
"no-redeclare": "error"
}
};

View File

@ -1,6 +1,7 @@
{ {
"recommendations": [ "recommendations": [
"ms-vscode.vscode-typescript-tslint-plugin", "dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"daghostman.vs-treeview" "daghostman.vs-treeview"
] ]
} }

View File

@ -39,7 +39,7 @@ We pass the function containing the implementation of the command as the second
- `meta` holds some metadata like the langauage definition that is needed for syntax highlighting - `meta` holds some metadata like the langauage definition that is needed for syntax highlighting
- `.azure-pipelines` holds the configuration we are using for our *continous integration*. - `.azure-pipelines` holds the configuration we are using for our *continous integration*.
You can find our builds and artifacts on https://dev.azure.com/openhab/vscode-openhab/_build?definitionId=2 You can find our builds and artifacts on <https://dev.azure.com/openhab/vscode-openhab/_build?definitionId=2>
- `webpack`: We use webpack for bundling this extension. The config is shared over different locations. It has a shared part in the repository root which is then used by specific parts for each sub package. In this case `client` and `serverJS` have their own webpack config files. - `webpack`: We use webpack for bundling this extension. The config is shared over different locations. It has a shared part in the repository root which is then used by specific parts for each sub package. In this case `client` and `serverJS` have their own webpack config files.
@ -68,9 +68,8 @@ You can find our builds and artifacts on https://dev.azure.com/openhab/vscode-op
- Press `F5` to run the tests in a new window with your extension loaded - Press `F5` to run the tests in a new window with your extension loaded
- See the output of the test result in the debug console - See the output of the test result in the debug console
- **TBD** Make changes to `test/extension.test.ts` or create new test files inside the `test` folder - **TBD** Make changes to `test/extension.test.ts` or create new test files inside the `test` folder
- By convention, the test runner will only consider files matching the name pattern `**.test.ts` - By convention, the test runner will only consider files matching the name pattern `**.test.ts`
- You can create folders inside the `test` folder to structure your tests any way you want - You can create folders inside the `test` folder to structure your tests any way you want
## Contribution guidelines ## Contribution guidelines
@ -97,13 +96,13 @@ This gives other contributors a chance to point you in the right
direction, give feedback on your design, and maybe point out if someone direction, give feedback on your design, and maybe point out if someone
else is working on the same thing. else is working on the same thing.
### Create issues... ### Create issues
Any significant improvement should be documented as [a GitHub Any significant improvement should be documented as [a GitHub
issue](https://github.com/openhab/openhab-vscode/issues?labels=enhancement&page=1&state=open) before anybody issue](https://github.com/openhab/openhab-vscode/issues?labels=enhancement&page=1&state=open) before anybody
starts working on it. starts working on it.
### ...but check for existing issues first! ### ...but check for existing issues first
Please take a moment to check that an issue doesn't already exist Please take a moment to check that an issue doesn't already exist
documenting your bug report or improvement proposal. If it does, it documenting your bug report or improvement proposal. If it does, it
@ -171,7 +170,7 @@ pass it on as an open-source patch. The rules are pretty simple: if you
can certify the below (from can certify the below (from
[developercertificate.org](http://developercertificate.org/)): [developercertificate.org](http://developercertificate.org/)):
``` ```text
Developer Certificate of Origin Developer Certificate of Origin
Version 1.1 Version 1.1
@ -212,7 +211,7 @@ By making a contribution to this project, I certify that:
then you just add a line to every git commit message: then you just add a line to every git commit message:
Signed-off-by: Joe Smith <joe.smith@email.com> ```Signed-off-by: Joe Smith <joe.smith@email.com>```
using your real name (sorry, no pseudonyms or anonymous contributions.) using your real name (sorry, no pseudonyms or anonymous contributions.)
@ -276,4 +275,4 @@ The following icons were used from [Material Design Iconset](material.io/icons/)
| Player | `ic_play_circle_outline_black_24px` | | Player | `ic_play_circle_outline_black_24px` |
| Rollershutter | `ic_line_weight_black_24px` | | Rollershutter | `ic_line_weight_black_24px` |
| Arrow | `arrow_right_alt` | | Arrow | `arrow_right_alt` |
| HTTP | `http` | | HTTP | `http` |

4033
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -360,6 +360,10 @@
"@types/node": "^8.10.66", "@types/node": "^8.10.66",
"@types/request": "^2.48.5", "@types/request": "^2.48.5",
"@types/request-promise-native": "^1.0.15", "@types/request-promise-native": "^1.0.15",
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@typescript-eslint/parser": "^4.13.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"merge-options": "^1.0.1", "merge-options": "^1.0.1",
"request-promise-native": "^1.0.9", "request-promise-native": "^1.0.9",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
@ -367,5 +371,6 @@
"typescript": "^3.9.7", "typescript": "^3.9.7",
"webpack": "^4.44.2", "webpack": "^4.44.2",
"webpack-cli": "^3.3.12" "webpack-cli": "^3.3.12"
} },
"dependencies": {}
} }

View File

@ -1,15 +0,0 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink "$BASH_SOURCE")")/.."
# see also ".mailmap" for how email addresses and names are deduplicated
{
cat <<-'EOH'
# This file lists all individuals having contributed content to the repository.
# For how it is generated, see `project-orga/generate-authors.sh`.
EOH
echo
git log --format='%aN <%aE>' | sort -uf
} > AUTHORS

View File

@ -1,10 +0,0 @@
{
"rules": {
"no-unused-expression": true,
"no-duplicate-variable": true,
"curly": true,
"class-name": true,
"semicolon": ["never"],
"triple-equals": true
}
}