Skip to content

Commit

Permalink
fix: some more exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Sep 29, 2023
1 parent 40cca3c commit 4f31ac7
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 16 deletions.
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0108/dch-g020.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "D-Link",
"manufacturerId": "0x0108",
"label": "DCH-G020",
"description": "mydlink® Connected Home Hub",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "mydlink Connected Home Hub",
"devices": [
{
"productType": "0x0020",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0108/dch-g022.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "D-Link",
"manufacturerId": "0x0108",
"label": "DCH-G022",
"description": "D-Link Mydlink Connected Home Hub",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "D-Link mydlink Connected Home Hub",
"devices": [
{
"productType": "0x0022",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0108/dch-z112.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "D-Link",
"manufacturerId": "0x0108",
"label": "DCH-Z112",
"description": "mydlink™ Door/Window Sensor",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "mydlink Door/Window Sensor",
"devices": [
{
"productType": "0x0002",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0118/tz06.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "TKB Home",
"manufacturerId": "0x0118",
"label": "TZ06",
"description": "In Wall Dual Relay(1 Way) Switch Module 2X 1.5kW",
"description": "In Wall Dual Relay(1 Way) Switch Module 2x 1.5kW",
"devices": [
{
"productType": "0x0001",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x011b/eedomus.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Connected Object",
"manufacturerId": "0x011b",
"label": "EEDOMUS+",
"description": "Eedomus",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "eedomus",
"devices": [
{
"productType": "0x0001",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0176/tzwp-102.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Telldus Technologies AB",
"manufacturerId": "0x0176",
"label": "TZWP-102",
"description": "Telldus Socket and Energy Meter",
"description": "Socket and Energy Meter",
"devices": [
{
"productType": "0x0003",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x017c/9601921000.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "EbV",
"manufacturerId": "0x017c",
"label": "9601921000",
"description": "Heatapp! Repeater S2",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "heatapp! Repeater S2",
"devices": [
{
"productType": "0x0001",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x019d/mob_iq_rg3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "MOBILUS MOTOR Spółka z o.o.",
"manufacturerId": "0x019d",
"label": "MOB.IQ [RG3+]",
"description": "Mob.iq [rg3+]",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "mob.iq [rg3+]",
"devices": [
{
"productType": "0x0003",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0371/zwa009_0.0_1.255.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Aeotec Ltd.",
"manufacturerId": "0x0371",
"label": "ZWA009",
"description": "AërQ Temperature and Humidity Sensor V1.0",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "aërQ Temperature and Humidity Sensor V1.0",
"devices": [
{
"productType": "0x0002",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Aeotec Ltd.",
"manufacturerId": "0x0371",
"label": "ZWA009",
"description": "AërQ Temperature and Humidity Sensor V1.0",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "aërQ Temperature and Humidity Sensor V1.0",
"devices": [
{
"productType": "0x0002",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0371/zwa022.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Aeotec Ltd.",
"manufacturerId": "0x0371",
"label": "ZWA022",
"description": "Illumino WallMote 7",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "illumino WallMote 7",
"devices": [
{
"productType": "0x0102",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0371/zwa037.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Aeotec Ltd.",
"manufacturerId": "0x0371",
"label": "ZWA037",
"description": "Illumino Dimmer Switch",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "illumino Dimmer Switch",
"devices": [
{
"productType": "0x0103",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0371/zwa038.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Aeotec Ltd.",
"manufacturerId": "0x0371",
"label": "ZWA038",
"description": "Illumino Wall Switch",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "illumino Wall Switch",
"devices": [
{
"productType": "0x0103",
Expand Down
3 changes: 2 additions & 1 deletion packages/config/config/devices/0x0371/zwa039.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"manufacturer": "Aeotec Ltd.",
"manufacturerId": "0x0371",
"label": "ZWA039",
"description": "AërQ Temperature and Humidity Sensor V2.0",
// eslint-disable-next-line @zwave-js/consistent-config-labels
"description": "aërQ Temperature and Humidity Sensor V2.0",
"devices": [
{
"productType": "0x0002",
Expand Down
7 changes: 5 additions & 2 deletions packages/eslint-plugin/src/rules/consistent-config-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const titleCaseExceptions = [
"in",
"of",
"by",
"to",
"or",
"for",
"the",
"and",
Expand All @@ -22,7 +24,7 @@ const titleCaseExceptions = [

const titleCaseIgnored: RegExp[] = [
/^v\d+$/i, // Versions
/^x$/i, // x
/^\d*x$/i, // 2x, 3x, x, ...
/^[a-z]+[A-Z]/, // fancY mArketing nAmEs
/[®™]$/i, // Trademarks etc.
];
Expand All @@ -32,8 +34,9 @@ const alwaysUppercase: RegExp[] = [
];

// TODO: Additional fixes:
// Plug-In, In-Wall
// Plug-In, In-Wall, 3-Way, 6-Channel
// remove Z-Wave and all its variants
// Title-Case hyphenated words

function isTitleCase(str: string) {
const words = str.split(" ");
Expand Down

0 comments on commit 4f31ac7

Please sign in to comment.