Skip to content

Commit 5703d70

Browse files
committed
chore: update eslint and test and ci
1 parent 2a1784e commit 5703d70

15 files changed

+1991
-168
lines changed

.eslintrc.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ module.exports = {
33
env: {
44
browser: true,
55
node: true,
6+
'jest/globals': true,
67
},
78
parserOptions: {
8-
parser: 'babel-eslint',
9+
requireConfigFile: false,
10+
parser: '@babel/eslint-parser',
911
},
1012
extends: [
11-
'@nuxtjs',
13+
'@nuxtjs/eslint-config',
1214
'prettier',
13-
'prettier/vue',
1415
'plugin:prettier/recommended',
1516
'plugin:nuxt/recommended',
1617
],
17-
plugins: ['prettier'],
18+
plugins: ['prettier', 'jest'],
1819
// add your custom rules here
19-
rules: {},
20+
rules: {
21+
'vue/multi-word-component-names': 'off',
22+
},
2023
}

.github/workflows/ci.yml

+17-12
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,35 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ ubuntu-latest ]
20-
node: [ 14 ]
2120

2221
steps:
2322
- name: Checkout 🛎
2423
uses: actions/checkout@master
2524

26-
- name: Setup node env 🏗
27-
uses: actions/setup-node@v2.1.2
25+
- name: Setup node 🏗
26+
uses: actions/setup-node@v3
2827
with:
29-
node-version: ${{ matrix.node }}
28+
node-version-file: ".nvmrc"
29+
cache: "yarn"
30+
31+
- name: Get yarn cache directory path
32+
id: yarn-cache-dir-path
33+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
3034

3135
- name: Cache node_modules 📦
32-
uses: actions/cache@v2
36+
uses: actions/cache@v3
37+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3338
with:
34-
path: ~/.npm
35-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
39+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
40+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
3641
restore-keys: |
37-
${{ runner.os }}-node-
42+
${{ runner.os }}-yarn-e-
3843
39-
- name: Install dependencies 👨🏻‍💻
40-
run: npm ci
44+
- name: Install deps 👨🏻‍💻
45+
run: yarn --frozen-lockfile
4146

4247
- name: Run linter 👀
43-
run: npm run lint
48+
run: yarn lint
4449

4550
- name: Run tests 🧪
46-
run: npm run test
51+
run: yarn test

components/bulletins/BulletinCardCollection.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
</template>
2020

