diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..c77c179 --- /dev/null +++ b/.babelrc @@ -0,0 +1,8 @@ +{ + "plugins": [ + ["import", { + "libraryName": "antd", + "style": "css" + }] + ] +} diff --git a/package.json b/package.json index 1a51590..af6e8b1 100644 --- a/package.json +++ b/package.json @@ -4,29 +4,35 @@ "index": "./src/index.js" }, "dependencies": { - "dva": "^1.0.0", - "keymaster": "^1.6.2", - "qs": "^6.2.1", + "antd": "^2.0.1", + "dva": "1.0.0", + "qs": "^6.2.0", "react": "^15.1.0", "react-dom": "^15.1.0" }, "devDependencies": { "atool-build": "^0.7.6", - "atool-test-mocha": "^0.1.5", - "babel-plugin-dev-expression": "^0.2.1", + "babel-eslint": "^6.0.4", "babel-plugin-dva-hmr": "^0.1.0", + "babel-plugin-import": "^1.0.1", "babel-plugin-transform-runtime": "^6.9.0", "babel-runtime": "^6.9.2", "dora": "0.3.x", "dora-plugin-proxy": "^0.7.0", "dora-plugin-webpack": "0.6.x", "dora-plugin-webpack-hmr": "^0.1.0", - "expect": "^1.20.2", + "eslint": "^2.13.1", + "eslint-config-airbnb": "^9.0.1", + "eslint-plugin-import": "^1.8.1", + "eslint-plugin-jsx-a11y": "^1.4.2", + "eslint-plugin-react": "^5.1.1", + "glob": "^7.0.5", + "mockjs": "^1.0.1-beta2", "redbox-react": "^1.2.10" }, "scripts": { "start": "dora --plugins \"proxy,webpack,webpack-hmr\"", - "build": "atool-build", - "test": "atool-test-mocha ./src/**/*-test.js" + "lint": "eslint --fix --ext .js,.jsx .", + "build": "atool-build" } -} \ No newline at end of file +} diff --git a/src/utils0/request.js b/src/utils0/request.js deleted file mode 100644 index c808422..0000000 --- a/src/utils0/request.js +++ /dev/null @@ -1,30 +0,0 @@ -import fetch from 'dva/fetch'; - -function parseJSON(response) { - return response.json(); -} - -function checkStatus(response) { - if (response.status >= 200 && response.status < 300) { - return response; - } - - const error = new Error(response.statusText); - error.response = response; - throw error; -} - -/** - * Requests a URL, returning a promise. - * - * @param {string} url The URL we want to request - * @param {object} [options] The options we want to pass to "fetch" - * @return {object} An object containing either "data" or "err" - */ -export default function request(url, options) { - return fetch(url, options) - .then(checkStatus) - .then(parseJSON) - .then((data) => ({ data })) - .catch((err) => ({ err })); -}