Skip to content

Commit

Permalink
Configure plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
OMikkel committed Dec 10, 2023
1 parent 3d4ef96 commit ce3111f
Show file tree
Hide file tree
Showing 6 changed files with 1,933 additions and 94 deletions.
74 changes: 38 additions & 36 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended" // uses the recommended rules from the @typescript-eslint/eslint-plugin
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"ignorePatterns": [
"dist"
],
"rules": {
"quotes": ["warn", "single"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
"semi": ["off"],
"comma-dangle": ["warn", "always-multiline"],
"dot-notation": "off",
"eqeqeq": "warn",
"curly": ["warn", "all"],
"brace-style": ["warn"],
"prefer-arrow-callback": ["warn"],
"max-len": ["warn", 140],
"no-console": ["warn"], // use the provided Homebridge log method instead
"no-non-null-assertion": ["off"],
"comma-spacing": ["error"],
"no-multi-spaces": ["warn", { "ignoreEOLComments": true }],
"no-trailing-spaces": ["warn"],
"lines-between-class-members": ["warn", "always", {"exceptAfterSingleLine": true}],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/semi": ["warn"],
"@typescript-eslint/member-delimiter-style": ["warn"]
}
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended" // uses the recommended rules from the @typescript-eslint/eslint-plugin
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"ignorePatterns": ["dist"],
"rules": {
"quotes": ["warn", "double"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
"semi": ["off"],
"comma-dangle": ["warn", "always-multiline"],
"dot-notation": "off",
"eqeqeq": "warn",
"curly": ["warn", "all"],
"brace-style": ["warn"],
"prefer-arrow-callback": ["warn"],
"max-len": ["warn", 140],
"no-console": ["warn"], // use the provided Homebridge log method instead
"no-non-null-assertion": ["off"],
"comma-spacing": ["error"],
"no-multi-spaces": ["warn", { "ignoreEOLComments": true }],
"no-trailing-spaces": ["warn"],
"lines-between-class-members": [
"warn",
"always",
{ "exceptAfterSingleLine": true }
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/semi": ["warn"],
"@typescript-eslint/member-delimiter-style": ["warn"]
}
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"files.eol": "\n",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"source.fixAll.eslint": "explicit"
},
"editor.rulers": [ 140 ],
"eslint.enable": true
}
30 changes: 15 additions & 15 deletions config.schema.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"pluginAlias": "ExampleHomebridgePlugin",
"pluginType": "platform",
"singular": true,
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "Example Dynamic Platform"
}
}
}
}
"pluginAlias": "homebridge-ihc",
"pluginType": "platform",
"singular": true,
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "Example Dynamic Platform"
}
}
}
}
78 changes: 39 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"private": true,
"displayName": "Plugin Name",
"name": "homebridge-plugin-name",
"version": "1.0.0",
"description": "A short description about what your plugin does.",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/USERNAME/GITHUB_PROJECT_NAME.git"
},
"bugs": {
"url": "https://github.com/USERNAME/GITHUB_PROJECT_NAME/issues"
},
"engines": {
"node": "^18.17.0 || ^20.9.0",
"homebridge": "^1.6.0"
},
"main": "dist/index.js",
"scripts": {
"lint": "eslint src/**.ts --max-warnings=0",
"watch": "npm run build && npm link && nodemon",
"build": "rimraf ./dist && tsc",
"prepublishOnly": "npm run lint && npm run build"
},
"keywords": [
"homebridge-plugin"
],
"dependencies": {},
"devDependencies": {
"@types/node": "^18.16.20",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.45.0",
"homebridge": "^1.6.0",
"nodemon": "^2.0.22",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
}
"private": true,
"displayName": "Homebridge IHC",
"name": "homebridge-ihc",
"version": "1.0.0",
"description": "A short description about what your plugin does.",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/OMikkel/homebridge-ihc.git"
},
"bugs": {
"url": "https://github.com/OMikkel/homebridge-ihc/issues"
},
"engines": {
"node": "^18.17.0 || ^20.9.0",
"homebridge": "^1.6.0"
},
"main": "dist/index.js",
"scripts": {
"lint": "eslint src/**.ts --max-warnings=0",
"watch": "npm run build && npm link && nodemon",
"build": "rimraf ./dist && tsc",
"prepublishOnly": "npm run lint && npm run build"
},
"keywords": [
"homebridge-plugin"
],
"dependencies": {},
"devDependencies": {
"@types/node": "^18.16.20",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.45.0",
"homebridge": "^1.6.0",
"nodemon": "^2.0.22",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
}
}
4 changes: 2 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This is the name of the platform that users will use to register the plugin in the Homebridge config.json
*/
export const PLATFORM_NAME = 'ExampleHomebridgePlugin';
export const PLATFORM_NAME = "homebridge-ihc";

/**
* This must match the name of your plugin as defined the package.json
*/
export const PLUGIN_NAME = 'homebridge-plugin-name';
export const PLUGIN_NAME = "homebridge-ihc";
Loading

0 comments on commit ce3111f

Please sign in to comment.