Skip to content

Commit

Permalink
Hopefully final change to get the linter behaving
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanswam committed Aug 27, 2020
1 parent 411518b commit 738d9d4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 36 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
experimentalDecorators: true,
},
rules: {
'@typescript-eslint/camelcase': 0,
},
};
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 180,
tabWidth: 2,
};
7 changes: 0 additions & 7 deletions .prettierrc.json

This file was deleted.

15 changes: 2 additions & 13 deletions src/compass-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ export class CompassCard extends LitElement {
return html`
<ha-card tabindex="0" aria-label=${`Compass: ${label}`} class="flex" @click=${(e) => this.handlePopup(e)}>
${this.renderHeader()}
<div class="content">
${this.renderCompass(direction, secondary_entity, direction_offset)}
</div>
<div class="content">${this.renderCompass(direction, secondary_entity, direction_offset)}</div>
</ha-card>
`;
}
Expand Down Expand Up @@ -142,16 +140,7 @@ export class CompassCard extends LitElement {
return html`
<div class="compass">
<div class="direction" style="${this.getConfigStyle(this._config.compass)}">
<p>
${abbreviation}
${secondary
? html`
<span>
${secondary.state} ${secondary.attributes.unit_of_measurement}
</span>
`
: ''}
</p>
<p>${abbreviation} ${secondary ? html` <span> ${secondary.state} ${secondary.attributes.unit_of_measurement} </span> ` : ''}</p>
</div>
<div class="indicator ${CompassCard.computeIndicator(this._config)}" style="transform: rotate(${CompassCard.positiveDegrees(degrees + direction_offset)}deg)"></div>
${this.renderNorthIndicator(direction_offset)}
Expand Down

0 comments on commit 738d9d4

Please sign in to comment.