Skip to content

Commit

Permalink
feat: eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
xsf0105 committed Nov 8, 2022
1 parent ebbe907 commit 79da41b
Show file tree
Hide file tree
Showing 17 changed files with 564 additions and 626 deletions.
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint"
],
"parserOptions": {
"ecmaVersion": 2020
},
"rules": {
"vue/no-unused-components": "off",
"no-debugger": "off",
"@typescript-eslint/no-inferrable-types": 1
},
"overrides": [
{
"files":[
"packages/quark-core/src/**/*.ts"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
}
}
]
}
18 changes: 14 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.variableTypes.enabled": true,
"typescript.inlayHints.enumMemberValues.enabled": true,
"typescript.inlayHints.propertyDeclarationTypes.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"files.associations": {
"*.vue": "html"
},
"eslint.options": {
"configFile": "./.eslintrc.json"
},
"eslint.validate": ["javascript", "vue", "html", "typescript"],
"workbench.startupEditor": "none",
"stylelint.validate": ["css", "scss"],
"scss.validate": false,
"css.validate": false
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ yarn run link // 第一次执行需要,互相依赖的软链接
yarn dev // 开始执行工程
```

之后直接运行下面命令即可
以后再次启动只需

```bash
yarn dev
Expand Down
5 changes: 0 additions & 5 deletions example/.eslintignore

This file was deleted.

29 changes: 0 additions & 29 deletions example/.eslintrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@
"@vitejs/plugin-react": "^1.1.4",
"@vitejs/plugin-vue": "^1.2.2",
"@vue/compiler-sfc": "^3.0.11",
"@vue/eslint-config-typescript": "^5.0.2",
"@vue/test-utils": "^2.0.0-rc.6",
"axios": "^0.27.2",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.0.6",
"chokidar": "^3.5.2",
"commitizen": "^4.2.4",
Expand All @@ -71,12 +69,6 @@
"css-loader": "^3.2.0",
"cz-conventional-changelog": "^3.3.0",
"deepmerge": "^3.2.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-node": "^4.1.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-vue": "^7.20.0",
"file-loader": "^4.2.0",
"front-matter": "^4.0.2",
"fs-extra": "^9.1.0",
Expand Down Expand Up @@ -105,7 +97,6 @@
"typescript": "^4.1.5",
"vconsole": "^3.6.0",
"vite": "^2.3.4",
"vite-plugin-eslint": "^1.3.0",
"vite-plugin-md": "^0.12.4",
"vue-router": "^4.0.4",
"ws": "^8.3.0"
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^7.0.0",
"commitizen": "^4.2.4",
"commitlint": "^17.0.3",
"commitlint-config-cz": "^0.13.3",
"cz-customizable": "^6.9.0",
"eslint": "^7.23.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.8.0",
"eslint-visitor-keys": "2",
"fs-extra": "^10.1.0",
"husky": "^8.0.1",
"lerna": "^5.1.8",
"ora": "^5.1.2",
"prettier": "^2.0.0",
"shelljs": "^0.8.5",
"vue": "^3.0.5",
"vue-router": "^4.0.4"
Expand Down
6 changes: 0 additions & 6 deletions packages/quark-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@
"@rollup/plugin-node-resolve": "^13.0.5",
"@rollup/plugin-typescript": "^8.3.0",
"@types/node": "^14.14.31",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.0.6",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-node": "^4.1.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-node": "^11.1.0",
"lint-staged": "^10.5.4",
"rollup-plugin-terser": "^7.0.2",
"sinon": "^12.0.1",
Expand Down
12 changes: 0 additions & 12 deletions packages/quark/.editorconfig

This file was deleted.

29 changes: 0 additions & 29 deletions packages/quark/.eslintrc.json

This file was deleted.

122 changes: 61 additions & 61 deletions packages/quark/global-css.js
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
const brandPrimary = '#0088ff';
const brandPrimary = "#0088ff";

