Skip to content

Commit

Permalink
Migrate from flow to typescript (rsuite#531)
Browse files Browse the repository at this point in the history
* new branch: typescript

* migrate to ts

* migrate to ts

* migrate to ts

* Adjust the component's directory

* Migrate from flow to typescript

* Migrate from flow to typescript

* Migrate from flow to typescript

* Migrate from flow to typescript

* Migrate from flow to typescript

* Migrate from flow to typescript

* Migrate from flow to typescript

* Update for tests

* refactor code and support IE10 (rsuite#501)

* refactor code and support IE10

* changes for comments

* add propTypes

* add lifecycle tests
remove prop: onSortMove

* Migrate from flow to typescript

* Migrate from flow to typescript

* Move styles directories. (rsuite#503)

* Move styles directories.

* Rename some classname.

* ignore es

* Update scripts

* Fix path separator for windows users. (rsuite#506)

* Replace table with flex (rsuite#508)

* Fixed input issue in IE. (rsuite#507)

* Fix Cascader option value is not correct under controlled conditions

* Style migration (rsuite#504)

* sync rsuite#513

* sync rsuite#515

* Update lib path

* sync rsuite#515

* Fix an internationalization issue with a wrong title on the calendar

* innerRef is changed to ref on PickerToggleTrigger

* Support for `open` and `close` methods on all pickers

* Bugfix for migrate from flow to typescript

* Fix rsuite#520

* fix: add default collection (rsuite#517)

* fix: add default collection

* fix: add Anchor to ignore tag type

* format

* Style migration (rsuite#516)

* Fix: Namespaces are not supported

* Update tests

* Update scripts for build

* remove gulp-typescript

* Update karma.conf.js

* Implement an option for showing week numbers in the datepickers (rsuite#526)

I have verified it.

* Update gulpfile.js

* Fix DateRangePicker module undefined problem

*  Move style directories and added default theme. (rsuite#528)

* Edit button styles variable.

* Move style directories and added default theme.

* Fixed some style issue about modularity (rsuite#529)

* Update gulpfile.js

* set displayName

* Update XVFB (rsuite#530)

* Add some generic type (rsuite#527)

* Add some generic type

* Add onCick to Button
modify Whisper trigger type

* add type for formInstance

* Update XVFB (rsuite#530)

* Add clean script for dev

* Remove default props for TimeDropdown
  • Loading branch information
simonguo authored Jul 31, 2019
1 parent fcca0e8 commit 1ff9584
Show file tree
Hide file tree
Showing 1,473 changed files with 44,550 additions and 66,674 deletions.
64 changes: 22 additions & 42 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,37 @@
module.exports = api => {
module.exports = (api, options) => {
const { NODE_ENV } = options || process.env;
const dev = NODE_ENV === 'development';
const modules = NODE_ENV === 'esm' ? false : 'commonjs';

if (api) {
api.cache(() => process.env.NODE_ENV);
api.cache(() => NODE_ENV);
}

const plugins = [
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-export-default-from',
['@babel/plugin-transform-runtime', { useESModules: !modules }]
];

if (modules) {
plugins.push('add-module-exports');
}

return {
presets: [
[
'@babel/preset-env',
{
loose: true
}
],
'@babel/preset-react',
'@babel/preset-flow'
],
plugins: [
'lodash',
'date-fns',
'@babel/plugin-transform-proto-to-assign',
'@babel/plugin-transform-runtime',
'transform-react-flow-handled-props',
'transform-dev',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta',
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-json-strings',
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-throw-expressions',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-logical-assignment-operators',
'@babel/plugin-proposal-optional-chaining',
[
'@babel/plugin-proposal-pipeline-operator',
{
proposal: 'minimal'
}
],
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-do-expressions'
['@babel/preset-env', { modules, loose: true }],
['@babel/preset-react', { development: dev }],
'@babel/typescript'
],
plugins,
env: {
coverage: {
plugins: [
[
'istanbul',
{
exclude: [
'src/utils/deprecationWarning.js',
'src/utils/lowPriorityWarning.js',
'src/utils/ajaxUpload.js'
]
exclude: ['src/utils/ajaxUpload.ts']
}
]
]
Expand Down
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ lib
tools
node_modules
coverage
flow
flow-typed
/.git
50 changes: 25 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
'use strict';

const OFF = 0;
const WARNING = 1;
const ERROR = 2;

module.exports = {
extends: ['prettier'],
env: {
browser: true,
node: true,
es6: true,
mocha: true
},
globals: {
assert: true
es6: true
},
parser: 'babel-eslint',
plugins: ['react', 'prettier', 'json', 'flowtype'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
],
parserOptions: {},
plugins: ['@typescript-eslint', 'react'],
rules: {
indent: [ERROR, 2, { SwitchCase: 1 }], //规定代码的缩进方式:2个空格
camelcase: ERROR, //强制驼峰法命名
eqeqeq: ERROR, //必须使用全等
'brace-style': [ERROR, '1tbs'], // 大括号风格
quotes: [ERROR, 'single'], // 引号类型
semi: [ERROR, 'always'], // 语句强制分号结尾
'space-infix-ops': ERROR, // 中缀操作符周围要不要有空格
'no-param-reassign': OFF, // 不允许对函数的形参进行赋值
'prefer-spread': ERROR, // 首选展开运算
'comma-dangle': OFF, // 不允许或强制在对象字面量或者数组属性的结尾使用逗号
'padded-blocks': OFF, // 规定代码块前后是否要加空行
quotes: [ERROR, 'single'],
semi: [ERROR, 'always'],
'space-infix-ops': ERROR,
'no-param-reassign': OFF,
'prefer-spread': ERROR,
'comma-dangle': OFF,
'padded-blocks': OFF,
'prefer-const': OFF,
'no-multi-spaces': ERROR,
'no-var': OFF,
Expand All @@ -37,8 +32,13 @@ module.exports = {
'no-unused-expressions': [ERROR, { allowShortCircuit: true }],
'arrow-parens': [ERROR, 'as-needed'],
'no-mixed-operators': OFF,
'no-unused-vars': ERROR,
'react/jsx-uses-vars': ERROR,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }]
'@typescript-eslint/no-explicit-any': OFF,
'@typescript-eslint/explicit-function-return-type': OFF,
'@typescript-eslint/explicit-member-accessibility': OFF
},
settings: {
react: {
version: 'detect'
}
}
};
13 changes: 0 additions & 13 deletions .flowconfig

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ _build
build
.DS_Store
lib/
es/
.idea
karma.sauce.conf.js
dev-publish.sh
Expand Down
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
printWidth: 100,
tabWidth: 2,
singleQuote: true
};
1 change: 0 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
test
src
16 changes: 6 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
# - 7 # 7 is not supported by NPM, it will fallback to npm@3, which does not run prepublishOnly hook
# - 7 # 7 is not supported by NPM, it will fallback to npm@3, which does not run prepublishOnly hook
- 8 # 8 is a LTS version with latest NPM packed

env:
Expand All @@ -11,30 +11,26 @@ cache:
directories:
- node_modules


before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
services:
- xvfb

on:
branch: master
tags: true


jobs:
include:
- stage: "NPM publish"
- stage: 'NPM publish'
script: skip
deploy:
provider: npm
email: "[email protected]"
email: '[email protected]'
api_key: $NPM_AUTH_TOKEN
skip_cleanup: true
on:
tags: true

stages:
- test
- name: "NPM publish"
- name: 'NPM publish'
if: tag IS present # only include deploy stage when it's a tagged commit
87 changes: 0 additions & 87 deletions flow-typed/npm/@babel/cli_vx.x.x.js

This file was deleted.

Loading

0 comments on commit 1ff9584

Please sign in to comment.