Skip to content

Commit 0103b52

Browse files
committed
Added eslint and travis check for lint script
1 parent 180e00b commit 0103b52

File tree

10 files changed

+9249
-58
lines changed

10 files changed

+9249
-58
lines changed

.eslintrc.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
extends:
2+
- eslint:recommended
3+
- plugin:import/errors
4+
- plugin:import/warnings
5+
- plugin:inferno/recommended
6+
- plugin:react/recommended
7+
- google
8+
9+
plugins:
10+
- babel
11+
- require-jsdoc-except
12+
13+
rules:
14+
# Disabled rules
15+
no-console: off
16+
comma-dangle: off
17+
arrow-parens: off
18+
space-before-function-paren: off
19+
object-curly-spacing: off
20+
padded-blocks: off
21+
camelcase: off
22+
require-jsdoc: off
23+
no-invalid-this: off
24+
25+
# Enabled rules
26+
babel/no-invalid-this: 2
27+
curly: [2, "all"]
28+
indent: [2, 4, { SwitchCase: 1, ignoredNodes: ["JSXElement *"]}]
29+
space-infix-ops: 2
30+
prefer-template: 2
31+
valid-jsdoc: [2, { prefer: { return: "returns"}, requireReturn: false, requireReturnDescription: false }]
32+
max-len: [2, {
33+
code: 130,
34+
tabWidth: 2,
35+
ignoreUrls: true,
36+
}]
37+
max-lines-per-function: [2, 60]
38+
max-lines: [2, {
39+
max: 600,
40+
skipComments: true,
41+
skipBlankLines: true
42+
}]
43+
require-jsdoc-except/require-jsdoc: ["error", {
44+
require: {
45+
FunctionDeclaration: true,
46+
MethodDefinition: true,
47+
FunctionExpression: true,
48+
},
49+
ignore: ["constructor", "componentDidMount", "componentDidUpdate", "componentWillUnmount", "render"]
50+
}]
51+
52+
parser: babel-eslint
53+
parserOptions:
54+
ecmaVersion: 8
55+
56+
env:
57+
browser: true
58+
node: true
59+
60+
globals:
61+
Promise: true
62+
describe: true
63+
beforeAll: true
64+
afterAll: true
65+
it: true
66+
expect: true
67+
jest: true
68+
afterEach: true
69+
beforeEach: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
.idea/

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ language: node_js
33
node_js:
44
- '7'
55
script:
6-
- npm test
6+
- npm run lint
7+
- npm test

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ npm install react-utils-button
1313
import Button from 'react-utils-button';
1414

1515
<Button value='Click me'
16-
className="my-extra-class"
16+
className='my-extra-class'
1717
onClick={() => { console.log('clicked'); }}
1818
active={false}
1919
disabled={false}/>
@@ -22,7 +22,7 @@ import Button from 'react-utils-button';
2222
The library can also be loaded via require:
2323

2424
```javascript
25-
const Button = require('react-utils-button')
25+
const Button = require('react-utils-button');
2626
```
2727

2828
## Options

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)