-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,771 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true | ||
}, | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], | ||
overrides: [ | ||
{ | ||
env: { | ||
node: true | ||
}, | ||
files: ['.eslintrc.{js,cjs}'], | ||
parserOptions: { | ||
sourceType: 'script' | ||
} | ||
} | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
rules: {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.DS_Store | ||
.idea | ||
.editorconfig | ||
pnpm-lock.yaml | ||
.npmrc | ||
|
||
.tmp | ||
.cache/ | ||
coverage/ | ||
.nyc_output/ | ||
**/.yarn/** | ||
**/.pnp.* | ||
/dist*/ | ||
node_modules/ | ||
**/node_modules/ | ||
|
||
## Local | ||
.husky | ||
.local | ||
|
||
**/*.svg | ||
**/*.sh | ||
components.d.ts | ||
auto-imports.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
$schema: 'https://json.schemastore.org/prettierrc', | ||
printWidth: 120, // 单行输出(不折行)的(最大)长度 | ||
semi: false, // 结尾使用分号, 默认true | ||
useTabs: false, // 使用tab缩进,默认false | ||
tabWidth: 4, // tab缩进大小,默认为2 | ||
singleQuote: true, // 使用单引号, 默认false(在jsx中配置无效, 默认都是双引号) | ||
jsxSingleQuote: true, // jsx 不使用单引号,而使用双引号 | ||
trailingComma: 'none', // 行尾逗号,默认none,可选 none|es5|all es5 包括es5中的数组、对象,all 包括函数对象等所有可选 | ||
bracketSpacing: true, // 对象中的空格 默认true,true: { foo: bar },false: {foo: bar} | ||
htmlWhitespaceSensitivity: 'ignore', // 指定 HTML 文件的全局空白区域敏感度, "ignore" - 空格被认为是不敏感的 | ||
jsxBracketSameLine: false, | ||
arrowParens: 'avoid', // 箭头函数参数括号 默认avoid 可选 avoid| always, avoid 能省略括号的时候就省略 例如x => x,always 总是有括号 | ||
proseWrap: 'always' // 当超出print width(上面有这个参数)时就折行 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>vite-plugin-meta-env</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export function setupCounter(element: HTMLButtonElement) { | ||
let counter = 0 | ||
const setCounter = (count: number) => { | ||
counter = count | ||
element.innerHTML = `count is ${counter}` | ||
} | ||
element.addEventListener('click', () => setCounter(++counter)) | ||
setCounter(0) | ||
let counter = 0 | ||
const setCounter = (count: number) => { | ||
counter = count | ||
element.innerHTML = `count is ${counter}` | ||
} | ||
element.addEventListener('click', () => setCounter(++counter)) | ||
setCounter(0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
{ | ||
"name": "vite-plugin-meta-env", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"files": [ | ||
"dist", | ||
"index.d.ts" | ||
], | ||
"main": "./dist/counter.umd.cjs", | ||
"module": "./dist/counter.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
"name": "vite-plugin-meta-env", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"files": [ | ||
"dist", | ||
"index.d.ts" | ||
], | ||
"main": "./dist/counter.umd.cjs", | ||
"module": "./dist/counter.js", | ||
"types": "./index.d.ts", | ||
"import": "./dist/counter.js", | ||
"require": "./dist/counter.umd.cjs" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.1.3", | ||
"vite": "^4.3.9" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
"exports": { | ||
"types": "./index.d.ts", | ||
"import": "./dist/counter.js", | ||
"require": "./dist/counter.umd.cjs" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"lint": "eslint . --ext .js,.ts --fix --ignore-path .gitignore", | ||
"format": "prettier --write ." | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^6.0.0", | ||
"@typescript-eslint/parser": "^6.0.0", | ||
"eslint": "^8.44.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"prettier": "^3.0.0", | ||
"typescript": "^5.1.3", | ||
"vite": "^4.3.9" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.