Skip to content

Commit

Permalink
build: add eslint jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryC8080 committed Apr 20, 2019
1 parent 985f8b6 commit 66dfa84
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ jobs:
- store_artifacts:
path: coverage

eslint:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run: ./node_modules/.bin/eslint ./src

workflows:
build-and-test:
jobs:
Expand All @@ -72,3 +79,6 @@ workflows:
- test-coverage:
requires:
- build
- eslint:
requires:
- build
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sourceType": "module"
},
"extends": [
"airbnb",
"airbnb-base",
"eslint:recommended"
],
"plugins": [
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"ava": "^1.2.1",
"babel-eslint": "^9.0.0",
"commitizen": "^3.0.5",
"eslint": "^2.13.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.12.0",
"nyc": "^13.1.0",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.17.2",
"nyc": "^14.0.0",
"pre-commit": "^1.2.2",
"validate-commit-msg": "^2.14.0"
},
Expand Down
6 changes: 3 additions & 3 deletions src/super-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function initStorage(ins, storage) {
set(key, value) {
return this.memoryCache[key] = value;
},
remove(key, value) {
remove(key) {
delete this.memoryCache[key];
},
removeAll() {
Expand All @@ -82,7 +82,7 @@ function initStorage(ins, storage) {
else ins.removeData = key => storage.remove.call(ins, `${storage.keyPrefix}:${key}`);

if (typeof storage.removeAll !== 'function') ins.removeAll = () => { throw new Error('storage.removeAll was undefined'); };
else ins.removeAll = key => storage.removeAll.call(ins);
else ins.removeAll = () => storage.removeAll.call(ins);
}

/** Class SuperCache. */
Expand Down Expand Up @@ -183,7 +183,7 @@ class SuperCache {

// 其他情况,让外部处理错误
throw err;
})
});
}

/**
Expand Down

0 comments on commit 66dfa84

Please sign in to comment.