build(CI): add lint & build (#4224)

* build(workflows): add lint & build

* build(workflows): build:lib

* fix(Components): fix typescript type
This commit is contained in:
nemo-shen 2021-05-22 16:46:37 +08:00 committed by GitHub
parent 7979dee465
commit 11e83e5f4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 2 deletions

32
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Run linter
run: npm run lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Build
run: npm run build:lib

View File

@ -1,7 +1,11 @@
import { basic } from '../mixins/basic'; import { basic } from '../mixins/basic';
import { VantComponentOptions } from 'definitions/index'; import { VantComponentOptions } from 'definitions/index';
function mapKeys(source: object, target: object, map: object) { function mapKeys(
source: Record<string, any>,
target: Record<string, any>,
map: Record<string, any>
) {
Object.keys(map).forEach((key) => { Object.keys(map).forEach((key) => {
if (source[key]) { if (source[key]) {
target[map[key]] = source[key]; target[map[key]] = source[key];

View File

@ -1,3 +1,4 @@
// eslint-disable-next-line @typescript-eslint/ban-types
export function isFunction(val: unknown): val is Function { export function isFunction(val: unknown): val is Function {
return typeof val === 'function'; return typeof val === 'function';
} }

View File

@ -2,7 +2,7 @@ import { VantComponent } from '../common/component';
import { pickerProps } from './shared'; import { pickerProps } from './shared';
interface Column { interface Column {
values: object[]; values: any[];
defaultIndex?: number; defaultIndex?: number;
} }