Skip to content

Commit 19b368d

Browse files
feat: use eslint v9 (#26)
* feat: add Nuxt eslint module * feat: add eslint config * fix: eslint errors * chore: remove legacy .eslintrc.js file * chore: format package json file * feat: use editorconfig as an eslint config base * refactor: lint:* script names * fix: lint:* scripts * fix(lint): github action scripts * fix(lint): define eslint indent * chore: lint fix * chore(button): lint fix * chore: lint fix --------- Co-authored-by: Manuel Odelain <manuel@rezo-zero.com>
1 parent c80570a commit 19b368d

File tree

82 files changed

+2668
-1075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2668
-1075
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ trim_trailing_whitespace = false
1414

1515
[Makefile]
1616
indent_style = tab
17-
18-
[package.json]
19-
indent_size = 2

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ jobs:
2929
- name: Install dependencies
3030
run: pnpm install
3131
- name: Lint scripts
32-
run: pnpm lint:script
32+
run: pnpm lint:js
3333
- name: Lint styles
34-
run: pnpm lint:style
34+
run: pnpm lint:css

.prettierrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ pnpm lint
6262
### Lint and format script (JS / Vue files)
6363

6464
```bash
65-
pnpm lint:script
65+
pnpm lint:js
6666
```
6767

6868
### Lint and format style (CSS / SCSS / Vue files)
6969

7070
```bash
71-
pnpm lint:style
71+
pnpm lint:css
7272
```
7373

7474
### Lint fix (script and style)

assets/scss/functions/_list.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
}
1818

