chore(lint): switched to a better lint config

This commit is contained in:
Corentin Thomasset 2023-05-28 23:13:24 +02:00 committed by Corentin THOMASSET
parent 4d2b037dbe
commit 33c9b6643f
178 changed files with 4105 additions and 3371 deletions

View file

@ -1,23 +1,3 @@
<template>
<div>
<n-input-group v-for="[key, { title, unit }] in Object.entries(units)" :key="key" mb-3 w-full>
<n-input-group-label style="width: 100px">
{{ title }}
</n-input-group-label>
<n-input-number
v-model:value="units[key].ref"
style="flex: 1"
@update:value="() => update(key as TemperatureScale)"
/>
<n-input-group-label style="width: 50px">
{{ unit }}
</n-input-group-label>
</n-input-group>
</div>
</template>
<script setup lang="ts">
import _ from 'lodash';
import { reactive } from 'vue';
@ -45,64 +25,64 @@ const units = reactive<
string | TemperatureScale,
{ title: string; unit: string; ref: number; toKelvin: (v: number) => number; fromKelvin: (v: number) => number }
>
>({
kelvin: {
title: 'Kelvin',
unit: 'K',
ref: 0,
toKelvin: _.identity,
fromKelvin: _.identity,
},
celsius: {
title: 'Celsius',
unit: '°C',
ref: 0,
toKelvin: convertCelsiusToKelvin,
fromKelvin: convertKelvinToCelsius,
},
fahrenheit: {
title: 'Fahrenheit',
unit: '°F',
ref: 0,
toKelvin: convertFahrenheitToKelvin,
fromKelvin: convertKelvinToFahrenheit,
},
rankine: {
title: 'Rankine',
unit: '°R',
ref: 0,
toKelvin: convertRankineToKelvin,
fromKelvin: convertKelvinToRankine,
},
delisle: {
title: 'Delisle',
unit: '°De',
ref: 0,
toKelvin: convertDelisleToKelvin,
fromKelvin: convertKelvinToDelisle,
},
newton: {
title: 'Newton',
unit: '°N',
ref: 0,
toKelvin: convertNewtonToKelvin,
fromKelvin: convertKelvinToNewton,
},
reaumur: {
title: 'Réaumur',
unit: '°Ré',
ref: 0,
toKelvin: convertReaumurToKelvin,
fromKelvin: convertKelvinToReaumur,
},
romer: {
title: 'Rømer',
unit: '°Rø',
ref: 0,
toKelvin: convertRomerToKelvin,
fromKelvin: convertKelvinToRomer,
},
});
>({
kelvin: {
title: 'Kelvin',
unit: 'K',
ref: 0,
toKelvin: _.identity,
fromKelvin: _.identity,
},
celsius: {
title: 'Celsius',
unit: '°C',
ref: 0,
toKelvin: convertCelsiusToKelvin,
fromKelvin: convertKelvinToCelsius,
},
fahrenheit: {
title: 'Fahrenheit',
unit: '°F',
ref: 0,
toKelvin: convertFahrenheitToKelvin,
fromKelvin: convertKelvinToFahrenheit,
},
rankine: {
title: 'Rankine',
unit: '°R',
ref: 0,
toKelvin: convertRankineToKelvin,
fromKelvin: convertKelvinToRankine,
},
delisle: {
title: 'Delisle',
unit: '°De',
ref: 0,
toKelvin: convertDelisleToKelvin,
fromKelvin: convertKelvinToDelisle,
},
newton: {
title: 'Newton',
unit: '°N',
ref: 0,
toKelvin: convertNewtonToKelvin,
fromKelvin: convertKelvinToNewton,
},
reaumur: {
title: 'Réaumur',
unit: '°Ré',
ref: 0,
toKelvin: convertReaumurToKelvin,
fromKelvin: convertKelvinToReaumur,
},
romer: {
title: 'Rømer',
unit: '°Rø',
ref: 0,
toKelvin: convertRomerToKelvin,
fromKelvin: convertKelvinToRomer,
},
});
function update(key: TemperatureScale) {
const { ref: value, toKelvin } = units[key];
@ -120,4 +100,22 @@ function update(key: TemperatureScale) {
update('kelvin');
</script>
<style lang="less" scoped></style>
<template>
<div>
<n-input-group v-for="[key, { title, unit }] in Object.entries(units)" :key="key" mb-3 w-full>
<n-input-group-label style="width: 100px">
{{ title }}
</n-input-group-label>
<n-input-number
v-model:value="units[key].ref"
style="flex: 1"
@update:value="() => update(key as TemperatureScale)"
/>
<n-input-group-label style="width: 50px">
{{ unit }}
</n-input-group-label>
</n-input-group>
</div>
</template>