Skip to content

Commit

Permalink
chore: update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxming committed Dec 27, 2024
1 parent d442b15 commit 86599ad
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 231 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"source.organizeImports": "never"
},
"eslint.enable": true,
"eslint.format.enable": true,
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/components/demos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const { link: playgroundLink } = usePlayground(props.isFile ? filesPath.value[0]
.example {
@apply border border-stone-200 rounded-lg;
}
.description{
.description {
@apply my-2 px-4;
}
</style>
19 changes: 5 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,37 +41,28 @@
"@types/jsdom": "^21.1.7",
"@types/node": "^18.19.10",
"@types/prompts": "^2.4.9",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/eslint-plugin": "^1.1.0",
"@vitest/eslint-plugin": "^1.1.20",
"@vitest/ui": "^1.6.0",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.0",
"@zzxming/eslint-config": "^0.3.1",
"@zzxming/eslint-config": "^0.3.4",
"cdx-component": "workspace:^",
"consola": "^3.2.3",
"eslint": "^9.11.0",
"eslint-merge-processors": "^0.1.0",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-tailwindcss": "^3.17.4",
"eslint-plugin-vue": "^9.27.0",
"eslint-plugin-yml": "^1.14.0",
"eslint-plugin-tailwindcss": "^3.17.5",
"eslint-plugin-vue": "^9.32.0",
"fs-extra": "^11.2.0",
"globals": "^15.6.0",
"jsdom": "^24.1.0",
"jsonc-eslint-parser": "^2.4.0",
"lint-staged": "^15.2.7",
"local-pkg": "^0.5.0",
"prompts": "^2.4.2",
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"vite": "^5.0.10",
"vitest": "^1.6.0",
"vue-eslint-parser": "^9.4.3",
"yaml-eslint-parser": "^1.2.3"
"vitest": "^1.6.0"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
Expand Down
2 changes: 1 addition & 1 deletion packages/components/collapse/src/collapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const handleItemClick = (name: CollapseModelValueType) => {
const _activeNames = [...model.value];
const index = _activeNames.indexOf(name);
if (index > -1) {
if (index !== -1) {
_activeNames.splice(index, 1);
}
else {
Expand Down
6 changes: 2 additions & 4 deletions packages/theme/src/animation/fade.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
}
});
.fade-in() {
animation: e('@{namespace}-fade-in') .getCssVar(transition-duration) []
ease-in-out infinite;
animation: e('@{namespace}-fade-in') .getCssVar(transition-duration) [] ease-in-out infinite;
}
.fade-out() {
animation: e('@{namespace}-fade-out') .getCssVar(transition-duration) []
ease-in-out;
animation: e('@{namespace}-fade-out') .getCssVar(transition-duration) [] ease-in-out;
}

.@{namespace}-fade {
Expand Down
33 changes: 6 additions & 27 deletions packages/theme/src/color-picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,12 @@
height: @panelHeight;
margin-left: @panelWidth + @barGap;
position: absolute;
background: linear-gradient(
0deg,
red 0,
#ff0 17%,
#0f0 33%,
#0ff 50%,
#00f 67%,
#f0f 83%,
red
);
background: linear-gradient(0deg, red 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red);
&-handle {
.handle(true);
width: @handleSize;
height: @handleSizeSec;
transform: translate(
((@barSize - @handleSize) / 2),
(-1 * @handleSizeSec / 2)
);
transform: translate(((@barSize - @handleSize) / 2), (-1 * @handleSizeSec / 2));
}
}

Expand All @@ -107,10 +95,8 @@
height: @barSize;
position: absolute;
margin-top: @panelHeight + @barGap;
background: linear-gradient(45deg, #ccc 25%, transparent 25%),
linear-gradient(135deg, #ccc 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #ccc 75%),
linear-gradient(135deg, transparent 75%, #ccc 75%);
background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%);
background-size: @barSize @barSize;
background-position:
0 0,
Expand All @@ -120,21 +106,14 @@
&-bg {
position: relative;
height: 100%;
background: linear-gradient(
to right,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 1) 100%
);
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
}
&-handle {
.handle(true);
top: 0;
width: @handleSizeSec;
height: @handleSize;
transform: translate(
(-1 * @handleSizeSec / 2),
((@barSize - @handleSize) / 2)
);
transform: translate((-1 * @handleSizeSec / 2), ((@barSize - @handleSize) / 2));
}
}

Expand Down
9 changes: 3 additions & 6 deletions packages/theme/src/model.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
@apply rounded-md overflow-auto pointer-events-auto;
}
&__header {
padding: .getCssVar(model-header-padding-y) []
.getCssVar(model-header-padding-x) [];
padding: .getCssVar(model-header-padding-y) [] .getCssVar(model-header-padding-x) [];
border-bottom: .getCssVar(border-base) [];
}
&__body {
padding: .getCssVar(model-body-padding-y) []
.getCssVar(model-body-padding-x) [];
padding: .getCssVar(model-body-padding-y) [] .getCssVar(model-body-padding-x) [];
}
&__footer {
padding: .getCssVar(model-footer-padding-y) []
.getCssVar(model-footer-padding-x) [];
padding: .getCssVar(model-footer-padding-y) [] .getCssVar(model-footer-padding-x) [];
}
}

Expand Down
6 changes: 2 additions & 4 deletions packages/theme/src/ripple.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
&--in,
&--out {
transition:
transform .getCssVar(ripple-transform-transition-duration) []
cubic-bezier(0, 0, 0.2, 1),
opacity .getCssVar(ripple-transform-transition-duration) []
cubic-bezier(0, 0, 0.2, 1);
transform .getCssVar(ripple-transform-transition-duration) [] cubic-bezier(0, 0, 0.2, 1),
opacity .getCssVar(ripple-transform-transition-duration) [] cubic-bezier(0, 0, 0.2, 1);
}
&--in {
@apply opacity-100;
Expand Down
3 changes: 1 addition & 2 deletions packages/theme/src/shared/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
x: 0;
y: 0;
blur: 6px;
shape: .getCssVar(shadow-x) [] .getCssVar(shadow-y) [] .getCssVar(shadow-blur)
[];
shape: .getCssVar(shadow-x) [] .getCssVar(shadow-y) [] .getCssVar(shadow-blur) [];
base: .getCssVar(shadow-shape) [] .getCssVar(shadow-color-base) [];
light-1: .getCssVar(shadow-shape) [] .getCssVar(shadow-color-light-1) [];
light-2: .getCssVar(shadow-shape) [] .getCssVar(shadow-color-light-2) [];
Expand Down
1 change: 0 additions & 1 deletion packages/utils/__tests__/props.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ describe('test types about vue props', () => {
required: true,
}),
} as const;
// eslint-disable-next-line vitest/valid-expect
expectTypeOf<ExtractPropTypes<typeof _props1>>().branded.toEqualTypeOf<{
readonly key1?: string;
readonly key2: string | number;
Expand Down
Loading

0 comments on commit 86599ad

Please sign in to comment.