Skip to content

Commit 58e6dd3

Browse files
committed
fix lint
1 parent 2295796 commit 58e6dd3

9 files changed

+118
-14
lines changed

.jshintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.jshintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"node": true,
3+
4+
"curly": true,
5+
"latedef": true,
6+
"quotmark": true,
7+
"undef": true,
8+
"unused": true,
9+
"trailing": true
10+
}

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 100,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ notifications:
77
88

99
node_js:
10-
- 6.9.1
10+
- 8.1.0
1111

1212
before_install:
1313
- |

eslintrc.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: ['airbnb', 'prettier', 'prettier/react'],
3+
parser: 'babel-eslint',
4+
rules: {
5+
strict: 0,
6+
'no-param-reassign': 0,
7+
'arrow-body-style': 0,
8+
'id-length': 0,
9+
'import/no-extraneous-dependencies': 0,
10+
'import/no-unresolved': 0,
11+
'import/extensions': 0,
12+
'no-underscore-dangle': 0,
13+
'react/jsx-filename-extension': 0,
14+
'react/require-default-props': 0,
15+
'react/forbid-prop-types': 0,
16+
'react/no-unused-prop-types': 0,
17+
'no-plusplus': 0,
18+
'no-bitwise': [2, { allow: ['~'] }],
19+
'jsx-a11y/no-static-element-interactions': 0,
20+
'jsx-a11y/anchor-has-content': 0,
21+
'jsx-a11y/click-events-have-key-events': 0,
22+
'jsx-a11y/anchor-is-valid': 0,
23+
'jsx-a11y/label-has-for': 0,
24+
'prefer-destructuring': 0,
25+
'no-class-assign': 0,
26+
'react/no-array-index-key': 0,
27+
'react/no-find-dom-node': 0,
28+
},
29+
globals: {
30+
expect: true,
31+
document: true,
32+
window: true,
33+
},
34+
env: {
35+
jest: true,
36+
node: true,
37+
mocha: true,
38+
},
39+
};

package.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,29 @@
6060
"karma": "rc-test run karma",
6161
"saucelabs": "rc-test run saucelabs",
6262
"test": "rc-test run test",
63+
"prettier": "rc-tools run prettier",
6364
"chrome-test": "rc-test run chrome-test",
64-
"coverage": "rc-test run coverage"
65+
"coverage": "rc-test run coverage",
66+
"validate": "npm ls"
6567
},
6668
"devDependencies": {
6769
"@types/react": "^16.0.0",
6870
"core-js": "^2.5.7",
6971
"expect.js": "0.3.x",
70-
"pre-commit": "1.x",
71-
"precommit-hook": "1.x",
72+
"precommit-hook": "^3.0.0",
7273
"rc-test": "6.x",
7374
"rc-tools": "8.x",
7475
"react": "^16.4.0",
7576
"react-dom": "^16.4.0",
7677
"rc-queue-anim": "^1.6.1",
7778
"rc-scroll-anim": "2.x",
79+
"tslint-config-prettier": "^1.17.0",
80+
"tslint-react": "^3.6.0",
7881
"typescript": "3.x"
7982
},
8083
"pre-commit": [
81-
"lint"
84+
"lint",
85+
"test"
8286
],
8387
"dependencies": {
8488
"prop-types": "^15.6.1",

tests/index.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export default () => (
1111
animation={{
1212
x: 100,
1313
ease: 'easeInBounce',
14-
onStart: ({ index, target }) => { },
14+
onStart: ({ index, target }) => {
15+
console.log(index, target);
16+
},
1517
}}
1618
>
1719
test
@@ -20,11 +22,15 @@ export default () => (
2022
animation={[{
2123
x: 100,
2224
ease,
23-
onStart: ({ index, target }) => { },
25+
onStart: ({ index, target }) => {
26+
console.log(index, target);
27+
},
2428
}, {
2529
x: 200,
2630
ease,
27-
onComplete: ({ index, target }) => { },
31+
onComplete: ({ index, target }) => {
32+
console.log(index, target);
33+
},
2834
}]}
2935
>
3036
test

tsconfig.json

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
{
22
"compilerOptions": {
3-
"strictNullChecks": true,
4-
"moduleResolution": "node",
3+
"outDir": "build/dist",
4+
"module": "esnext",
5+
"target": "es2016",
6+
"lib": ["es6", "dom"],
7+
"sourceMap": true,
58
"jsx": "react",
6-
"target": "es6",
7-
"noImplicitAny": true
8-
}
9-
}
9+
"allowSyntheticDefaultImports": true,
10+
"moduleResolution": "node",
11+
"rootDirs": ["/src", "./typings"],
12+
"forceConsistentCasingInFileNames": true,
13+
"noImplicitReturns": true,
14+
"suppressImplicitAnyIndexErrors": true,
15+
"noUnusedLocals": true,
16+
"allowJs": true,
17+
"experimentalDecorators": true
18+
},
19+
"include": ["./src"],
20+
"exclude": [
21+
"node_modules",
22+
"build",
23+
"scripts",
24+
"acceptance-tests",
25+
"webpack",
26+
"jest",
27+
"src/setupTests.ts",
28+
"tslint:latest",
29+
"tslint-config-prettier"
30+
]
31+
}

tslint.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": ["tslint:latest", "tslint-react", "tslint-config-prettier"],
3+
"rules": {
4+
"no-var-requires": false,
5+
"no-submodule-imports": false,
6+
"object-literal-sort-keys": false,
7+
"jsx-no-lambda": false,
8+
"no-implicit-dependencies": false,
9+
"no-console": false
10+
}
11+
}

0 commit comments

Comments
 (0)