Refactor code to comply with ESLint rules

Major refactoring using ESLint with rules from AirBnb and Vue.

Enable most of the ESLint rules and do necessary linting in the code.
Also add more information for rules that are disabled to describe what
they are and why they are disabled.

Allow logging (`console.log`) in test files, and in development mode
(e.g. when working with `npm run serve`), but disable it when
environment is production (as pre-configured by Vue). Also add flag
(`--mode production`) in `lint:eslint` command so production linting is
executed earlier in lifecycle.

Disable rules that requires a separate work. Such as ESLint rules that
are broken in TypeScript: no-useless-constructor (eslint/eslint#14118)
and no-shadow (eslint/eslint#13014).
This commit is contained in:
undergroundwires
2022-01-02 18:20:14 +01:00
parent 96265b75de
commit 5b1fbe1e2f
341 changed files with 16126 additions and 15101 deletions

View File

@@ -1,17 +1,17 @@
<template>
<div class="scripts">
<div class="scripts">
<TheScriptsMenu v-on:viewChanged="currentView = $event" />
<HorizontalResizeSlider class="row"
verticalMargin="15px" firstInitialWidth="55%"
firstMinWidth="20%" secondMinWidth="20%">
<template v-slot:first>
<TheScriptsView :currentView="currentView" />
</template>
<template v-slot:second>
<TheCodeArea theme="xcode" />
</template>
verticalMargin="15px" firstInitialWidth="55%"
firstMinWidth="20%" secondMinWidth="20%">
<template v-slot:first>
<TheScriptsView :currentView="currentView" />
</template>
<template v-slot:second>
<TheCodeArea theme="xcode" />
</template>
</HorizontalResizeSlider>
</div>
</div>
</template>
<script lang="ts">
@@ -31,14 +31,14 @@ import { ViewType } from '@/presentation/components/Scripts/Menu/View/ViewType';
},
})
export default class TheScriptArea extends Vue {
public currentView = ViewType.Cards;
public currentView = ViewType.Cards;
}
</script>
<style scoped lang="scss">
.scripts {
> * + * {
margin-top: 15px;
}
> * + * {
margin-top: 15px;
}
}
</style>