Skip to content

Commit

Permalink
refactor: cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
milo526 committed Oct 6, 2023
1 parent b528e08 commit 600da30
Show file tree
Hide file tree
Showing 57 changed files with 5,059 additions and 3,209 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github/
dist/
node_modules/
tools/
test/
10 changes: 5 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended", // uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
"sourceType": "module",
"project": true
},
"ignorePatterns": ["dist"],
"rules": {
"dot-notation": "off",
"eqeqeq": "warn",
"curly": ["warn", "all"],
"prefer-arrow-callback": ["warn"],
"max-len": ["warn", 140],
"no-console": ["warn"], // use the provided Homebridge log method instead
"no-console": ["error"], // use the provided Homebridge log method instead
"no-non-null-assertion": ["off"],
"lines-between-class-members": [
"warn",
Expand Down
11 changes: 3 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

<!--
Everything that is placed between these <! - - and - - > are considered comments and will not render.
Make sure to place all your information outside of these notations or I will not be able to read it!
Make sure to place all your information outside of these notations, or I will not be able to read it!
-->

<!--
Expand All @@ -25,10 +25,6 @@ I am human and to err is human, I make mistakes, if you think I closed your issu
I am not able to solve all your problems and entertain all your feature requests, part of this is because I don't actually own a lot of tuya devices.
A lot of the work I do is based on documentations and how some devices are supposed to work.
Who could have guessed, not all devices behave as they should.
So once more thank you for opening an issue, almost all issues here improve the usability of this plugin!
If this plugin does help you and you have some money to spare please consider donating.
Find the donate button here: https://github.com/milo526/homebridge-tuya-web you can either donate monthly through a subscription or make a one-time-donation trough the bunq.me link.
-->

**Describe the bug**
Expand Down Expand Up @@ -85,7 +81,7 @@ Steps to reproduce the behavior:
}
```
you might have some extra settings or miss some settings here. Please make sure to include all of the settings you have.
you might have some extra settings or miss some settings here. Please make sure to include all the settings you have.
For your own sanity ensure that you at least remove your password!
-->

Expand All @@ -98,7 +94,7 @@ Steps to reproduce the behavior:
Follow the steps as outlined under the heading "How to check whether the api this library uses can control your device"
https://github.com/milo526/homebridge-tuya-web#how-to-check-whether-the-api-this-library-uses-can-control-your-device
And include the full output here.
Yes this is quite some work but it is also very important, if you do not provide me this information;
Yes this is quite some work, but it is also very important, if you do not provide me this information;
I can almost guarantee you that the first thing I do is request you to do this (or close your issue outright).
You will probably not be helped before this information is provided, this is not because I like to be rude;
this is because this information is essential for me to do almost anything with this plugin for you.
Expand All @@ -111,7 +107,6 @@ Add any other context about the problem here.

<!--
Not following this template might result in outright closure of your issue!
If this surprises you, you already failed cause it was also stated as the first line of this template :)
As a closing remark,
thank you for opening a bug report. You are now helping this plugin improve!
Expand Down
9 changes: 2 additions & 7 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

<!--
Everything that is placed between these <! - - and - - > are considered comments and will not render.
Make sure to place all your information outside of these notations or I will not be able to read it!
Make sure to place all your information outside of these notations, or I will not be able to read it!
-->

<!--
Expand All @@ -28,13 +28,9 @@ Who could have guessed, not all devices behave as they should.
I might say no to your feature request.
Some smarter people with more experience in opensource software put it nicely
"Rule #1 of open-source: no is temporary, yes is forever."
"Rule #1 of open-source: saying no is temporary, yes is forever."
If I now start working on implementing your request I will need to support it for as long as I maintain this plugin.
I might not be ready for that kind of commitment for some feature requests.
So once more thank you for opening an issue, almost all issues here improve the usability of this plugin!
If this plugin does help you and you have some money to spare please consider donating.
Find the donate button here: https://github.com/milo526/homebridge-tuya-web you can either donate monthly through a subscription or make a one-time-donation trough the bunq.me link.
-->

**Is your feature request related to a problem? Please describe.**
Expand All @@ -59,7 +55,6 @@ Add any other context or screenshots about the feature request here.

<!--
Not following this template might result in outright closure of your issue!
If this surprises you, you already failed cause it was also stated as the first line of this template :)
As a closing remark,
thank you for opening a feature request. You are now helping this plugin improve!
Expand Down
8 changes: 2 additions & 6 deletions .github/ISSUE_TEMPLATE/new-device-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: ''

<!--
Everything that is placed between these <! - - and - - > are considered comments and will not render.
Make sure to place all your information outside of these notations or I will not be able to read it!
Make sure to place all your information outside of these notations, or I will not be able to read it!
-->

<!--
Expand All @@ -25,10 +25,6 @@ I am human and to err is human, I make mistakes, if you think I closed your issu
I am not able to solve all your problems and entertain all your feature requests, part of this is because I don't actually own a lot of tuya devices.
A lot of the work I do is based on documentations and how some devices are supposed to work.
Who could have guessed, not all devices behave as they should.
So once more thank you for opening an issue, almost all issues here improve the usability of this plugin!
If this plugin does help you and you have some money to spare please consider donating.
Find the donate button here: https://github.com/milo526/homebridge-tuya-web you can either donate monthly through a subscription or make a one-time-donation trough the bunq.me link.
-->

<!--
Expand All @@ -52,7 +48,7 @@ Did you check other issues to see if somebody already requested support?
If there is already an issue please add your support to that issue instead of opening a new one.
If I already said no to other similar requests please consider if my reasoning is still valid, if it is, your issue will probably be closed with the same feedback.
If non of these apply to you please explain what type of device it is you wish to get support added for.
If none of these apply to you please explain what type of device it is you wish to get support added for.
-->

**Device information**
Expand Down
86 changes: 0 additions & 86 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,119 +1,33 @@
# Ignore compiled code
dist

# ------------- Defaults ------------- #

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
Expand Down

0 comments on commit 600da30

Please sign in to comment.