diff --git a/.eslintignore b/.eslintignore
new file mode 120000
index 000000000..3e4e48b0b
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1 @@
+.gitignore
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 98f921883..000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,78 +0,0 @@
----
-root: true
-extends: eslint:recommended
-
-# babel-eslint support more syntax stuff than eslint for now
-parser: babel-eslint
-
-ecmaFeatures:
- modules: true
- jsx: true
-
-env:
- es6: true
- browser: true
- node: true
-
-globals:
- __DEV__: true
- __DEVTOOLS__: true
- __SERVER__: true
- __PROD__: true
- __SERVER_PROTOCOL__: true
- __SERVER_HOSTNAME__: true
- __SERVER_PORT__: true
- __SERVER_HOST__: true
- __SERVER_URL__: true
-
-plugins:
- - react
-
-# 0: off, 1: warning, 2: error
-rules:
- no-console: 0
-
- indent: [2, 2] # 2 spaces indentation
- max-len: [2, 80, 4]
- quotes: [2, "double"]
- semi: [2, "never"]
- no-multiple-empty-lines: [2, {"max": 1}]
-
- brace-style: [2, "stroustrup"]
- comma-dangle: [2, "always-multiline"]
- comma-style: [2, "last"]
- dot-location: [2, "property"]
-
- one-var: [2, "never"]
- no-var: [2]
- prefer-const: [2]
- no-bitwise: [2]
-
- object-curly-spacing: [2, "always"]
- array-bracket-spacing: [2, "always"]
- #computed-property-spacing: [2, "always"]
-
- space-unary-ops: [2, {"words": true, "nonwords": false}]
- space-after-keywords: [2, "always"]
- space-before-blocks: [2, "always"]
- space-before-function-paren: [2, "never"]
- space-in-parens: [2, "never"]
- spaced-comment: [2, "always"]
-
- # eslint-plugin-react rules
- react/jsx-boolean-value: 2
- react/jsx-no-undef: 2
- react/jsx-quotes: 2
- #react/jsx-sort-prop-types: 2
- #react/jsx-sort-props: 2
- react/jsx-uses-react: 2
- react/jsx-uses-vars: 2
- react/no-did-mount-set-state: 2
- react/no-did-update-set-state: 2
- react/no-multi-comp: 2
- react/no-unknown-property: 2
- react/prop-types: 2
- react/react-in-jsx-scope: 2
- react/self-closing-comp: 2
- react/sort-comp: 2
- react/wrap-multilines: 2
diff --git a/.gitignore b/.gitignore
index 08c1973c2..f8bcdf13a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,9 @@
+node_modules
+
# build
lib
# demo build
-dist
+demo/node_modules
+demo/dist
+demo/statinamic-static.js
diff --git a/demo/.eslintignore b/demo/.eslintignore
new file mode 120000
index 000000000..3e4e48b0b
--- /dev/null
+++ b/demo/.eslintignore
@@ -0,0 +1 @@
+.gitignore
\ No newline at end of file
diff --git a/demo/.gitignore b/demo/.gitignore
index f7ad877d1..f9df76d81 100644
--- a/demo/.gitignore
+++ b/demo/.gitignore
@@ -1,2 +1,3 @@
node_modules
+dist
statinamic-static*
diff --git a/demo/build.js b/demo/build.js
index 7abc99006..46ae2c90f 100644
--- a/demo/build.js
+++ b/demo/build.js
@@ -94,7 +94,7 @@ const webpackConfig = {
})
)
),
- ...config.dev && [ "eslint-loader" ],
+ ...config.dev && [ "eslint-loader?fix" ],
],
exclude: /node_modules/,
},
diff --git a/demo/package.json b/demo/package.json
index 56d47386c..93b159f61 100644
--- a/demo/package.json
+++ b/demo/package.json
@@ -30,9 +30,9 @@
"babel-loader": "^5.3.2",
"babel-plugin-react-transform": "^1.0.1",
"css-loader": "^0.17.0",
- "eslint": "^1.1.0",
- "eslint-loader": "^1.0.0",
- "eslint-plugin-react": "^3.2.2",
+ "eslint": "^1.7.2",
+ "eslint-loader": "^1.1.0",
+ "eslint-plugin-react": "^3.6.2",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.1",
"gh-pages": "^0.4.0",
@@ -53,6 +53,8 @@
"start": "babel-node build --server --open --dev",
"static+start": "babel-node build --static --server --open --dev",
"ci-deploy": "if [ \"$TRAVIS_PULL_REQUEST\" = \"false\" ] && [ \"$TRAVIS_BRANCH\" = \"master\" ]; then gh-pages -d dist; fi;",
+ "lint": "eslint --fix .",
+ "pretest": "npm run lint",
"test": "npm run static && npm run ci-deploy"
},
"babel": {
diff --git a/demo/web_modules/Collection/index.js b/demo/web_modules/Collection/index.js
index 2e8a52d20..3848d72ed 100644
--- a/demo/web_modules/Collection/index.js
+++ b/demo/web_modules/Collection/index.js
@@ -30,7 +30,7 @@ class Collection extends Component {
{
Boolean(!collection || !collection.length) &&
- No entry
+ { "No entry" }
}
{
diff --git a/demo/web_modules/Home/index.js b/demo/web_modules/Home/index.js
deleted file mode 100644
index c75b1b1c4..000000000
--- a/demo/web_modules/Home/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React, { Component } from "react"
-// import { PropTypes } from "react"
-
-export default class Home extends Component {
-
- // static propTypes = {
- // title: PropTypes.bool,
- // }
-
- render() {
- return (
-
- Home !
-
- )
- }
-}
diff --git a/demo/web_modules/Layout/index.js b/demo/web_modules/Layout/index.js
index 3a0b00ab0..4c704a3f7 100644
--- a/demo/web_modules/Layout/index.js
+++ b/demo/web_modules/Layout/index.js
@@ -43,26 +43,28 @@ export default class Layout extends Component {
render() {
return (
-
-