19-
@if $result != null {
19+
@if $result {
2020
$result: str-slice($result, str-length($glue) + 1, -1);
2121
}
2222

components/atoms/VBlock/Default.stories.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
const walker = {
33
'@id': '',
44
'@type': '',
5-
item: {
5+
'item': {
66
slug: 'block-slug',
77
},
8-
children: [],
8+
'children': [],
99
}
1010
</script>
1111

components/atoms/VBlock/VBlock.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ defineProps<VBlockProps>()
99
</script>
1010
1111
<template>
12-
<component :is="tag || 'section'" :id="item?.slug">
12+
<component
13+
:is="tag || 'section'"
14+
:id="item?.slug"
15+
>
1316
<slot />
1417
</component>
1518
</template>

components/atoms/VCheckbox/VCheckbox.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<template>
22
<span :class="$style.root">
3-
<VIcon name="check" :class="$style.icon" />
3+
<VIcon
4+
name="check"
5+
:class="$style.icon"
6+
/>
47
</span>
58
</template>
69

components/atoms/VHiddenInput/VHiddenInput.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@ defineProps<FormElementProps>()
55
</script>
66

77
<template>
8-
<input :id="id" type="hidden" :name="name" :value="modelValue" />
8+
<input
9+
:id="id"
10+
type="hidden"
11+
:name="name"
12+
:value="modelValue"
13+
>
914
</template>

components/atoms/VIcon/Default.stories.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<VIcon name="check" />
55
</NuxtStoryVariant>
66
<NuxtStoryVariant title="Default size">
7-
<VIcon name="check" width="92" height="92" />
7+
<VIcon
8+
name="check"
9+
width="92"
10+
height="92"
11+
/>
812
</NuxtStoryVariant>
913
</NuxtStory>
1014
</template>

components/atoms/VIcon/VIcon.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ defineProps({
1616
</script>
1717

1818
<template>
19-
<SvgIcon :name="name" :width="width" :height="height" />
19+
<SvgIcon
20+
:name="name"
21+
:width="width"
22+
:height="height"
23+
/>
2024
</template>

components/atoms/VMarkdown/NewLine.stories.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,23 @@ const htmlHexaCode = `Title &#x0A; new line`
99
<template>
1010
<NuxtStory>
1111
<NuxtStoryVariant title="Content with \n\n">
12-
<VMarkdown :content="content" class="text-button-md" />
12+
<VMarkdown
13+
:content="content"
14+
class="text-button-md"
15+
/>
1316
</NuxtStoryVariant>
1417
<NuxtStoryVariant title="Template string with backspace">
15-
<VMarkdown :content="contentTemplateString" class="text-button-md" />
18+
<VMarkdown
19+
:content="contentTemplateString"
20+
class="text-button-md"
21+
/>
1622
</NuxtStoryVariant>
1723
<NuxtStoryVariant title="Hexa code">
18-
<VMarkdown :class="$style['html-code']" :content="htmlHexaCode" class="text-button-md" />
24+
<VMarkdown
25+
:class="$style['html-code']"
26+
:content="htmlHexaCode"
27+
class="text-button-md"
28+
/>
1929
</NuxtStoryVariant>
2030
</NuxtStory>
2131
</template>

components/atoms/VMarkdown/VMarkdown.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export default defineComponent({
3838
3939
if (props.parsed) {
4040
return props.content
41-
} else {
41+
}
42+
else {
4243
const options = { renderer }
4344
4445
if (props.inline) return marked.parseInline(content, options)
@@ -78,11 +79,11 @@ export default defineComponent({
7879
}
7980
8081
onMounted(() => {
81-
root.value?.querySelectorAll('a').forEach((link) => link.addEventListener('click', onLinkClick))
82+
root.value?.querySelectorAll('a').forEach(link => link.addEventListener('click', onLinkClick))
8283
})
8384
8485
onBeforeUnmount(() => {
85-
root.value?.querySelectorAll('a').forEach((link) => link.removeEventListener('click', onLinkClick))
86+
root.value?.querySelectorAll('a').forEach(link => link.removeEventListener('click', onLinkClick))
8687
})
8788
8889
return () =>

components/atoms/VSpinner/Default.stories.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ function toggle() {
1010
<NuxtStory>
1111
<template #aside>
1212
<h3>Current state: {{ playState }}</h3>
13-
<button @click="toggle">Toggle state</button>
13+
<button @click="toggle">
14+
Toggle state
15+
</button>
1416
</template>
15-
<VSpinner :play-state="playState" :class="$style.root" />
17+
<VSpinner
18+
:play-state="playState"
19+
:class="$style.root"
20+
/>
1621
</NuxtStory>
1722
</template>
1823

components/atoms/VSpinner/VSpinner.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ withDefaults(
1010
</script>
1111

1212
<template>
13-
<svg :class="$style.root" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg">
14-
<circle :class="$style.circle" cx="25" cy="25" r="20" stroke-width="5" />
13+
<svg
14+
:class="$style.root"
15+
viewBox="0 0 50 50"
16+
xmlns="http://www.w3.org/2000/svg"
17+
>
18+
<circle
19+
:class="$style.circle"
20+
cx="25"
21+
cy="25"
22+
r="20"
23+
stroke-width="5"
24+
/>
1525
</svg>
1626
</template>
1727

components/atoms/VTransitionExpand/VTransitionExpand.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
function callDoneCallback(element: Element, done: () => void) {
55
const animation = element
66
.getAnimations()
7-
.filter((animation) => (animation as CSSTransition).transitionProperty === 'height')[0]
7+
.filter(animation => (animation as CSSTransition).transitionProperty === 'height')[0]
88
99
if (animation) animation.finished.then(done)
1010
else done()
@@ -25,7 +25,7 @@ function onEnter(element: Element, done: () => void) {
2525
2626
// Force repaint to make sure the
2727
// animation is triggered correctly.
28-
// eslint-disable-next-line no-unused-expressions
28+
2929
getComputedStyle(element).height
3030
3131
requestAnimationFrame(() => {
@@ -44,7 +44,7 @@ function onLeave(element: Element, done: () => void) {
4444
4545
// Force repaint to make sure the
4646
// animation is triggered correctly.
47-
// eslint-disable-next-line no-unused-expressions
47+
4848
getComputedStyle(element).height
4949
5050
requestAnimationFrame(() => {
@@ -56,7 +56,12 @@ function onLeave(element: Element, done: () => void) {
5656
</script>
5757

5858
<template>
59-
<Transition name="expand" @enter="onEnter" @after-enter="onAfterEnter" @leave="onLeave">
59+
<Transition
60+
name="expand"
61+
@enter="onEnter"
62+
@after-enter="onAfterEnter"
63+
@leave="onLeave"
64+
>
6065
<!-- eslint-disable-next-line vue/require-toggle-inside-transition -->
6166
<slot />
6267
</Transition>

components/molecules/VButton/Default.stories.vue

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,68 @@ import { vButtonSizes as sizes } from '~/components/molecules/VButton/VButton.vu
77
<NuxtStoryVariant title="Default">
88
<VStoryThemeProvider>
99
<VButton label="Button outlined" />
10-
<VButton icon-name="check" label="Button with icon" />
10+
<VButton
11+
icon-name="check"
12+
label="Button with icon"
13+
/>
1114
<VButton icon-name="check" />
1215
</VStoryThemeProvider>
1316
</NuxtStoryVariant>
1417
<NuxtStoryVariant title="Outlined">
1518
<VStoryThemeProvider>
16-
<VButton label="Button outlined" outlined />
17-
<VButton icon-name="check" label="Button with icon" outlined />
18-
<VButton icon-name="check" outlined />
19+
<VButton
20+
label="Button outlined"
21+
outlined
22+
/>
23+
<VButton
24+
icon-name="check"
25+
label="Button with icon"
26+
outlined
27+
/>
28+
<VButton
29+
icon-name="check"
30+
outlined
31+
/>
1932
</VStoryThemeProvider>
2033
</NuxtStoryVariant>
2134

2235
<NuxtStoryVariant title="Filled">
2336
<VStoryThemeProvider>
24-
<VButton filled label="Button dark theme" />
25-
<VButton filled icon-name="check" label="Button icon" />
26-
<VButton filled icon-name="check" />
37+
<VButton
38+
filled
39+
label="Button dark theme"
40+
/>
41+
<VButton
42+
filled
43+
icon-name="check"
44+
label="Button icon"
45+
/>
46+
<VButton
47+
filled
48+
icon-name="check"
49+
/>
2750
</VStoryThemeProvider>
2851
</NuxtStoryVariant>
2952

3053
<NuxtStoryVariant title="Disabled">
3154
<VStoryThemeProvider>
32-
<VButton disabled icon-name="check" label="default disabled" />
33-
<VButton disabled icon-name="check" label="outlined disabled" outlined />
34-
<VButton disabled filled icon-name="check" label="filled disabled" />
55+
<VButton
56+
disabled
57+
icon-name="check"
58+
label="default disabled"
59+
/>
60+
<VButton
61+
disabled
62+
icon-name="check"
63+
label="outlined disabled"
64+
outlined
65+
/>
66+
<VButton
67+
disabled
68+
filled
69+
icon-name="check"
70+
label="filled disabled"
71+
/>
3572
</VStoryThemeProvider>
3673
</NuxtStoryVariant>
3774

@@ -48,8 +85,16 @@ import { vButtonSizes as sizes } from '~/components/molecules/VButton/VButton.vu
4885
</NuxtStoryVariant>
4986

5087
<NuxtStoryVariant title="Theme prop">
51-
<VButton :label="`Button Dark`" theme="dark" outlined />
52-
<VButton :label="`Button Dark`" theme="light" outlined />
88+
<VButton
89+
:label="`Button Dark`"
90+
theme="dark"
91+
outlined
92+
/>
93+
<VButton
94+
:label="`Button Dark`"
95+
theme="light"
96+
outlined
97+
/>
5398
</NuxtStoryVariant>
5499
</NuxtStory>
55100
</template>

0 commit comments

Comments
 (0)