Skip to content

Commit 2e4b36b

Browse files
amilajackmathiasrw
authored andcommitted
Added initial eslint, babel, and flow support (#129)
1 parent 19f7f03 commit 2e4b36b

File tree

6 files changed

+287
-60
lines changed

6 files changed

+287
-60
lines changed

.babelrc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"presets": ["es2015", "stage-0"],
3+
"plugins": [
4+
"add-module-exports",
5+
"transform-runtime"
6+
],
7+
"env": {
8+
"development": {
9+
"plugins": [
10+
"syntax-flow",
11+
"tcomb",
12+
"transform-flow-strip-types"
13+
]
14+
},
15+
"production": {
16+
"plugins": [
17+
"babel-plugin-transform-remove-console",
18+
"babel-plugin-transform-remove-debugger",
19+
"babel-plugin-dev-expression",
20+
"syntax-flow",
21+
"transform-flow-strip-types"
22+
]
23+
}
24+
}

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.yml]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.{json,js,jsx,html,css}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[.eslintrc]
20+
indent_style = space
21+
indent_size = 2
22+
23+
[*.md]
24+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"env": {
5+
"browser": true,
6+
"node": true,
7+
"es6": true
8+
},
9+
"rules": {
10+
"arrow-parens": 0,
11+
"class-methods-use-this": 0, # HACK: Classes will be replaced by pure fn's
12+
"comma-dangle": ["error", "never"],
13+
"consistent-return": 2,
14+
"func-names": 2,
15+
# "fp/no-class": "error", # TODO: In progress
16+
"fp/no-delete": "error",
17+
"fp/no-events": "error",
18+
"fp/no-let": "error",
19+
"fp/no-loops": "error",
20+
"fp/no-mutating-assign": "error",
21+
"flowtype-errors/show-errors": 2,
22+
# "fp/no-mutation": "error", # TODO: In progress
23+
# "fp/no-nil": "error", # TODO: In progress
24+
# "fp/no-proxy": "error", # TODO: In progress
25+
# "fp/no-this": "error", # TODO: In progress
26+
# "fp/no-throw": "error", # TODO: In progress
27+
# "fp/no-unused-expression": "error", # TODO: In progress
28+
"generator-star-spacing": [0], # HACK: https://github.com/airbnb/javascript/issues/948
29+
"import/no-extraneous-dependencies": ["off"],
30+
"import/no-unresolved": [2, { "ignore": ["electron"] }],
31+
"jsx-filename-extension": 0,
32+
"jsx-a11y/no-static-element-interactions": 0,
33+
"new-cap": 0,
34+
"no-implicit-coercion": "error",
35+
"no-mixed-operators": 0,
36+
"no-use-before-define": 0,
37+
"no-nested-ternary": 0,
38+
"no-underscore-dangle": 0,
39+
"no-console": 0,
40+
"no-var": "error",
41+
"promise/param-names": 2,
42+
"promise/always-return": 2,
43+
"promise/catch-or-return": 2,
44+
"promise/no-native": 0,
45+
"flowtype/define-flow-type": 2,
46+
# "flowtype/require-parameter-type": 2,
47+
# "flowtype/require-return-type": [ # TODO: In progress
48+
# 2,
49+
# "always",
50+
# {
51+
# "annotateUndefined": "never"
52+
# }
53+
# ],
54+
"flowtype/space-after-type-colon": [
55+
2,
56+
"always"
57+
],
58+
"flowtype/space-before-type-colon": [
59+
2,
60+
"never"
61+
],
62+
"flowtype/type-id-match": [
63+
2,
64+
"^([A-Z][a-z0-9]+)+Type$"
65+
],
66+
"flowtype/use-flow-type": 2,
67+
"flowtype/valid-syntax": 2
68+
},
69+
"plugins": [
70+
"import",
71+
"fp",
72+
"promise",
73+
"flowtype",
74+
"flowtype-errors"
75+
],
76+
"settings": {
77+
"webpack": {
78+
"config": "webpack.config.eslint.js"
79+
},
80+
"flowtype": {
81+
"onlyFilesWithFlowAnnotation": false
82+
}
83+
}
84+
}

.flowconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[ignore]
2+
.*/node_modules/fbjs/.*
3+
.*/node_modules/*
4+
.*/git/.*
5+
6+
[include]
7+
./app/*.js
8+
./node_modules/
9+
10+
[libs]
11+
12+
[options]
13+
esproposal.class_static_fields=enable
14+
esproposal.class_instance_fields=enable
15+
esproposal.export_star_as=enable

.gitignore

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,55 @@
1-
node_modules
1+
# Logs
2+
logs
23
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
*.pid.lock
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
19+
.grunt
20+
21+
# nyc test coverage
22+
.nyc_output
23+
24+
# Optional npm cache directory
25+
.npm
26+
27+
# Optional REPL history
28+
.node_repl_history
29+
30+
# node-waf configuration
31+
.lock-wscript
32+
33+
# Compiled binary addons (http://nodejs.org/api/addons.html)
34+
build/Release
35+
36+
# Dependency directory
37+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
38+
node_modules
39+
app/node_modules
40+
41+
# OSX
342
.DS_Store
4-
npm-debug.log
43+
44+
# Packaged and compiled files
45+
dist
46+
app/dist
47+
app/main.js
48+
app/main.js.map
49+
release
50+
51+
# Env configuration
52+
.env
53+
54+
# Editor
55+
.idea

package.json

Lines changed: 87 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,89 @@
11
{
2-
"name": "paralleljs",
3-
"version": "0.2.1",
4-
"author": "Adam Savitzky <adam.savitzky@gmail.com>",
5-
"contributors": [
6-
"Sebastian Mayr <sebmaster16@gmail.com> (http://s3bmaster.blogspot.co.at/)"
7-
],
8-
"description": "parallel.js enables easy multi-thread processing in javascript",
9-
"main": "lib/parallel.js",
10-
"repository": {
11-
"type": "git",
12-
"url": "https://github.com/adambom/parallel.js.git"
13-
},
14-
"directories": {
15-
"lib": "lib",
16-
"test": "test"
17-
},
18-
"keywords": [
19-
"parallel",
20-
"spawn",
21-
"map",
22-
"thread",
23-
"parallel.js",
24-
"workers",
25-
"webworkers"
26-
],
27-
"devDependencies": {
28-
"jasmine-node": "x",
29-
"q": "x"
30-
},
31-
"license": "BSD",
32-
"scripts": {
33-
"test": "jasmine-node --verbose test/specs"
34-
},
35-
"browser": {
36-
"child_process": false
37-
},
38-
"engines": {
39-
"node": ">=0.9.10"
40-
},
41-
"testling" : {
42-
"scripts": [
43-
"lib/parallel.js",
44-
"test/jasmine/jasmine.js",
45-
"test/jasmine/jasmine.tap_reporter.js",
46-
"test/specs/*.js",
47-
"test/runner.js"
48-
],
49-
"browsers": [
50-
"ie/9..latest",
51-
"chrome/22..latest",
52-
"firefox/16..latest",
53-
"safari/latest",
54-
"opera/11.0..latest",
55-
"iphone/6",
56-
"ipad/6",
57-
"android-browser/latest"
58-
]
59-
}
2+
"name": "paralleljs",
3+
"version": "0.2.1",
4+
"author": "Adam Savitzky <adam.savitzky@gmail.com>",
5+
"contributors": [
6+
"Sebastian Mayr <sebmaster16@gmail.com> (http://s3bmaster.blogspot.co.at/)",
7+
"Amila Welihinda <amilajack@gmail.com> (http://amilawelihinda.com/)"
8+
],
9+
"description": "parallel.js enables easy multi-thread processing in javascript",
10+
"license": "BSD",
11+
"scripts": {
12+
"lint": "eslint test lib *.js",
13+
"test": "npm run lint && jasmine-node --verbose test/specs"
14+
},
15+
"main": "lib/parallel.js",
16+
"repository": {
17+
"type": "git",
18+
"url": "https://github.com/adambom/parallel.js.git"
19+
},
20+
"directories": {
21+
"lib": "lib",
22+
"test": "test"
23+
},
24+
"keywords": [
25+
"parallel",
26+
"spawn",
27+
"map",
28+
"thread",
29+
"parallel.js",
30+
"workers",
31+
"webworkers"
32+
],
33+
"devDependencies": {
34+
"babel-eslint": "^6.1.2",
35+
"babel-plugin-add-module-exports": "^0.2.1",
36+
"babel-plugin-dev-expression": "^0.2.1",
37+
"babel-plugin-module-alias": "^1.6.0",
38+
"babel-plugin-syntax-flow": "^6.13.0",
39+
"babel-plugin-tcomb": "^0.3.14",
40+
"babel-plugin-transform-flow-strip-types": "^6.14.0",
41+
"babel-plugin-transform-remove-console": "^6.8.0",
42+
"babel-plugin-transform-remove-debugger": "^6.8.0",
43+
"babel-plugin-transform-runtime": "^6.15.0",
44+
"babel-polyfill": "^6.13.0",
45+
"babel-preset-stage-0": "^6.5.0",
46+
"babel-register": "^6.14.0",
47+
"babel-runtime": "^6.11.6",
48+
"eslint": "^3.6.1",
49+
"eslint-config-airbnb": "^12.0.0",
50+
"eslint-formatter-pretty": "^1.0.0",
51+
"eslint-import-resolver-webpack": "^0.6.0",
52+
"eslint-nibble-ignore": "^3.0.0",
53+
"eslint-plugin-flowtype": "^2.19.0",
54+
"eslint-plugin-flowtype-errors": "^1.2.0",
55+
"eslint-plugin-fp": "^2.2.0",
56+
"eslint-plugin-import": "^1.16.0",
57+
"eslint-plugin-jsx-a11y": "^2.2.2",
58+
"eslint-plugin-mocha": "^4.5.1",
59+
"eslint-plugin-promise": "^2.0.1",
60+
"eslint-plugin-react": "^6.3.0",
61+
"jasmine-node": "x",
62+
"q": "x"
63+
},
64+
"browser": {
65+
"child_process": false
66+
},
67+
"engines": {
68+
"node": ">=0.9.10"
69+
},
70+
"testling": {
71+
"scripts": [
72+
"lib/parallel.js",
73+
"test/jasmine/jasmine.js",
74+
"test/jasmine/jasmine.tap_reporter.js",
75+
"test/specs/*.js",
76+
"test/runner.js"
77+
],
78+
"browsers": [
79+
"ie/9..latest",
80+
"chrome/22..latest",
81+
"firefox/16..latest",
82+
"safari/latest",
83+
"opera/11.0..latest",
84+
"iphone/6",
85+
"ipad/6",
86+
"android-browser/latest"
87+
]
88+
}
6089
}

0 commit comments

Comments
 (0)