Skip to content

Commit

Permalink
Upgrade eslint and fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
benct committed Dec 23, 2021
1 parent 84ca6dd commit 6988ce6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"history": true,
"confirm": true,
"console": true,
"customElements": true
"customElements": true,
"Intl": true
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"@babel/core": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"babel-loader": "^8.2.3",
"eslint": "^8.4.1",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.5.1",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
},
"scripts": {
"lint": "eslint src/*.js",
"lint": "eslint src/**/*.js",
"dev": "webpack -c webpack.config.js",
"build": "yarn lint && webpack -c webpack.config.js"
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/compute_state_display.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Source: https://github.com/home-assistant/frontend/blob/dev/src/common/entity/compute_state_display.ts

import { UNAVAILABLE, UNKNOWN } from "./constants";
import { UNAVAILABLE, UNKNOWN } from './constants';
import { formatDate } from './format_date';
import { formatDateTime } from './format_date_time';
import { formatTime } from './format_time';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/format_date_time.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Source: https://github.com/home-assistant/frontend/blob/dev/src/common/datetime/format_date_time.ts

import memoizeOne from 'memoize-one';
import { useAmPm } from "./use_am_pm";
import { useAmPm } from './use_am_pm';

export const formatDateTime = (dateObj, locale) => formatDateTimeMem(locale).format(dateObj);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/format_time.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Source: https://github.com/home-assistant/frontend/blob/dev/src/common/datetime/format_time.ts

import memoizeOne from 'memoize-one';
import { useAmPm } from "./use_am_pm";
import { useAmPm } from './use_am_pm';

export const formatTime = (dateObj, locale) => formatTimeMem(locale).format(dateObj);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/use_am_pm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Source: https://github.com/home-assistant/frontend/blob/dev/src/common/datetime/use_am_pm.ts

import memoizeOne from 'memoize-one';
import { TimeFormat } from './constants'
import { TimeFormat } from './constants';

export const useAmPm = memoizeOne((locale) => {
if (locale.time_format === TimeFormat.language || locale.time_format === TimeFormat.system) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1713,10 +1713,10 @@ eslint-visitor-keys@^3.1.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2"
integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==

eslint@^8.4.1:
version "8.4.1"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.1.tgz#d6531bbf3e598dffd7c0c7d35ec52a0b30fdfa2d"
integrity sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg==
eslint@^8.5.0:
version "8.5.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f"
integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==
dependencies:
"@eslint/eslintrc" "^1.0.5"
"@humanwhocodes/config-array" "^0.9.2"
Expand Down

0 comments on commit 6988ce6

Please sign in to comment.