export default {
// 文字色
textWhiteColor: '#fff', // 白色
textBaseColor: '#242729', // 基本, 比如弹框的Title, Cell的Title等
textSecondaryColor: '#969799', // 辅助色, 比如Cell的desc
textDisabledColor: '#bbbbbb', // 失效
textPlaceHolderColor: '#ccc',
textWhiteColor: "#fff", // 白色
textBaseColor: "#242729", // 基本, 比如弹框的Title, Cell的Title等
textSecondaryColor: "#969799", // 辅助色, 比如Cell的desc
textDisabledColor: "#bbbbbb", // 失效
textPlaceHolderColor: "#ccc",
linkColor: brandPrimary, // 链接

// 背景色
fillBaseColor: '#ffffff', // 组件默认背景
fillDisabledColor: '#dddddd', // 通用失效背景
fillMaskColor: 'rgba(0, 0, 0, 0.7)', // 遮罩背景
fillGreyColor: '#f7f7f7',
fillBaseColor: "#ffffff", // 组件默认背景
fillDisabledColor: "#dddddd", // 通用失效背景
fillMaskColor: "rgba(0, 0, 0, 0.7)", // 遮罩背景
fillGreyColor: "#f7f7f7",

// 全局/品牌色
primaryColor: brandPrimary,
warningColor: '#FB990F',
dangerColor: '#F72626',
warningColor: "#FB990F",
dangerColor: "#F72626",
// warningColor: '#FF5526',
successColor: '#07C160',
successColor: "#07C160",

// 边框色
borderBaseColor: '#dddddd',
borderPrimaryColor: '#7FC3FF',
borderWarningColor: '#FCCC87',
borderDangerColor: '#FB9292',
borderOrangeColor: '#FFAA92',
borderSuccessColor: '#83E0AF',
borderBaseColor: "#dddddd",
borderPrimaryColor: "#7FC3FF",
borderWarningColor: "#FCCC87",
borderDangerColor: "#FB9292",
borderOrangeColor: "#FFAA92",
borderSuccessColor: "#83E0AF",
// 透明度
opacityDisabled: '0.7', // switch checkbox radio 等组件禁用的透明度
opacityDisabled: "0.7", // switch checkbox radio 等组件禁用的透明度

// 字体尺寸
fontSizeCaptionSsm: '11px',
fontSizeCaptionSm: '12px',
fontSizeBase: '14px',
fontSizeSubhead: '15px',
fontSizeCaption: '16px',
fontSizeHeading: '17px',
fontSizeCaptionSsm: "11px",
fontSizeCaptionSm: "12px",
fontSizeBase: "14px",
fontSizeSubhead: "15px",
fontSizeCaption: "16px",
fontSizeHeading: "17px",

// 圆角
radiuXs: '2px',
radiusSm: '4px',
radiusMd: '6px',
radiusLg: '12px',
radiusBg: '16px',
radiuXs: "2px",
radiusSm: "4px",
radiusMd: "6px",
radiusLg: "12px",
radiusBg: "16px",

// 边框尺寸
borderWidthSm: '0.5px',
borderWidthMd: '1px',
borderWidthLg: '2px',
borderWidthSm: "0.5px",
borderWidthMd: "1px",
borderWidthLg: "2px",

// 间距
// 水平间距
hSpacingXs: '3px',
hSpacingS: '4px',
hSpacingSm: '5px',
hSpacingMd: '8px',
hSpacingLg: '15px',
hSpacingXs: "3px",
hSpacingS: "4px",
hSpacingSm: "5px",
hSpacingMd: "8px",
hSpacingLg: "15px",

// 垂直间距
vSpacingXxs: '2px',
vSpacingXs: '3px',
vSpacingSm: '5px',
vSpacingMd: '9px',
vSpacingLg: '15px',
vSpacingXl: '21px',
vSpacingXxs: "2px",
vSpacingXs: "3px",
vSpacingSm: "5px",
vSpacingMd: "9px",
vSpacingLg: "15px",
vSpacingXl: "21px",

// 高度
lineHeightBase: '1px', // 单行行高
lineHeightParagraph: '1.5px', // 多行行高
lineHeightBase: "1px", // 单行行高
lineHeightParagraph: "1.5px", // 多行行高

// 图标尺寸
iconSizeXxs: '15px',
iconSizeXs: '18px',
iconSizeSm: '21px',
iconSizeMd: '22px',
iconSizeLg: '36px',
iconSizeXxs: "15px",
iconSizeXs: "18px",
iconSizeSm: "21px",
iconSizeMd: "22px",
iconSizeLg: "36px",

// 字体
sFontFamily: 'PingFangSC-Regular, PingFang SC',
mFontFamily: 'PingFangSC-Medium, PingFang SC',
sFontFamily: "PingFangSC-Regular, PingFang SC",
mFontFamily: "PingFangSC-Medium, PingFang SC",

// 表单相关的
formBaseColor: '#242729',
formDisabledColor: '#c8c9cc',
formPlaceholderColor: '#bcc4cc',
formBaseColor: "#242729",
formDisabledColor: "#c8c9cc",
formPlaceholderColor: "#bcc4cc",

// 动画相关
animationDurationBase: '.3s',
animationDurationFast: '.25s',
animationTimingEnter: 'ease-out',
animationTimingLeave: 'ease-in',
animationDurationBase: ".3s",
animationDurationFast: ".25s",
animationTimingEnter: "ease-out",
animationTimingLeave: "ease-in",
};
Loading

0 comments on commit 79da41b

Please sign in to comment.