From e1200f2dbe74d31f40fd4a2696b806c60988b43f Mon Sep 17 00:00:00 2001 From: fanxingqiang Date: Mon, 5 Jul 2021 17:39:00 +0800 Subject: [PATCH] chore: add eslint config --- .editorconfig | 14 + .eslintignore | 3 + .eslintrc.js | 16 + .gitignore | 17 +- .prettierrc.js | 7 + build/utils.ts | 4 +- index.html | 6 +- package-lock.json | 4936 +++++++++++------------------ package.json | 24 +- src/plugins/element-plus/index.ts | 4 +- 10 files changed, 1873 insertions(+), 3158 deletions(-) create mode 100644 .editorconfig create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .prettierrc.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..ea6e20f5b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..e164e43af --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +public +dist +*.d.ts diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..a8c006fe3 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + root: true, + env: { + node: true + }, + extends: [ + 'plugin:vue/vue3-essential', + 'eslint:recommended', + '@vue/typescript/recommended', + '@vue/prettier', + '@vue/prettier/@typescript-eslint' + ], + parserOptions: { + ecmaVersion: 2020 + } +}; diff --git a/.gitignore b/.gitignore index 0ca39c007..268cf179f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,18 @@ node_modules -dist .DS_Store +dist +dist-ssr +*.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +tests/**/coverage/ + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..164355923 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + bracketSpacing: true, + jsxBracketSameLine: true, + singleQuote: true, + arrowParens: 'avoid', + trailingComma: 'all' +}; diff --git a/build/utils.ts b/build/utils.ts index f8f9266f3..8161d1a1d 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -1,4 +1,4 @@ -import dotenv from 'dotenv'; +import * as dotenv from 'dotenv'; export interface ViteEnv { VITE_PORT: number; @@ -35,4 +35,4 @@ export function loadEnv(): ViteEnv { process.env[envName] = realName; } return ret; -} \ No newline at end of file +} diff --git a/index.html b/index.html index 9b222f29b..f82c48b20 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@