Skip to content

Commit b267579

Browse files
committed
workflow: replace ESLint with Rome
1 parent b3c1043 commit b267579

File tree

10 files changed

+341
-1667
lines changed

10 files changed

+341
-1667
lines changed

.eslintrc.json

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

.github/workflows/ci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,7 @@ jobs:
3232

3333
- run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
3434

35-
- name: Run CasePolice
36-
run: npx case-police --fix
37-
38-
- name: Run zhlint
39-
run: npx zhlint docs/README.zh-CN.md --fix
40-
41-
- name: Run ESLint
35+
- name: Lint
4236
run: npx lint-staged
4337

4438
unit-test:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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
<a href="https://npmcharts.com/compare/json-editor-vue"><img alt="downloads" src="https://img.shields.io/npm/dm/json-editor-vue"></a>
1919
<br>
20-
<a href="https://eslint.org"><img alt="code style" src="https://img.shields.io/badge/code_style-ESLint-4B32C3.svg?logo=eslint"></a>
20+
<a href="https://rome.tools"><img alt="code style" src="https://img.shields.io/badge/code_style-Rome-FFC905.svg?logo=rome"></a>
2121
<a href="https://conventionalcommits.org"><img alt="conventional commits" src="https://img.shields.io/badge/commits-Conventional-FE5196.svg?logo=conventionalcommits&logoColor=white"></a>
2222
<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>
2323
</p>

__tests__/index.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1+
import JsonEditorVue from '../src/index'
12
import { mount } from '@vue/test-utils'
23
import { expect, test } from 'vitest'
3-
import JsonEditorVue from '../src/index'
44

55
test('string value in text mode', async () => {
6-
const wrapper = mount(JsonEditorVue, {
7-
props: {
8-
mode: 'text',
9-
modelValue: 'abc',
10-
},
11-
})
12-
expect(wrapper.get('.cm-activeLine').text()).toEqual('"abc"')
6+
const wrapper = mount(JsonEditorVue, {
7+
props: {
8+
mode: 'text',
9+
modelValue: 'abc',
10+
},
11+
})
12+
expect(wrapper.get('.cm-activeLine').text()).toEqual('"abc"')
1313
})
1414

1515
test('string value in tree mode', async () => {
16-
const wrapper = mount(JsonEditorVue, {
17-
props: {
18-
modelValue: 'abc',
19-
},
20-
})
21-
expect(wrapper.get('.jse-value').text()).toEqual('abc')
16+
const wrapper = mount(JsonEditorVue, {
17+
props: {
18+
modelValue: 'abc',
19+
},
20+
})
21+
expect(wrapper.get('.jse-value').text()).toEqual('abc')
2222
})

docs/README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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
<a href="https://npmcharts.com/compare/json-editor-vue"><img alt="downloads" src="https://img.shields.io/npm/dm/json-editor-vue"></a>
1919
<br>
20-
<a href="https://eslint.org"><img alt="code style" src="https://img.shields.io/badge/code_style-ESLint-4B32C3.svg?logo=eslint"></a>
20+
<a href="https://rome.tools"><img alt="code style" src="https://img.shields.io/badge/code_style-Rome-FFC905.svg?logo=rome"></a>
2121
<a href="https://conventionalcommits.org"><img alt="conventional commits" src="https://img.shields.io/badge/commits-Conventional-FE5196.svg?logo=conventionalcommits&logoColor=white"></a>
2222
<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>
2323
</p>

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"build": "vite build",
4747
"test-unit": "vitest run",
4848
"coverage": "vitest run --coverage",
49-
"release": "npx case-police --fix && npx zhlint docs/README.zh-CN.md --fix && npx lint-staged && pnpm test-unit && pnpm build && cl release"
49+
"release": "npx lint-staged && pnpm test-unit && pnpm build && cl release"
5050
},
5151
"peerDependencies": {
5252
"@vue/composition-api": ">=1",
@@ -64,7 +64,6 @@
6464
"vue-global-config": "^0.4.0"
6565
},
6666
"devDependencies": {
67-
"@antfu/eslint-config": "^0.34.1",
6867
"@commitlint/cli": "^17.4.2",
6968
"@commitlint/config-conventional": "^17.4.2",
7069
"@types/lodash-es": "^4.17.6",
@@ -75,12 +74,12 @@
7574
"@vue/compiler-sfc": "^3.2.45",
7675
"@vue/test-utils": "^2.2.7",
7776
"case-police": "^0.5.10",
78-
"eslint": "^8.32.0",
7977
"happy-dom": "^8.1.4",
8078
"husky": "^8.0.3",
8179
"json-editor-vue": "^0.10.5",
8280
"lint-staged": "^13.1.0",
8381
"lossless-json": "^2.0.5",
82+
"rome": "^11.0.0",
8483
"typescript": "^4.9.4",
8584
"unplugin-auto-import": "^0.12.1",
8685
"vanilla-jsoneditor": "^0.11.8",
@@ -92,11 +91,13 @@
9291
"zhlint": "^0.7.1"
9392
},
9493
"lint-staged": {
95-
"{src,__tests__}/**.*": [
96-
"eslint --fix"
94+
"{src,__tests__}/**.*": "rome check",
95+
"*.md": [
96+
"case-police --fix",
97+
"zhlint --fix"
9798
]
9899
},
99100
"publishConfig": {
100101
"registry": "https://registry.npmjs.org"
101102
}
102-
}
103+
}

0 commit comments

Comments
 (0)