Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add spelling check #2185

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/pr-spelling.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pr-spell-check
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check spelling
uses: crate-ci/typos@master
with:
config: .github/workflows/typos-config.toml
11 changes: 11 additions & 0 deletions .github/workflows/typos-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[default.extend-words]
actived = "actived"
formated = "formated"
formate = "formate"
Colum = "Colum"
ba = "ba"
ded = "ded"
Hel = "Hel"

[files]
extend-exclude = ["CHANGELOG.md"]
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ docClass: timeline
- `Tabs`: 废弃 placement 属性,左右布局请使用 SideBar 组件 @LeeJim ([#1492](https://github.com/Tencent/tdesign-miniprogram/pull/1492))

### 🚀 Features
- `Cell`: 新增 CSS Varialbes 用于控制高度 @LeeJim ([#1482](https://github.com/Tencent/tdesign-miniprogram/pull/1482))
- `Cell`: 新增 CSS Variables 用于控制高度 @LeeJim ([#1482](https://github.com/Tencent/tdesign-miniprogram/pull/1482))
- `Indexes`: 新增支持 stickyOffset 属性,用于调整吸顶时的距离 @LeeJim ([#1485](https://github.com/Tencent/tdesign-miniprogram/pull/1485))
- `Button`: 支持 0.5px 边框 @anlyyao ([#1474](https://github.com/Tencent/tdesign-miniprogram/pull/1474))

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ npm start
此时会同时启动 `dist` 与 `example` 的构建服务,对应的开发路径与构建路径分别为:

- `src` -> `miniprogram_dist`
- `src/*/_exmaple` -> `example` -> `_example`
- `src/*/_example` -> `example` -> `_example`

使用微信开发者工具导入项目 `_example` 文件夹

Expand Down
2 changes: 1 addition & 1 deletion site/docs/custom-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ page {
}
```

> 目前仅有部分组件支持自定义主题,支持的组件在其文档有陈列对应的 CSS Varialbes,可以访问 [tab-bar-item.less](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/tab-bar-item/tab-bar-item.less)
> 目前仅有部分组件支持自定义主题,支持的组件在其文档有陈列对应的 CSS Variables,可以访问 [tab-bar-item.less](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/tab-bar-item/tab-bar-item.less)
4 changes: 2 additions & 2 deletions site/plugin-tdoc/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let demoCodesImports: Record<string, string> = {};

export default {
before({ source, file, md }: any) {
const resouceDir = path.dirname(file);
const resourceDir = path.dirname(file);
const reg = file.match(/src\/(\S*)(?=\/\S*.md)/);
const name = reg && reg[1];
demoCodesImports = {};
Expand All @@ -23,7 +23,7 @@ export default {

// 替换成对应 demo 文件
source = source.replace(/{{\s+(.+)\s+}}/g, (_: string, demoDirName: string) => {
const demoPath = path.resolve(resouceDir, `./_example/${demoDirName}`);
const demoPath = path.resolve(resourceDir, `./_example/${demoDirName}`);
if (!fs.existsSync(demoPath)) {
console.log('\x1B[36m%s\x1B[0m', `${name} 组件需要实现 _example/${demoDirName} 示例!`);
return '\n<h3>DEMO (🚧建设中)...</h3>';
Expand Down
10 changes: 5 additions & 5 deletions src/checkbox-group/checkbox-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class CheckBoxGroup extends SuperComponent {
$checkAll = null; // 全选复选框

methods = {
getChilds() {
getChildren() {
let items = this.$children;
if (!items.length) {
items = this.selectAllComponents(`.${prefix}-checkbox-option`);
Expand All @@ -56,7 +56,7 @@ export default class CheckBoxGroup extends SuperComponent {
},

updateChildren() {
const items = this.getChilds();
const items = this.getChildren();
const { value } = this.data;

if (items.length > 0) {
Expand All @@ -76,14 +76,14 @@ export default class CheckBoxGroup extends SuperComponent {
updateValue({ value, checked, checkAll, indeterminate }) {
let { value: newValue } = this.data;
const { max } = this.data;
const keySet = new Set(this.getChilds().map((item) => item.data.value));
const keySet = new Set(this.getChildren().map((item) => item.data.value));

newValue = newValue.filter((value) => keySet.has(value));

if (max && checked && newValue.length === max) return;

if (checkAll) {
const items = this.getChilds();
const items = this.getChildren();
newValue =
!checked && indeterminate
? items
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class CheckBoxGroup extends SuperComponent {
},

setCheckall() {
const items = this.getChilds();
const items = this.getChildren();

if (!this.$checkAll) {
this.$checkAll = items.find((item) => item.data.checkAll);
Expand Down
8 changes: 4 additions & 4 deletions src/common/bus.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export default class Bus {
listeners: Map<string, any>;
emited: Set<string>;
emitted: Set<string>;

constructor() {
this.listeners = new Map();
this.emited = new Set();
this.emitted = new Set();
}

on(evtName: string, listener) {
if (this.emited.has(evtName)) {
if (this.emitted.has(evtName)) {
listener();
return;
}
Expand All @@ -24,7 +24,7 @@ export default class Bus {

if (listeners) {
listeners.forEach((func) => func());
this.emited.add(evtName);
this.emitted.add(evtName);
}
}
}
2 changes: 1 addition & 1 deletion src/date-time-picker/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ name | params | description
-- | -- | --
cancel | \- | \-
change | `(value: DateValue)` | \-
close | `(trigger: TriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confrim-btn'`<br/>
close | `(trigger: TriggerSource)` | `1.0.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`<br/>
confirm | `(value: DateValue)` | `1.0.1`
pick | `(value: DateValue)` | \-

Expand Down
2 changes: 1 addition & 1 deletion src/date-time-picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ visible | Boolean | false | 是否显示 | N
-- | -- | --
cancel | \- | 取消按钮点击时触发
change | `(value: DateValue)` | 确认按钮点击时触发
close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confrim-btn'`<br/>
close | `(trigger: TriggerSource)` | `1.0.1`。关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/date-time-picker/type.ts)。<br/>`type TriggerSource = 'overlay' \| 'cancel-btn' \| 'confirm-btn'`<br/>
confirm | `(value: DateValue)` | `1.0.1`。确认按钮点击时触发
pick | `(value: DateValue)` | 选中值发生变化时触发

Expand Down
12 changes: 6 additions & 6 deletions src/date-time-picker/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`DateTimePicker DateTimePicker date-all demo works fine 1`] = `
data-mode="datetime"
hover="{{true}}"
note=""
tClass="pannel-item"
tClass="panel-item"
title="选择日期时间"
bind:tap="showPicker"
/>
Expand All @@ -30,7 +30,7 @@ exports[`DateTimePicker DateTimePicker steps demo works fine 1`] = `
arrow="{{true}}"
hover="{{true}}"
note=""
tClass="pannel-item"
tClass="panel-item"
title="选择时间"
bind:tap="showPicker"
/>
Expand Down Expand Up @@ -69,7 +69,7 @@ exports[`DateTimePicker DateTimePicker time demo works fine 1`] = `
data-mode="second"
hover="{{true}}"
note=""
tClass="pannel-item"
tClass="panel-item"
title="选择时间"
bind:tap="showPicker"
/>
Expand All @@ -83,7 +83,7 @@ exports[`DateTimePicker DateTimePicker time demo works fine 1`] = `
data-mode="minute"
hover="{{true}}"
note=""
tClass="pannel-item"
tClass="panel-item"
title="选择时间"
bind:tap="showPicker"
/>
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`DateTimePicker DateTimePicker year-month demo works fine 1`] = `
data-mode="month"
hover="{{true}}"
note=""
tClass="pannel-item"
tClass="panel-item"
title="选择日期"
bind:tap="showPicker"
/>
Expand All @@ -154,7 +154,7 @@ exports[`DateTimePicker DateTimePicker year-month-date demo works fine 1`] = `
data-mode="date"
hover="{{true}}"
note=""
tClass="pannel-item"
tClass="panel-item"
title="选择日期"
bind:tap="showPicker"
/>
Expand Down

This file was deleted.

Loading