Skip to content

Commit

Permalink
Merge pull request #338 from Barma-lej/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Barma-lej committed Apr 20, 2024
2 parents d26260c + 84c9933 commit a359c3d
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 6 deletions.
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import imp from "eslint-plugin-import";
import globals from "globals";


export default [
eslint.configs.recommended,
eslintConfigPrettier,
{
plugins: {
imp
},
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.browser,
}
},
}
]
30 changes: 26 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.0",
"description": "Landroid lawnmower card for Home Assistant Lovelace UI",
"main": "dist/landroid-card.js",
"type": "module",
"scripts": {
"start": "rollup -c --watch",
"lint": "eslint src",
Expand Down Expand Up @@ -44,6 +45,7 @@
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/core": "^7.24.3",
"@babel/preset-env": "^7.23.7",
"globals": "15.0.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-image": "^3.0.2",
Expand Down
6 changes: 4 additions & 2 deletions src/landroid-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ class LandroidCard extends LitElement {
<div class="stats-subtitle">${subtitle}</div>
</div>
`;
} catch (error) {
} catch (e) {
console.warn(e);
return nothing;
}
},
Expand Down Expand Up @@ -749,7 +750,8 @@ class LandroidCard extends LitElement {
</div>
</div>
`;
} catch (error) {
} catch (e) {
console.warn(e);
return nothing;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/localize.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default function localize(string, search, replace) {
try {
langStored = JSON.parse(localStorage.getItem('selectedLanguage'));
} catch (e) {
console.warn(e);
langStored = localStorage.getItem('selectedLanguage');
}

Expand All @@ -82,6 +83,7 @@ export default function localize(string, search, replace) {
try {
translated = languages[lang][section][key];
} catch (e) {
console.warn(e);
translated = languages[DEFAULT_LANG][section][key];
}

Expand Down

0 comments on commit a359c3d

Please sign in to comment.