Skip to content

Commit

Permalink
feat: code format
Browse files Browse the repository at this point in the history
  • Loading branch information
xsf0105 committed Nov 8, 2022
1 parent ff710cb commit 52d0f9e
Show file tree
Hide file tree
Showing 20 changed files with 46,202 additions and 1,040 deletions.
17 changes: 14 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,28 @@
"ecmaVersion": 2020
},
"rules": {
"vue/no-unused-components": "off",
"no-debugger": "off",
"vue/no-unused-components": 0,
"no-debugger": 0,
"@typescript-eslint/no-inferrable-types": 1
},
"overrides": [
{
"files":[
"packages/quark/**/*.tsx"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-inferrable-types": 0
}
},
{
"files":[
"packages/quark-core/src/**/*.ts"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
"@typescript-eslint/explicit-module-boundary-types": 0
}
}
]
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ npm run release:minor
npm run release:major
```

打 tag

```
git tag // 先看下是否生成最新的 tag
git push origin --tags
```

## 提交 commit

整个 Quark Design 仓库遵从 [Angular Style Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153),在输入 commit message 的时候请务必遵从此规范。
Expand Down
162 changes: 83 additions & 79 deletions example/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,89 +1,93 @@
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
import Markdown from 'vite-plugin-md';
import cssVariable from '@quarkd/rollup-plugin-css-variable';
import typescript from '@rollup/plugin-typescript';
import path from 'path';
import variableMap from './global-css';
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import react from "@vitejs/plugin-react";
import legacy from "@vitejs/plugin-legacy";
import Markdown from "vite-plugin-md";
import cssVariable from "@quarkd/rollup-plugin-css-variable";
import typescript from "@rollup/plugin-typescript";
import path from "path";
import variableMap from "./global-css";

// https://highlightjs.org/
const hljs = require('highlight.js');
const hljs = require("highlight.js");
const { resolve } = path;

const plugins = [
cssVariable({
variableMap,
prefix: 'quark-',
}),
vue({
include: [/\.vue$/, /\.md$/],
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith('quark-'),
},
},
}),
typescript(),
Markdown({
// default options passed to markdown-it
// see: https://markdown-it.github.io/markdown-it/
markdownItOptions: {
highlight(str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
} catch (__) {}
}
return ''; // 使用额外的默认转义
},
},
}),
legacy({
targets: ['defaults', 'not IE 11'],
}),
react({
jsxRuntime: 'classic',
babel: {
// presets: [['@babel/preset-env'], ['@babel/preset-typescript']],
plugins: [
[
'@babel/plugin-proposal-decorators',
{
legacy: true
}
],
"@babel/plugin-proposal-class-properties",

]
}
})
cssVariable({
variableMap,
prefix: "quark-",
}),
vue({
include: [/\.vue$/, /\.md$/],
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith("quark-"),
},
},
}),
typescript(),
Markdown({
// default options passed to markdown-it
// see: https://markdown-it.github.io/markdown-it/
markdownItOptions: {
highlight(str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
} catch (__) {}
}
return ""; // 使用额外的默认转义
},
},
}),
legacy({
targets: ["defaults", "not IE 11"],
}),
react({
jsxRuntime: "classic",
babel: {
// presets: [['@babel/preset-env'], ['@babel/preset-typescript']],
plugins: [
[
"@babel/plugin-proposal-decorators",
{
legacy: true,
},
],
"@babel/plugin-proposal-class-properties",
],
},
}),
];

// https://vitejs.dev/config/
const rootPtah = resolve(__dirname, '../')
const rootPtah = resolve(__dirname, "../");
export default defineConfig({
root: rootPtah,
base: './',
server: {
port: 2022,
host: '0.0.0.0',
},
resolve: {
alias: [{ find: '@', replacement: resolve(__dirname, './src') }],
},
plugins,
// 打包配置
build: {
target: 'es2015',
outDir: 'dist',
cssCodeSplit: true,
rollupOptions: {
input: {
mobile: resolve(__dirname, '../demo.html'),
},
},
minify: false
},
root: rootPtah,
base: "./",
server: {
port: 2022,
host: "0.0.0.0",
},
resolve: {
alias: [{ find: "@", replacement: resolve(__dirname, "./src") }],
},
plugins,
// 打包配置
build: {
target: "es2015",
outDir: "dist",
cssCodeSplit: true,
rollupOptions: {
input: {
mobile: resolve(__dirname, "../demo.html"),
},
},
minify: false,
},
esbuild: {
define: {
this: "window",
},
},
});
Loading

0 comments on commit 52d0f9e

Please sign in to comment.