Skip to content

Commit ef33e0b

Browse files
committed
chore: Switched to nuxt eslint config + Bumped dependencies + Updated CI
1 parent 0b52e5c commit ef33e0b

File tree

22 files changed

+2664
-2990
lines changed

22 files changed

+2664
-2990
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ insert_final_newline = true
1010

1111
[*.md]
1212
trim_trailing_whitespace = false
13+
14+
[{*.yml,*.yaml}]
15+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 103 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,108 @@
11
name: 'Test & Release'
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
1010

1111
jobs:
12-
test:
13-
name: 'Test package'
14-
runs-on: ubuntu-latest
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
19-
- uses: actions/setup-node@v4
20-
with:
21-
node-version: '22'
22-
cache: 'npm'
23-
24-
- name: Install
25-
run: |
26-
npm install
27-
npm run dev:prepare
28-
29-
- name: Lint
30-
run: |
31-
npm run lint:es
32-
npm run lint:types
33-
34-
- name: Test
35-
run: npm run test
36-
37-
release:
38-
name: 'Release package'
39-
needs: [ test ]
40-
runs-on: ubuntu-latest
41-
if: |
42-
github.event_name == 'push' &&
43-
!contains(github.event.head_commit.message, '/renovate/') &&
44-
!contains(github.event.head_commit.message, '[skip-release]')
45-
46-
steps:
47-
- uses: actions/checkout@v4
48-
49-
- uses: actions/setup-node@v4
50-
with:
51-
node-version: '22'
52-
cache: 'npm'
53-
54-
- name: Install
55-
run: |
56-
npm install
57-
npm run dev:prepare
58-
59-
- name: Release
60-
run: |
61-
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}
62-
npm run release:ci
63-
64-
bump-version:
65-
name: 'Bump package version'
66-
needs: [ test ]
67-
runs-on: ubuntu-latest
68-
if: |
69-
github.event_name == 'push' &&
70-
contains(github.event.head_commit.message, '/renovate/')
71-
72-
steps:
73-
- uses: actions/checkout@v4
74-
75-
- uses: actions/setup-node@v4
76-
with:
77-
node-version: '22'
78-
cache: 'npm'
79-
80-
- name: Install
81-
run: |
82-
npm install
83-
npm run dev:prepare
84-
85-
- name: Bump version
86-
id: bump_version
87-
run: |
88-
git config user.name "github-actions[bot]"
89-
git config user.email "github-actions[bot]@users.noreply.github.com"
90-
91-
NEW_VERSION=$(npm version patch -m "chore: bumped package version to %s")
92-
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
93-
94-
- name: Update CHANGELOG.md
95-
run: |
96-
echo -e "# $NEW_VERSION\n- Bumped dependencies\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
97-
git add CHANGELOG.md
98-
99-
- name: Push changes
100-
run: |
101-
git commit --amend --no-edit
102-
git push origin main --tags
103-
104-
- name: Release new version
105-
run: |
106-
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}
107-
npm run release:ci
12+
test:
13+
name: 'Test package'
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: '22'
22+
cache: 'npm'
23+
24+
- name: Install
25+
run: |
26+
npm install
27+
npm run dev:prepare
28+
29+
- name: Lint
30+
run: |
31+
npm run lint:es
32+
npm run lint:types
33+
34+
- name: Test
35+
run: npm run test
36+
37+
release:
38+
name: 'Release package'
39+
needs: [ test ]
40+
runs-on: ubuntu-latest
41+
if: |
42+
github.event_name == 'push' &&
43+
github.ref == 'refs/heads/main' &&
44+
!contains(github.head_commit.message, '[skip-release]') &&
45+
!startsWith(github.head_commit.message, 'chore: bumped package version')
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- uses: actions/setup-node@v4
51+
with:
52+
node-version: '22'
53+
cache: 'npm'
54+
55+
- name: Install
56+
run: |
57+
npm install
58+
npm run dev:prepare
59+
60+
- name: Release
61+
run: |
62+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}
63+
npm run release:ci
64+
65+
bump-version:
66+
name: 'Bump package version'
67+
needs: [ test ]
68+
runs-on: ubuntu-latest
69+
if: |
70+
github.event_name == 'push' &&
71+
startsWith(github.ref, 'refs/heads/renovate/')
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- uses: actions/setup-node@v4
77+
with:
78+
node-version: '22'
79+
cache: 'npm'
80+
81+
- name: Install
82+
run: |
83+
npm install
84+
npm run dev:prepare
85+
86+
- name: Bump version
87+
id: bump_version
88+
run: |
89+
git config user.name "github-actions[bot]"
90+
git config user.email "github-actions[bot]@users.noreply.github.com"
91+
92+
NEW_VERSION=$(npm version patch -m "chore: bumped package version to %s")
93+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
94+
95+
- name: Update CHANGELOG.md
96+
run: |
97+
echo -e "# $NEW_VERSION\n- Bumped dependencies\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
98+
git add CHANGELOG.md
99+
100+
- name: Push changes
101+
run: |
102+
git commit --amend --no-edit
103+
git push origin main --tags
104+
105+
- name: Release new version
106+
run: |
107+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}
108+
npm run release:ci

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
# 1.0.13
2+
- Switched to nuxt eslint config
3+
- Bumped dependencies
4+
15
# 1.0.12
26
- Bumped dependencies
37

