Update lint rules, add prettier
MODIFY
.gitignore
.gitignore
node_modules
yarn.lock
+yarn-error.log
\ No newline at end of file

MODIFY
package.json
package.json
"watch": "ecmarkup --watch spec/index.emu index.html --css ecmarkup.css --js ecmarkup.js",
"build-shim-dev": "cross-env NODE_ENV=development rollup -c shim/rollup.config.js --watch",
"build-shim-prod": "cross-env NODE_ENV=production rollup -c shim/rollup.config.js",
- "lint": "eslint src/"
+ "lint": "./node_modules/.bin/eslint ./shim/src",
+ "prettier": "./node_modules/.bin/prettier --config ./shim/.prettierrc --write ./shim/src/**/*.js"
},
"repository": {
"type": "git",
"babel-preset-es2015": "^6.22.0",
"cross-env": "^3.1.4",
"ecmarkup": "latest",
- "eslint": "^3.0.1",
+ "eslint": "^4.19.1",
+ "eslint-config-airbnb-base": "^12.1.0",
+ "eslint-config-prettier": "^2.9.0",
+ "eslint-plugin-import": "^2.11.0",
+ "eslint-plugin-prettier": "^2.6.0",
"forever": "^0.15.2",
+ "prettier": "^1.12.1",
"rollup": "^0.41.3",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-uglify": "^1.0.1",

MODIFY
shim/.eslintrc
shim/.eslintrc
{
- "extends": "eslint:recommended",
- "parser": "babel-eslint",
+ "extends": ["airbnb-base", "prettier"],
+ "root": true,
"env": {
+ "amd": true,
+ "browser": true,
"es6": true,
- "browser": true
+ "node": true
},
"parserOptions": {
- "ecmaVersion": 6,
+ "ecmaVersion": 2015,
"sourceType": "module"
+ },
+ "plugins": [
+ "prettier"
+ ],
+ "rules": {
+ "prettier/prettier": "error",
+ // Overriden
+ "import/named": "error",
+ "no-eval": "off",
+ "prefer-destructuring": "off",
+ // TODOs - Temporarily disable rules, fix this progressively
+ "no-param-reassign": "off",
+ "no-cond-assign": "off",
+ "func-names": "off",
+ "no-nested-ternary": "off",
+ "no-plusplus": "off",
+ "strict": "off",
+ "no-restricted-syntax": "off",
+ "import/no-mutable-exports": "off",
+ "guard-for-in": "off",
+ "import/prefer-default-export": "off",
+ "prefer-rest-params": "off",
+ "one-var": "off",
+ "prefer-spread": "off",
+ "no-lonely-if": "off",
+ "no-prototype-builtins": "off",
+ "no-continue": "off",
+ "no-shadow": "off",
+ // Rules up for discussion
+ "no-multi-assign": "off",
+ // TODOs - end
}
}

ADD
shim/.prettierrc
+{
+ "printWidth": 100,
+ "parser": "flow",
+ "useTabs": false,
+ "tabWidth": 2,
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "bracketSpacing": true
+}
\ No newline at end of file

MODIFY
shim/src/main.js
shim/src/main.js
-export { default } from "./realm";
+export { default } from './realm';

Update lint rules, add prettier