2121
<script>
22-
import { landingBulletinsConfig } from '@/configs/pageLanding'
2322
import BulletinCard from './BulletinCard.vue'
2423
import i18n from './BulletinCard.i18n'
24+
import { landingBulletinsConfig } from '@/configs/pageLanding'
2525
2626
export default {
2727
i18n,

components/core/buttons/TextButton.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ export default {
186186
.core-button.--bordered {
187187
& > a {
188188
@apply z-10 text-primary-100;
189-
background: linear-gradient(#121023, #121023) padding-box,
189+
background:
190+
linear-gradient(#121023, #121023) padding-box,
190191
linear-gradient(
191192
276.15deg,
192193
#61c8a4 0.74%,
@@ -243,7 +244,8 @@ export default {
243244
@apply z-20 opacity-0;
244245
border-radius: inherit;
245246
content: '';
246-
background: linear-gradient(#121023, #121023) padding-box,
247+
background:
248+
linear-gradient(#121023, #121023) padding-box,
247249
linear-gradient(
248250
96.26deg,
249251
#5fbeab 5.5%,

components/core/footer/FooterHistory.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
</template>
2222

2323
<script>
24+
import i18n from './Footer.i18n'
2425
import { landingFooterHistoryConfig } from '@/configs/pageLanding'
2526
import ExtLink from '@/components/core/links/ExtLink'
26-
import i18n from './Footer.i18n'
2727
2828
export default {
2929
i18n,

components/core/header/nav-bar/NavBar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
</template>
7474

7575
<script>
76-
import navBarItems from '@/components/core/header/nav-bar/nav-bar-items'
77-
import { ExtLink, LocaleLink } from '@/components/core/links'
7876
import NavBarItemDropdown from './NavBarItemDropdown'
7977
import i18n from './NavBar.i18n'
78+
import navBarItems from '@/components/core/header/nav-bar/nav-bar-items'
79+
import { ExtLink, LocaleLink } from '@/components/core/links'
8080
8181
export default {
8282
i18n,

components/core/header/nav-bar/NavBarHamburger.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@
9191
</template>
9292

9393
<script>
94+
import i18n from './NavBar.i18n'
95+
import navBarItems from './nav-bar-items'
9496
import IconHamburgerMenuIcon from '@/components/core/icons/IconHamburgerMenuIcon'
9597
import NavBarItemAccordion from '@/components/core/header/nav-bar/NavBarItemAccordion'
9698
import { ExtLink, LocaleLink } from '@/components/core/links'
97-
import i18n from './NavBar.i18n'
98-
import navBarItems from './nav-bar-items'
9999
100100
export default {
101101
i18n,

components/core/links/LocaleLink.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
return {
3636
'core-localeLink': true,
3737
highlight: this.highlight,
38-
'underline': this.underline,
38+
underline: this.underline,
3939
'--customized': this.customized,
4040
}
4141
},

components/core/markdown/MarkdownRenderer.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export default {
4444
}
4545
.markdown code {
4646
@apply rounded-md px-1 py-0.5;
47-
font-family: Source Sans Pro, -apple-system, Roboto, Helvetica Neue,
47+
font-family:
48+
Source Sans Pro,
49+
-apple-system,
50+
Roboto,
51+
Helvetica Neue,
4852
sans-serif !important;
4953
background-color: rgba(110, 118, 129, 0.4);
5054
}

components/events/RelatedCardCollection.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
</template>
3838

3939
<script>
40+
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
4041
import i18n from '@/i18n/conference/speeches.i18n'
4142
import SpeechCard from '@/components/events/SpeechCard'
42-
import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
4343
export default {
4444
i18n,
4545
name: 'RelatedCardCollection',

jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ module.exports = {
44
'^~/(.*)$': '<rootDir>/$1',
55
'^vue$': 'vue/dist/vue.common.js',
66
},
7+
testEnvironment: 'jsdom',
78
moduleFileExtensions: ['js', 'vue', 'json'],
89
transform: {
910
'^.+\\.js$': 'babel-jest',
10-
'.*\\.(vue)$': 'vue-jest',
11+
'.*\\.(vue)$': '@vue/vue2-jest',
1112
},
1213
collectCoverage: true,
1314
collectCoverageFrom: [

nuxt.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ export default {
7373

7474
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
7575
buildModules: [
76+
// https://go.nuxtjs.dev/eslint
77+
'@nuxtjs/eslint-module',
7678
// https://go.nuxtjs.dev/tailwindcss
7779
'@nuxtjs/tailwindcss',
7880
// https://github.com/nuxt-community/dotenv-module

package.json

+17-3
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,32 @@
2828
"vue-dompurify-html": "2.3.0"
2929
},
3030
"devDependencies": {
31-
"@nuxt/types": "^2.17.0",
31+
"@babel/core": "^7.22.9",
32+
"@babel/eslint-parser": "^7.22.9",
3233
"@fortawesome/free-brands-svg-icons": "^6.4.0",
3334
"@fortawesome/free-regular-svg-icons": "^6.4.0",
3435
"@fortawesome/free-solid-svg-icons": "^6.4.0",
35-
"@nuxt/eslint-config": "^0.1.1",
36+
"@nuxt/types": "^2.17.0",
3637
"@nuxtjs/dotenv": "^1.4.1",
38+
"@nuxtjs/eslint-config": "^12.0.0",
39+
"@nuxtjs/eslint-module": "^3.1.0",
3740
"@nuxtjs/fontawesome": "^1.1.2",
3841
"@nuxtjs/gtm": "^2.4.0",
3942
"@nuxtjs/router": "^1.7.0",
4043
"@nuxtjs/tailwindcss": "5.3.2",
4144
"@tailwindcss/aspect-ratio": "^0.4.2",
45+
"@vue/test-utils": "1",
46+
"@vue/vue2-jest": "28",
47+
"babel-jest": "^29.6.1",
4248
"eslint": "^8.45.0",
43-
"json-server": "^0.17.3"
49+
"eslint-config-prettier": "^8.8.0",
50+
"eslint-plugin-jest": "^27.2.3",
51+
"eslint-plugin-nuxt": "^4.0.0",
52+
"eslint-plugin-prettier": "^5.0.0",
53+
"jest": "^29.6.1",
54+
"jest-environment-jsdom": "^29.6.1",
55+
"json-server": "^0.17.3",
56+
"prettier": "^3.0.0",
57+
"prettier-plugin-tailwindcss": "^0.4.1"
4458
}
4559
}

tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656
},
5757
},
5858
stroke: (theme) => theme('colors'),
59-
boxShadow: (theme) => ({
59+
boxShadow: () => ({
6060
'pink-500': `6px 6px 0 theme('colors.pink.500')`,
6161
}),
6262
fill: (theme) => theme('colors'),

0 commit comments

Comments
 (0)