Skip to content

Commit 0326348

Browse files
committed
chore: prepare to transfer ownership
1 parent 896b7e1 commit 0326348

13 files changed

+2205
-119
lines changed

.github/workflows/autofix.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: autofix.ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
autofix:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Use Node.js lts/*
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: lts/*
24+
25+
- name: Setup
26+
run: npm i -g @antfu/ni
27+
28+
- name: Install
29+
run: nci
30+
env:
31+
CYPRESS_INSTALL_BINARY: 0
32+
33+
- name: Lint
34+
run: nr lint --fix
35+
36+
- uses: autofix-ci/action@v1

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Node.js CI
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches: [main]
66
pull_request:
7-
branches: ["main"]
7+
branches: [main]
88

99
workflow_dispatch:
1010

.vscode/settings.json

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
// Enable the ESlint flat config support
3+
"eslint.experimental.useFlatConfig": true,
4+
5+
// Disable the default formatter, use eslint instead
6+
"prettier.enable": false,
7+
"editor.formatOnSave": false,
8+
9+
// Auto fix
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll.eslint": "explicit",
12+
"source.organizeImports": "never"
13+
},
14+
15+
// Silent the stylistic rules in you IDE, but still auto fix them
16+
"eslint.rules.customizations": [
17+
{ "rule": "style/*", "severity": "off" },
18+
{ "rule": "format/*", "severity": "off" },
19+
{ "rule": "*-indent", "severity": "off" },
20+
{ "rule": "*-spacing", "severity": "off" },
21+
{ "rule": "*-spaces", "severity": "off" },
22+
{ "rule": "*-order", "severity": "off" },
23+
{ "rule": "*-dangle", "severity": "off" },
24+
{ "rule": "*-newline", "severity": "off" },
25+
{ "rule": "*quotes", "severity": "off" },
26+
{ "rule": "*semi", "severity": "off" }
27+
],
28+
29+
// Enable eslint for all supported languages
30+
"eslint.validate": [
31+
"javascript",
32+
"javascriptreact",
33+
"typescript",
34+
"typescriptreact",
35+
"vue",
36+
"html",
37+
"markdown",
38+
"json",
39+
"jsonc",
40+
"yaml",
41+
"toml"
42+
]
43+
}

eslint.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu({
4+
includes: [
5+
'src/**/*',
6+
],
7+
ignores: [
8+
'test/inputs/**',
9+
'test/outputs/**',
10+
],
11+
typescript: true,
12+
})

package.json

+31-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "prettier-plugin-slidev",
3+
"type": "module",
34
"version": "0.0.1",
45
"description": "A prettier plugin for Slidev",
5-
"main": "./dist/index.js",
6-
"types": "./dist/index.d.ts",
7-
"type": "module",
6+
"author": "_Kerman <[email protected]>",
7+
"license": "MIT",
88
"keywords": [
99
"slidev",
1010
"prettier",
@@ -13,40 +13,58 @@
1313
"formatter",
1414
"format"
1515
],
16-
"files": [
17-
"dist",
18-
"LICENSE",
19-
"README.md"
20-
],
2116
"exports": {
2217
".": {
23-
"default": "./dist/index.js",
18+
"types": "./dist/index.d.ts",
2419
"import": "./dist/index.js",
25-
"types": "./dist/index.d.ts"
20+
"default": "./dist/index.js"
2621
}
2722
},
23+
"main": "./dist/index.js",
24+
"types": "./dist/index.d.ts",
25+
"files": [
26+
"LICENSE",
27+
"README.md",
28+
"dist"
29+
],
2830
"scripts": {
2931
"dev": "vite build --watch",
3032
"build": "vite build",
3133
"test": "vitest",
32-
"coverage": "vitest run --coverage"
34+
"coverage": "vitest run --coverage",
35+
"lint": "eslint .",
36+
"lint:fix": "nr lint --fix",
37+
"typecheck": "vue-tsc --noEmit",
38+
"release": "bumpp package.json"
3339
},
34-
"author": "_Kerman <[email protected]>",
35-
"license": "MIT",
3640
"peerDependencies": {
3741
"prettier": "^3.2.4"
3842
},
3943
"dependencies": {
4044
"@slidev/parser": "^0.47.4"
4145
},
4246
"devDependencies": {
47+
"@antfu/eslint-config": "^2.6.4",
48+
"@antfu/ni": "^0.21.12",
4349
"@slidev/types": "^0.47.4",
4450
"@types/js-yaml": "^4.0.9",
4551
"@types/node": "^20.11.15",
4652
"@vitest/coverage-istanbul": "^1.2.2",
53+
"bumpp": "^9.3.0",
54+
"eslint": "^8.56.0",
55+
"lint-staged": "^15.2.2",
56+
"simple-git-hooks": "^2.9.0",
4757
"tsup": "^8.0.1",
4858
"vite": "^5.0.12",
4959
"vite-plugin-dts": "^3.7.2",
5060
"vitest": "^1.2.2"
61+
},
62+
"simple-git-hooks": {
63+
"pre-commit": "npx lint-staged"
64+
},
65+
"lint-staged": {
66+
"*": [
67+
"eslint --fix --cache"
68+
]
5169
}
5270
}

0 commit comments

Comments
 (0)