Skip to content

Commit f5a4a82

Browse files
committed
workflow: replace Rome with ESLint
1 parent 95ebead commit f5a4a82

File tree

10 files changed

+2706
-1172
lines changed

10 files changed

+2706
-1172
lines changed

.eslintrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "@antfu",
3+
"rules": {
4+
"@typescript-eslint/brace-style": ["error", "1tbs", { "allowSingleLine": true }],
5+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
6+
"curly": ["error", "multi-line"],
7+
"no-console": "off",
8+
"vue/attribute-hyphenation": "off",
9+
"vue/component-tags-order": ["error", { "order": [["script", "template"], "style"] }],
10+
"vue/custom-event-name-casing": "off",
11+
"vue/max-attributes-per-line": ["error", { "singleline": 1, "multiline": 1 }],
12+
"vue/no-deprecated-v-bind-sync": "off",
13+
"vue/no-deprecated-v-on-native-modifier": "off",
14+
"vue/no-deprecated-destroyed-lifecycle": "off",
15+
"vue/no-deprecated-dollar-listeners-api": "off",
16+
"vue/no-deprecated-dollar-scopedslots-api": "off",
17+
"vue/singleline-html-element-content-newline": "off"
18+
}
19+
}

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'ci'
1+
name: ci
22
on:
33
push:
44
branches:
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/setup-node@v3
2626
with:
2727
node-version: lts/*
28-
cache: 'pnpm'
28+
cache: pnpm
2929

3030
- name: Use npmmirror registry
3131
run: pnpm config set registry https://registry.npmmirror.com
@@ -49,7 +49,7 @@ jobs:
4949
uses: actions/setup-node@v3
5050
with:
5151
node-version: lts/*
52-
cache: 'pnpm'
52+
cache: pnpm
5353

5454
- name: Use npmmirror registry
5555
run: pnpm config set registry https://registry.npmmirror.com

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<a href="https://github.com/cloydlau/json-editor-vue/actions/workflows/ci.yml"><img alt="build status" src="https://github.com/cloydlau/json-editor-vue/actions/workflows/ci.yml/badge.svg?branch=main"></a>
1717
<a href="https://bundlephobia.com/package/json-editor-vue"><img alt="minzipped size" src="https://img.shields.io/bundlephobia/minzip/json-editor-vue"></a>
1818
<br>
19-
<a href="https://www.jsdelivr.com/package/npm/json-editor-vue"><img alt="jsdelivr downloads" src="https://data.jsdelivr.com/v1/package/npm/json-editor-vue/badge?style=rounded"></a>
19+
<a href="https://cdn.jsdelivr.net/npm/json-editor-vue"><img alt="jsdelivr downloads" src="https://data.jsdelivr.com/v1/package/npm/json-editor-vue/badge?style=rounded"></a>
2020
<a href="https://npmcharts.com/compare/json-editor-vue"><img alt="npm downloads" src="https://img.shields.io/npm/dm/json-editor-vue?logo=npm&color=rgba(203,0,0,0.9)"></a>
2121
<br>
22-
<a href="https://rome.tools"><img alt="code style" src="https://img.shields.io/badge/code_style-Rome-FFC905.svg?logo=rome"></a>
22+
<a href="https://standardjs.com"><img alt="code style" src="https://img.shields.io/badge/code_style-Standard-F3DF49.svg"></a>
2323
<a href="https://conventionalcommits.org"><img alt="conventional commits" src="https://img.shields.io/badge/commits-Conventional-FE5196.svg?logo=conventionalcommits&logoColor=white"></a>
2424
<a href="https://github.com/cloydlau/json-editor-vue#develop"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
2525
</p>
@@ -544,9 +544,11 @@ export default {
544544
<script setup>
545545
import { ref } from 'vue'
546546
547-
const JsonEditorVue = () => process.client
548-
? import('json-editor-vue')
549-
: Promise.resolve({ render: (h) => h('div') })
547+
function JsonEditorVue() {
548+
return process.client
549+
? import('json-editor-vue')
550+
: Promise.resolve({ render: h => h('div') })
551+
}
550552
551553
const value = ref()
552554
</script>
@@ -643,13 +645,14 @@ export default {
643645
<script>
644646
import Vue from 'vue'
645647
import VCA from '@vue/composition-api'
648+
646649
Vue.use(VCA)
647650
648651
export default {
649652
components: {
650653
JsonEditorVue: () => process.client
651654
? import('json-editor-vue')
652-
: Promise.resolve({ render: (h) => h('div') }),
655+
: Promise.resolve({ render: h => h('div') }),
653656
},
654657
data() {
655658
return {

__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import JsonEditorVue from '../src/index'
21
import { mount } from '@vue/test-utils'
32
import { expect, test } from 'vitest'
3+
import JsonEditorVue from '../src/index'
44

55
test('string value in text mode', async () => {
66
const wrapper = mount(JsonEditorVue, {

docs/README.zh-CN.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<a href="https://github.com/cloydlau/json-editor-vue/actions/workflows/ci.yml"><img alt="build status" src="https://github.com/cloydlau/json-editor-vue/actions/workflows/ci.yml/badge.svg?branch=main"></a>
1717
<a href="https://bundlephobia.com/package/json-editor-vue"><img alt="minzipped size" src="https://img.shields.io/bundlephobia/minzip/json-editor-vue"></a>
1818
<br>
19-
<a href="https://www.jsdelivr.com/package/npm/json-editor-vue"><img alt="jsdelivr downloads" src="https://data.jsdelivr.com/v1/package/npm/json-editor-vue/badge?style=rounded"></a>
19+
<a href="https://cdn.jsdelivr.net/npm/json-editor-vue"><img alt="jsdelivr downloads" src="https://data.jsdelivr.com/v1/package/npm/json-editor-vue/badge?style=rounded"></a>
2020
<a href="https://npmcharts.com/compare/json-editor-vue"><img alt="npm downloads" src="https://img.shields.io/npm/dm/json-editor-vue?logo=npm&color=rgba(203,0,0,0.9)"></a>
2121
<br>
22-
<a href="https://rome.tools"><img alt="code style" src="https://img.shields.io/badge/code_style-Rome-FFC905.svg?logo=rome"></a>
22+
<a href="https://standardjs.com"><img alt="code style" src="https://img.shields.io/badge/code_style-Standard-F3DF49.svg"></a>
2323
<a href="https://conventionalcommits.org"><img alt="conventional commits" src="https://img.shields.io/badge/commits-Conventional-FE5196.svg?logo=conventionalcommits&logoColor=white"></a>
2424
<a href="https://github.com/cloydlau/json-editor-vue#develop"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
2525
</p>
@@ -544,9 +544,11 @@ export default {
544544
<script setup>
545545
import { ref } from 'vue'
546546
547-
const JsonEditorVue = () => process.client
548-
? import('json-editor-vue')
549-
: Promise.resolve({ render: (h) => h('div') })
547+
function JsonEditorVue() {
548+
return process.client
549+
? import('json-editor-vue')
550+
: Promise.resolve({ render: h => h('div') })
551+
}
550552
551553
const value = ref()
552554
</script>
@@ -643,13 +645,14 @@ export default {
643645
<script>
644646
import Vue from 'vue'
645647
import VCA from '@vue/composition-api'
648+
646649
Vue.use(VCA)
647650
648651
export default {
649652
components: {
650653
JsonEditorVue: () => process.client
651654
? import('json-editor-vue')
652-
: Promise.resolve({ render: (h) => h('div') }),
655+
: Promise.resolve({ render: h => h('div') }),
653656
},
654657
data() {
655658
return {

package.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"PascalCasedName": "JsonEditorVue",
44
"version": "0.10.5",
55
"private": false,
6-
"packageManager": "[email protected]",
76
"description": "JSON editor & viewer for Vue 2.6/2.7/3 & Nuxt 2/3.",
87
"author": "Cloyd Lau",
98
"license": "MIT",
@@ -64,20 +63,23 @@
6463
"vue-global-config": "latest"
6564
},
6665
"devDependencies": {
66+
"@antfu/eslint-config": "latest",
6767
"@commitlint/cli": "latest",
6868
"@commitlint/config-conventional": "latest",
6969
"@types/lodash-es": "latest",
7070
"@types/node": "latest",
71+
"@vitejs/plugin-vue": "latest",
7172
"@vitest/coverage-c8": "latest",
7273
"@vitest/ui": "latest",
74+
"@vue/compiler-sfc": "latest",
7375
"@vue/test-utils": "latest",
7476
"case-police": "latest",
77+
"eslint": "latest",
7578
"happy-dom": "latest",
7679
"husky": "latest",
7780
"json-editor-vue": "latest",
7881
"lint-staged": "latest",
7982
"lossless-json": "latest",
80-
"rome": "latest",
8183
"typescript": "latest",
8284
"unplugin-auto-import": "latest",
8385
"vanilla-jsoneditor": "latest",
@@ -86,18 +88,14 @@
8688
"vitepress": "latest",
8789
"vitest": "latest",
8890
"vue": "latest",
89-
"zhlint": "latest",
90-
"@vitejs/plugin-vue": "latest",
91-
"@vue/compiler-sfc": "latest"
91+
"zhlint": "latest"
9292
},
9393
"lint-staged": {
94-
"{src,__tests__}/**.{js,ts}": "rome check",
95-
"*.md": [
96-
"case-police --fix",
97-
"zhlint --fix"
98-
]
94+
"*.md": "case-police --fix",
95+
"docs/README.zh-CN.md": "zhlint --fix",
96+
"*": "eslint --ignore-pattern 'demo/' --fix"
9997
},
10098
"publishConfig": {
10199
"registry": "https://registry.npmjs.org"
102100
}
103-
}
101+
}

0 commit comments

Comments
 (0)