Add editorconfig

add prettier
add prettier ignore
This commit is contained in:
DefectingCat
2022-08-25 18:19:25 +08:00
parent 4767eb9995
commit 2b9db34c1b
8 changed files with 55 additions and 45 deletions

View File

@ -1,37 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/typescript-node // https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/typescript-node
{ {
"name": "Node.js & TypeScript", "name": "Node.js & TypeScript",
"build": { "build": {
"dockerfile": "Dockerfile", "dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 18, 16, 14. // Update 'VARIANT' to pick a Node version: 18, 16, 14.
// Append -bullseye or -buster to pin to an OS version. // Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon. // Use -bullseye variants on local on arm64/Apple Silicon.
"args": { "args": {
"VARIANT": "16-bullseye" "VARIANT": "16-bullseye"
} }
}, },
// Configure tool-specific properties. // Configure tool-specific properties.
"customizations": { "customizations": {
// Configure properties specific to VS Code. // Configure properties specific to VS Code.
"vscode": { "vscode": {
// Add the IDs of extensions you want installed when the container is created. // Add the IDs of extensions you want installed when the container is created.
"extensions": [ "extensions": ["dbaeumer.vscode-eslint"]
"dbaeumer.vscode-eslint" }
] },
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally. // Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [], // "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created. // Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install", // "postCreateCommand": "yarn install",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node", "remoteUser": "node",
"features": { "features": {
"git": "os-provided" "git": "os-provided"
} }
} }

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

3
.prettierignore Normal file
View File

@ -0,0 +1,3 @@
node_modules
out
.next

View File

@ -1,4 +1,4 @@
{ {
"semi": true, "semi": true,
"singleQuote": true "singleQuote": true
} }

View File

@ -9,7 +9,8 @@
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"test": "jest --watch", "test": "jest --watch",
"test-ci": "jest --ci --coverage" "test-ci": "jest --ci --coverage",
"pretty": "prettier --write \"./**/*.{js,jsx,ts,tsx,json}\""
}, },
"dependencies": { "dependencies": {
"@codesandbox/sandpack-react": "^1.5.4", "@codesandbox/sandpack-react": "^1.5.4",
@ -47,6 +48,7 @@
"jest-environment-jsdom": "^28.1.3", "jest-environment-jsdom": "^28.1.3",
"nanoid": "^4.0.0", "nanoid": "^4.0.0",
"postcss": "^8.4.16", "postcss": "^8.4.16",
"prettier": "^2.7.1",
"tailwindcss": "^3.1.8", "tailwindcss": "^3.1.8",
"typescript": "4.7.4" "typescript": "4.7.4"
} }

View File

@ -2,11 +2,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"target": "es5", "target": "es5",
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@ -21,12 +17,6 @@
// "typeRoots": ["./types", "./node_modules/@types"], // "typeRoots": ["./types", "./node_modules/@types"],
"incremental": true "incremental": true
}, },
"include": [ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"next-env.d.ts", "exclude": ["node_modules"]
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
} }

View File

@ -55,4 +55,4 @@ export interface GistsFile {
export interface SignalGist extends GistData { export interface SignalGist extends GistData {
forks: any[]; forks: any[];
history: History[]; history: History[];
} }

View File

@ -7104,6 +7104,11 @@ prepend-http@^2.0.0:
resolved "https://registry.npmmirror.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" resolved "https://registry.npmmirror.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==
prettier@^2.7.1:
version "2.7.1"
resolved "https://registry.npmmirror.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.5.1: pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.5.1:
version "27.5.1" version "27.5.1"
resolved "https://registry.npmmirror.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" resolved "https://registry.npmmirror.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"