-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run prettier and lint #806
Conversation
html` | ||
<ha-icon icon="${icon}"></ha-icon> | ||
` | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file are a result of running npm run format
. (I did not edit this file “manually”.)
@@ -41,14 +41,14 @@ export const parseVariable = ( | |||
const res = | |||
'template' in config && isDefined(config.template) | |||
? { ...omit(config, 'template'), ...config.template(stateObj, hass) } | |||
: <ListVariableConfig | LevelVariableConfig | TextVariableConfig>{ ...config }; | |||
: ({ ...config } as ListVariableConfig | LevelVariableConfig | TextVariableConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file were done “manually” by me, in order to address the following npm run lint
errors:
$ npm run lint
...
nielsfaber/scheduler-card/src/standard-configuration/variables.ts
44:9 error Use 'as ListVariableConfig | LevelVariableConfig | TextVariableConfig' instead of '<ListVariableConfig | LevelVariableConfig | TextVariableConfig>' @typescript-eslint/consistent-type-assertions
51:12 error Use 'as TextVariableConfig' instead of '<TextVariableConfig>' @typescript-eslint/consistent-type-assertions
@@ -14,8 +14,10 @@ module.exports = { | |||
"@typescript-eslint/camelcase": 0, | |||
"@typescript-eslint/no-explicit-any": "off", | |||
"@typescript-eslint/explicit-function-return-type": "off", | |||
"@typescript-eslint/no-empty-function": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule exception was added to suppress the following npm run lint
errors:
nielsfaber/scheduler-card/src/data/websockets.ts
48:20 error Unexpected empty arrow function 'confirm' @typescript-eslint/no-empty-function
49:19 error Unexpected empty arrow function 'cancel' @typescript-eslint/no-empty-function
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-use-before-define": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule exception was added to suppress the following npm run lint
errors:
nielsfaber/scheduler-card/src/standard-configuration/standardActions.ts
35:28 error 'parseAction' was used before it was defined @typescript-eslint/no-use-before-define
79:16 error 'parseActionVariable' was used before it was defined @typescript-eslint/no-use-before-define
nielsfaber/scheduler-card/src/standard-configuration/standardStates.ts
38:33 error 'getStateName' was used before it was defined @typescript-eslint/no-use-before-define
nielsfaber/scheduler-card/src/standard-configuration/variables.ts
47:12 error 'parseListVariable' was used before it was defined @typescript-eslint/no-use-before-define
49:12 error 'parseLevelVariable' was used before it was defined @typescript-eslint/no-use-before-define
Hello, thank you for helping out. |
To answer your question, I only use |
Thanks for letting me know. It was too late for PR #808 as I had already done the work. I have added a commit to this PR that proposes adding a |
Got it. 👍 Here’s an interesting thing that I noticed: Deleting the Babel dependency and related packages (including
|
While working on another PR (not pushed yet), I found that
npm run format
andnpm run lint
would modify not only the code I was writing, but also pre-existing files in the main branch. In order to avoid unnecessary noise in my other PR, I thought I would sort the pre-existing issues first, through this PR.While at it, @nielsfaber here’s a question: Are contributors supposed to run
npm run build
that callsbabel
? I have found that file dist/scheduler-card.js in release v3.2.12 (current latest), as well as the same file in the main branch, looks more likebabel
ornpm run build
were not executed. It looks more like it was created with justnpm run rollup
. Having said that, I was not able to reproduce the exact file with either command. Here’s what I get:What is the correct procedure to generate
dist/scheduler-card.js
?