8+
# 1.0.11
9+
- Bumped dependencies
10+
411
# 1.0.10
512
- Bumped dependencies
613

eslint.config.js

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,46 @@
1-
import antfu from '@antfu/eslint-config';
1+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat';
22

3-
export default antfu(
4-
{
5-
vue: true,
6-
typescript: true,
7-
},
8-
{
9-
files: ['**/*.vue'],
3+
export default createConfigForNuxt({
4+
features: {
5+
tooling: true,
6+
typescript: {
7+
strict: true,
8+
},
9+
stylistic: {
10+
indent: 4,
11+
semi: true,
12+
},
13+
},
14+
}).override('nuxt/vue/rules', {
15+
rules: {
16+
'vue/block-lang': [ 'error', { script: { lang: 'ts' } } ],
17+
'vue/block-order': [ 'error', { order: [ 'script', 'template', 'style' ] } ],
18+
'vue/component-name-in-template-casing': [ 'error', 'PascalCase', { registeredComponentsOnly: false } ],
19+
'vue/multi-word-component-names': 'off',
20+
'vue/no-ref-object-reactivity-loss': 'error',
21+
},
22+
}).override('nuxt/stylistic', {
1023
rules: {
11-
'style/indent': 'off',
12-
'vue/multi-word-component-names': 'off',
13-
'vue/no-setup-props-destructure': 'off',
14-
'vue/no-multiple-template-root': 'off',
15-
'vue/html-indent': ['warn', 4],
16-
'vue/script-indent': ['warn', 4, {
17-
baseIndent: 1,
18-
}],
24+
'@stylistic/array-bracket-spacing': [ 'error', 'always' ],
25+
'@stylistic/comma-dangle': [ 'error', 'always-multiline' ],
1926
},
20-
},
21-
{
22-
files: ['**/*.ts'],
27+
}).override('nuxt/import/rules', {
2328
rules: {
24-
'style/indent': ['warn', 4],
29+
'import/order': [ 'error', {
30+
'groups': [
31+
'type',
32+
[ 'builtin', 'external' ],
33+
[ 'internal', 'parent', 'sibling', 'index', 'object' ],
34+
],
35+
'newlines-between': 'always',
36+
'alphabetize': {
37+
order: 'asc',
38+
},
39+
} ],
2540
},
26-
},
27-
{
41+
}).append({
2842
rules: {
29-
'style/semi': ['warn', 'always'],
30-
'antfu/top-level-function': 'off',
31-
'antfu/if-newline': 'off',
43+
'prefer-template': [ 'error' ],
44+
'no-unused-vars': [ 'error', { argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' } ],
3245
},
33-
},
34-
);
46+
});

0 commit comments

Comments
 (0)