Skip to content

Commit

Permalink
chore: prepare to transfer ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Feb 11, 2024
1 parent 896b7e1 commit 0326348
Show file tree
Hide file tree
Showing 13 changed files with 2,205 additions and 119 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: autofix.ci

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
autofix:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3

- name: Use Node.js lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci
env:
CYPRESS_INSTALL_BINARY: 0

- name: Lint
run: nr lint --fix

- uses: autofix-ci/action@v1
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Node.js CI

on:
push:
branches: ["main"]
branches: [main]
pull_request:
branches: ["main"]
branches: [main]

workflow_dispatch:

Expand Down
43 changes: 43 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml"
]
}
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import antfu from '@antfu/eslint-config'

export default antfu({
includes: [
'src/**/*',
],
ignores: [
'test/inputs/**',
'test/outputs/**',
],
typescript: true,
})
44 changes: 31 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "prettier-plugin-slidev",
"type": "module",
"version": "0.0.1",
"description": "A prettier plugin for Slidev",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"author": "_Kerman <[email protected]>",
"license": "MIT",
"keywords": [
"slidev",
"prettier",
Expand All @@ -13,40 +13,58 @@
"formatter",
"format"
],
"files": [
"dist",
"LICENSE",
"README.md"
],
"exports": {
".": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"default": "./dist/index.js"
}
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"LICENSE",
"README.md",
"dist"
],
"scripts": {
"dev": "vite build --watch",
"build": "vite build",
"test": "vitest",
"coverage": "vitest run --coverage"
"coverage": "vitest run --coverage",
"lint": "eslint .",
"lint:fix": "nr lint --fix",
"typecheck": "vue-tsc --noEmit",
"release": "bumpp package.json"
},
"author": "_Kerman <[email protected]>",
"license": "MIT",
"peerDependencies": {
"prettier": "^3.2.4"
},
"dependencies": {
"@slidev/parser": "^0.47.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.6.4",
"@antfu/ni": "^0.21.12",
"@slidev/types": "^0.47.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.11.15",
"@vitest/coverage-istanbul": "^1.2.2",
"bumpp": "^9.3.0",
"eslint": "^8.56.0",
"lint-staged": "^15.2.2",
"simple-git-hooks": "^2.9.0",
"tsup": "^8.0.1",
"vite": "^5.0.12",
"vite-plugin-dts": "^3.7.2",
"vitest": "^1.2.2"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*": [
"eslint --fix --cache"
]
}
}
Loading

0 comments on commit 0326348

Please sign in to comment.