Skip to content

Commit

Permalink
feat: tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Aug 29, 2017
1 parent 77c0049 commit e2154b7
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
"rollup-plugin-node-resolve": "^3.0.0",
"sinon": "^2.3.8",
"sinon-chai": "^2.12.0",
"tslint": "^5.7.0",
"tslint-react": "^3.2.0",
"typescript": "^2.4.2",
"uglify-js": "^2.8.29",
"webpack": "^3.3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function flushMount () {
}
const queue = readyComponents.slice(0)
readyComponents.length = 0
queue.forEach(item => {
queue.forEach((item) => {
if (isFunction(item)) {
item()
} else if (item.componentDidMount) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/next-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function installPromise () {

function installMutationObserver () {
let observeNum = 1
const textNode = document.createTextNode(observeNum)
const textNode = document.createTextNode(observeNum.toString())
const observer = new MutationObserver(nextHandler)
observer.observe(textNode, {
characterData: true
Expand Down
48 changes: 48 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"extends": [
"tslint:latest",
"tslint-react"
],
"defaultSeverity": "warning",
"rules": {
"ordered-imports": [
"false"
],
"no-bitwise": false,
"no-object-literal-type-assertion": false,
"member-access": false,
"object-literal-sort-keys": false,
"jsx-alignment": true,
"jsx-self-close": true,
"jsx-no-multiline-js": false,
"quotemark": [
true,
"single",
"avoid-escape"
],
"semicolon": [
true,
"never"
],
"no-string-literal": false,
"jsx-boolean-value": false,
"jsx-wrap-multiline": false,
"variable-name": [
true,
"allow-leading-underscore",
"ban-keywords"
],
"space-before-function-paren": true,
"object-literal-key-quotes": [
false,
"as-needed"
],
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
]
}
}
37 changes: 34 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ code-point-at@^1.0.0:
version "1.1.0"
resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"

colors@^1.1.0:
colors@^1.1.0, colors@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"

Expand Down Expand Up @@ -1582,7 +1582,7 @@ di@^0.0.1:
version "0.0.1"
resolved "https://registry.npmjs.org/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c"

[email protected], diff@^3.1.0:
[email protected], diff@^3.1.0, diff@^3.2.0:
version "3.2.0"
resolved "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"

Expand Down Expand Up @@ -4075,7 +4075,7 @@ [email protected]:
version "1.1.7"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.3:
resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.2, resolve@^1.3.3:
version "1.4.0"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86"
dependencies:
Expand Down Expand Up @@ -4634,6 +4634,37 @@ tryit@^1.0.1:
version "1.0.3"
resolved "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb"

tslib@^1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.7.1.tgz#bc8004164691923a79fe8378bbeb3da2017538ec"

tslint-react@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/tslint-react/-/tslint-react-3.2.0.tgz#851fb505201c63d0343c51726e6364f7e9ad2e99"
dependencies:
tsutils "^2.8.0"

tslint@^5.7.0:
version "5.7.0"
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.7.0.tgz#c25e0d0c92fa1201c2bc30e844e08e682b4f3552"
dependencies:
babel-code-frame "^6.22.0"
colors "^1.1.2"
commander "^2.9.0"
diff "^3.2.0"
glob "^7.1.1"
minimatch "^3.0.4"
resolve "^1.3.2"
semver "^5.3.0"
tslib "^1.7.1"
tsutils "^2.8.1"

tsutils@^2.8.0, tsutils@^2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.8.1.tgz#3771404e7ca9f0bedf5d919a47a4b1890a68efff"
dependencies:
tslib "^1.7.1"

[email protected]:
version "0.0.0"
resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
Expand Down

0 comments on commit e2154b7

Please sign in to comment.