Skip to content

Commit

Permalink
style(phpjavac#4): :style: eslint同步Daosheng
Browse files Browse the repository at this point in the history
  • Loading branch information
CurryPaste committed Nov 2, 2021
1 parent 9fa09ba commit 725d5bc
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 57 deletions.
83 changes: 37 additions & 46 deletions blog-web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,40 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'@vue/airbnb',
'@vue/typescript/recommended',
],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'brace-style': 'off',
indent: 'off',
'implicit-arrow-linebreak': 'off',
'operator-linebreak': 'off',
'import/prefer-default-export': 'warn',
'no-param-reassign': 'off',
'linebreak-style': 'off',
'max-classes-per-file': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'function-paren-newline': 'off',
"@typescript-eslint/no-non-null-assertion": 'off',
'max-len': 'off',
'no-console':
process.env.NODE_ENV === 'production'
? 'warn'
: 'off',
'no-debugger':
process.env.NODE_ENV === 'production'
? 'warn'
: 'off',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
root: true,
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2017,
sourceType: "module",
},
env: {
browser: true,
es2021: true,
},
extends: ["airbnb-base", "prettier", "plugin:vue/vue3-recommended"],
rules: {
"no-param-reassign": ["error", { props: false }],
"import/extensions": "off",
"prettier/prettier": "warn",
"no-unused-vars": "warn",
quotes: [1, "double"],
"no-console": "off",
"vue/html-self-closing": "off",
"vue/singleline-html-element-content-newline": "off",
// "import/no-extraneous-dependencies": "off", // package 引入包
},
// required to lint *.vue files
plugins: ["vue", "prettier"],
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx", ".vue"],
},
},
},
globals: {
defineProps: "readonly",
defineEmits: "readonly",
defineExpose: "readonly",
withDefaults: "readonly",
},
],
};
2 changes: 1 addition & 1 deletion blog-web/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.formatOnSave": true,
// "editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
Expand Down
1 change: 1 addition & 0 deletions blog-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"prettier": "^2.4.1",
"typescript": "^4.4.3",
"vite": "^2.6.4",
"vue-tsc": "^0.3.0"
Expand Down
6 changes: 3 additions & 3 deletions blog-web/prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
trailingComma: "all",
tabWidth: 4,
semi: true
}
tabWidth: 2,
semi: true,
};
7 changes: 3 additions & 4 deletions blog-web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<script setup lang="ts">
import HelloWorld from './components/HelloWorld.vue'
import HelloWorld from "./components/HelloWorld.vue";
</script>

<template>
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
</template>

<style>
</style>
<style></style>
6 changes: 3 additions & 3 deletions blog-web/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createApp } from 'vue'
import App from './App.vue'
import { createApp } from "vue";
import App from "./App.vue";

createApp(App).mount('#app')
createApp(App).mount("#app");

0 comments on commit 725d5bc

Please sign in to comment.