Skip to content

Commit 8de411b

Browse files
authoredJul 8, 2020
📦 use father replace rc-tools (#8)
* 📦 use father replace rc-tools * ✅ fix test case * fix npm build * fix extra space in scripts * update .gitignore * clean up package.json and gitignore * fix eslint
1 parent ed27781 commit 8de411b

File tree

8 files changed

+49
-43
lines changed

8 files changed

+49
-43
lines changed
 

‎.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.eslintrc.js
2+
lib
3+
es

‎.eslintrc.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const base = require('@umijs/fabric/dist/eslint');
2+
3+
module.exports = {
4+
...base,
5+
rules: {
6+
...base.rules,
7+
'no-template-curly-in-string': 0,
8+
'prefer-promise-reject-errors': 0,
9+
'react/no-array-index-key': 0,
10+
'react/sort-comp': 0,
11+
'import/no-named-as-default': 0,
12+
'import/no-named-as-default-member': 0,
13+
},
14+
};

‎.fatherrc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
entry: ['src/index.js'],
3+
cjs: 'babel',
4+
esm: { type: 'babel', importLibToEs: true },
5+
doc: { base: '/switch' },
6+
preCommit: {
7+
eslint: true,
8+
prettier: true,
9+
},
10+
runtimeHelpers: true,
11+
};

‎.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
.storybook
12
/node_modules
23
/npm-debug.log
34
npm-debug.log.*
45
.DS_Store
56
lib/
67
es/
7-
coverage/
8+
coverage/
9+
.doc

‎.travis.yml

+3-29
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,15 @@ language: node_js
22

33
sudo: false
44

5-
notifications:
6-
email:
7-
- hust2012jiangkai@gmail.com
8-
95
node_js:
10-
- 6.0.0
11-
12-
before_install:
13-
- |
14-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(^(docs|examples))/'
15-
then
16-
echo "Only docs were updated, stopping build process."
17-
exit
18-
fi
19-
phantomjs --version
6+
- 14
207

218
script:
229
- |
23-
if [ "$TEST_TYPE" = test ]; then
24-
npm test
25-
else
26-
npm run $TEST_TYPE
27-
fi
10+
npm run $TEST_TYPE
2811
2912
env:
3013
matrix:
3114
- TEST_TYPE=lint
3215
- TEST_TYPE=test
33-
- TEST_TYPE=coverage
34-
- TEST_TYPE=saucelabs
35-
global:
36-
- secure: S1VwbaPzLnSH/IUT/wlJulxAX5VHRIDmSt53h/ycHcZsszUpWcLCJRQAe0fTVB2dAx5MdBbSZ+o+tr3tRwVB5TRAYm0oTCsYAkOZaWOB28RuUQtdGt3wf9xxTG1UiPiaLLUW3waX9zAaf3yqKBcJGf1op0RD8dksxbCFw/7xVbU=
37-
- secure: EBEDg8k///IlEsnx0AE8X3mbFl0QE5+xGKbG4AxXlGZda12uTIPUSMKJzdZQ2hVbZXduTzf1cQl9rcu9nGoSnkL/DWnIax9cvHi+1orx5+YPlxPHNWAwWByTnHosBn2MJhfy1s5paJfHC9cUzmmEL6x4fYthWxjsPUo+irEZH6E=
38-
39-
40-
matrix:
41-
allow_failures:
42-
- env: "TEST_TYPE=saucelabs"
16+
- TEST_TYPE=coverage

‎package.json

+14-12
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212
"index.d.ts"
1313
],
1414
"scripts": {
15-
"compile": "rc-tools run compile --babel-runtime",
16-
"test": "rc-test run test",
17-
"coverage": "rc-test run coverage",
18-
"lint": "rc-tools run lint",
19-
"eslint-fix": "eslint --fix ./index.js ./test",
20-
"build": "rc-tools run build",
21-
"gh-pages": "rc-tools run gh-pages",
22-
"start": "rc-tools run server",
23-
"pub": "rc-tools run pub --babel-runtime",
24-
"prepublish": "rc-tools run guard"
15+
"start": "father doc dev --storybook",
16+
"build": "father doc build --storybook",
17+
"compile": "father build",
18+
"gh-pages": "father doc deploy",
19+
"prepublishOnly": "npm run compile && np --yolo --no-publish",
20+
"lint": "eslint .",
21+
"test": "father test",
22+
"coverage": "father test --coverage"
2523
},
2624
"repository": {
2725
"type": "git",
@@ -37,10 +35,14 @@
3735
"url": "https://github.com/benjycui/omit.js/issues"
3836
},
3937
"homepage": "https://github.com/benjycui/omit.js#readme",
40-
"dependencies": {},
38+
"dependencies": {
39+
"@babel/runtime": "^7.10.4"
40+
},
4141
"devDependencies": {
42+
"@umijs/fabric": "^2.2.2",
4243
"assert": "^1.4.1",
43-
"rc-test": "^6.0.7",
44+
"eslint": "^7.4.0",
45+
"father": "^2.29.5",
4446
"rc-tools": "^6.3.3"
4547
}
4648
}

‎src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function omit(obj, fields) {
22
const shallowCopy = {
33
...obj,
44
};
5-
for (let i = 0; i < fields.length; i++) {
5+
for (let i = 0; i < fields.length; i += 1) {
66
const key = fields[i];
77
delete shallowCopy[key];
88
}
File renamed without changes.

0 commit comments

Comments
 (0)
Please sign in to comment.