From a8ead533108e100b2d4a250ee6e99b0d310aab31 Mon Sep 17 00:00:00 2001 From: Thomas Allmer Date: Wed, 21 Aug 2019 11:30:51 +0200 Subject: [PATCH] chore: update linting --- .eslintrc.js | 1 + packages/fieldset/test/lion-fieldset.test.js | 8 +++----- packages/form-system/stories/index.stories.js | 9 +++++---- packages/input-date/src/LionInputDate.js | 4 +--- packages/input-iban/src/validators.js | 4 +--- packages/select-rich/src/LionSelectRich.js | 4 +--- scripts/rewrite-links.js | 4 +--- wallaby.js | 8 ++------ 8 files changed, 15 insertions(+), 27 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b5540c30f..8be869ed8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -20,6 +20,7 @@ module.exports = { 'no-console': 'off', 'no-unused-expressions': 'off', 'class-methods-use-this': 'off', + 'max-classes-per-file': 'off', }, }, ], diff --git a/packages/fieldset/test/lion-fieldset.test.js b/packages/fieldset/test/lion-fieldset.test.js index c5c436d6e..8bc3d15ff 100644 --- a/packages/fieldset/test/lion-fieldset.test.js +++ b/packages/fieldset/test/lion-fieldset.test.js @@ -650,11 +650,9 @@ describe('', () => { it('has correct validation afterwards', async () => { const isCat = modelValue => ({ isCat: modelValue === 'cat' }); - const containsA = modelValues => { - return { - containsA: modelValues.color ? modelValues.color.indexOf('a') > -1 : false, - }; - }; + const containsA = modelValues => ({ + containsA: modelValues.color ? modelValues.color.indexOf('a') > -1 : false, + }); const el = await fixture(html` <${tag} .errorValidators=${[[containsA]]}> diff --git a/packages/form-system/stories/index.stories.js b/packages/form-system/stories/index.stories.js index ae068c7c6..4179ccad1 100644 --- a/packages/form-system/stories/index.stories.js +++ b/packages/form-system/stories/index.stories.js @@ -14,8 +14,9 @@ import '@lion/input-amount/lion-input-amount.js'; import '@lion/input-date/lion-input-date.js'; import '@lion/input-email/lion-input-email.js'; -storiesOf('Forms|Form', module).add('Umbrella form', () => { - return html` +storiesOf('Forms|Form', module).add( + 'Umbrella form', + () => html`
{
- `; -}); + `, +); diff --git a/packages/input-date/src/LionInputDate.js b/packages/input-date/src/LionInputDate.js index 53dc41f54..a75fc533e 100644 --- a/packages/input-date/src/LionInputDate.js +++ b/packages/input-date/src/LionInputDate.js @@ -19,9 +19,7 @@ export class LionInputDate extends FieldCustomMixin(LocalizeMixin(LionInput)) { constructor() { super(); - this.parser = (value, options) => { - return value === '' ? undefined : parseDate(value, options); - }; + this.parser = (value, options) => (value === '' ? undefined : parseDate(value, options)); this.formatter = formatDate; } diff --git a/packages/input-iban/src/validators.js b/packages/input-iban/src/validators.js index a05b5a1f6..0530c3afc 100644 --- a/packages/input-iban/src/validators.js +++ b/packages/input-iban/src/validators.js @@ -1,8 +1,6 @@ import { isValidIBAN } from '@bundled-es-modules/ibantools/ibantools.js'; -export const isIBAN = value => { - return isValidIBAN(value); -}; +export const isIBAN = value => isValidIBAN(value); export const isIBANValidator = () => [(...params) => ({ isIBAN: isIBAN(...params) })]; diff --git a/packages/select-rich/src/LionSelectRich.js b/packages/select-rich/src/LionSelectRich.js index 2a05e9388..34302ee67 100644 --- a/packages/select-rich/src/LionSelectRich.js +++ b/packages/select-rich/src/LionSelectRich.js @@ -89,9 +89,7 @@ export class LionSelectRich extends FormRegistrarMixin( get slots() { return { ...super.slots, - invoker: () => { - return document.createElement('lion-select-invoker'); - }, + invoker: () => document.createElement('lion-select-invoker'), }; } diff --git a/scripts/rewrite-links.js b/scripts/rewrite-links.js index b79bbd3ef..122d89444 100644 --- a/scripts/rewrite-links.js +++ b/scripts/rewrite-links.js @@ -74,9 +74,7 @@ function rewriteLinksInMdContent(mdContent, filePath, cfg = rewriteLinksConfig) return newHref; }; - const mdLink = (href, title, text) => { - return `[${text}](${rewrite(href)}${title ? ` ${title}` : ''})`; - }; + const mdLink = (href, title, text) => `[${text}](${rewrite(href)}${title ? ` ${title}` : ''})`; const resultLinks = []; // /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/ diff --git a/wallaby.js b/wallaby.js index bf8f99476..0c4123a16 100644 --- a/wallaby.js +++ b/wallaby.js @@ -3,13 +3,9 @@ const wallabyWebpack = require('wallaby-webpack'); // eslint-disable-line import // filter packages, e.g. 'core' / '{radio,radio-button}' / '{form,input*}' const packagePattern = '*'; -const replaceAll = (str, oldValue, newValue) => { - return str.split(oldValue).join(newValue); -}; +const replaceAll = (str, oldValue, newValue) => str.split(oldValue).join(newValue); -const countOccurences = (str, subbstr) => { - return str.split(subbstr).length - 1; -}; +const countOccurences = (str, subbstr) => str.split(subbstr).length - 1; const makeLionImportsRelative = file => { // example: