API: automatic linting of JS and SCSS

+ yarn lint:check - to check code styling
+ yarn lint:fix - to fix code styling
This commit is contained in:
Tony Air 2018-02-22 18:48:28 +07:00
parent f6ab76e334
commit 50476d1002
10 changed files with 851 additions and 73 deletions

View File

@ -209,7 +209,7 @@
"max-params": 0, // limits the number of parameters that can be used in the function declaration. (off by default)
"max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
"no-bitwise": 0, // disallow use of bitwise operators (off by default)
"no-plusplus": 0 // disallow use of unary operators, ++ and -- (off by default)
"no-plusplus": 0, // disallow use of unary operators, ++ and -- (off by default)
//////// Extra //////////
"array-bracket-spacing": ["error", "never"],
@ -251,6 +251,6 @@
"react/self-closing-comp": "error",
"react/sort-comp": "error",
"import/no-mutable-exports": "error",
"import/imports-first": "error"
"import/imports-first": "warn"
}
}

View File

@ -1 +0,0 @@
module.exports = require('@silverstripe/eslint-config/.eslintrc');

763
package-lock.json generated
View File

@ -4,6 +4,137 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz",
"integrity": "sha512-eVXQSbu/RimU6OKcK2/gDJVTFcxXJI4sHbIqw2mhwMZeQ2as/8AhS9DGkEDoHMBBNJZ5B0US63lF56x+KDcxiA==",
"dev": true,
"requires": {
"@babel/highlight": "7.0.0-beta.40"
}
},
"@babel/generator": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.40.tgz",
"integrity": "sha512-c91BQcXyTq/5aFV4afgOionxZS1dxWt8OghEx5Q52SKssdGRFSiMKnk9tGkev1pYULPJBqjSDZU2Pcuc58ffZw==",
"dev": true,
"requires": {
"@babel/types": "7.0.0-beta.40",
"jsesc": "2.5.1",
"lodash": "4.17.5",
"source-map": "0.5.7",
"trim-right": "1.0.1"
},
"dependencies": {
"jsesc": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz",
"integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=",
"dev": true
},
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
}
}
},
"@babel/helper-function-name": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz",
"integrity": "sha512-cK9BVLtOfisSISTTHXKGvBc2OBh65tjEk4PgXhsSnnH0i8RP2v+5RCxoSlh2y/i+l2fxQqKqv++Qo5RMiwmRCA==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "7.0.0-beta.40",
"@babel/template": "7.0.0-beta.40",
"@babel/types": "7.0.0-beta.40"
}
},
"@babel/helper-get-function-arity": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz",
"integrity": "sha512-MwquaPznI4cUoZEgHC/XGkddOXtqKqD4DvZDOyJK2LR9Qi6TbMbAhc6IaFoRX7CRTFCmtGeu8gdXW2dBotBBTA==",
"dev": true,
"requires": {
"@babel/types": "7.0.0-beta.40"
}
},
"@babel/highlight": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.40.tgz",
"integrity": "sha512-mOhhTrzieV6VO7odgzFGFapiwRK0ei8RZRhfzHhb6cpX3QM8XXuCLXWjN8qBB7JReDdUR80V3LFfFrGUYevhNg==",
"dev": true,
"requires": {
"chalk": "2.3.1",
"esutils": "2.0.2",
"js-tokens": "3.0.2"
}
},
"@babel/template": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.40.tgz",
"integrity": "sha512-RlQiVB7eL7fxsKN6JvnCCwEwEL28CBYalXSgWWULuFlEHjtMoXBqQanSie3bNyhrANJx67sb+Sd/vuGivoMwLQ==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0-beta.40",
"@babel/types": "7.0.0-beta.40",
"babylon": "7.0.0-beta.40",
"lodash": "4.17.5"
},
"dependencies": {
"babylon": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz",
"integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==",
"dev": true
}
}
},
"@babel/traverse": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.40.tgz",
"integrity": "sha512-h96SQorjvdSuxQ6hHFIuAa3oxnad1TA5bU1Zz88+XqzwmM5QM0/k2D+heXGGy/76gT5ajl7xYLKGiPA/KTyVhQ==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0-beta.40",
"@babel/generator": "7.0.0-beta.40",
"@babel/helper-function-name": "7.0.0-beta.40",
"@babel/types": "7.0.0-beta.40",
"babylon": "7.0.0-beta.40",
"debug": "3.1.0",
"globals": "11.3.0",
"invariant": "2.2.3",
"lodash": "4.17.5"
},
"dependencies": {
"babylon": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz",
"integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==",
"dev": true
}
}
},
"@babel/types": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.40.tgz",
"integrity": "sha512-uXCGCzTgMZxcSUzutCPtZmXbVC+cvENgS2e0tRuhn+Y1hZnMb8IHP0Trq7Q2MB/eFmG5pKrAeTIUfQIe5kA4Tg==",
"dev": true,
"requires": {
"esutils": "2.0.2",
"lodash": "4.17.5",
"to-fast-properties": "2.0.0"
},
"dependencies": {
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
"dev": true
}
}
},
"@most/multicast": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@most/multicast/-/multicast-1.3.0.tgz",
@ -544,6 +675,28 @@
}
}
},
"babel-eslint": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz",
"integrity": "sha512-Qt2lz2egBxNYWqN9JIO2z4NOOf8i4b5JS6CFoYrOZZTDssueiV1jH/jsefyg+86SeNY3rB361/mi3kE1WK2WYQ==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0-beta.40",
"@babel/traverse": "7.0.0-beta.40",
"@babel/types": "7.0.0-beta.40",
"babylon": "7.0.0-beta.40",
"eslint-scope": "3.7.1",
"eslint-visitor-keys": "1.0.0"
},
"dependencies": {
"babylon": {
"version": "7.0.0-beta.40",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz",
"integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==",
"dev": true
}
}
},
"babel-generator": {
"version": "6.26.1",
"resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz",
@ -3004,6 +3157,12 @@
"integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
"dev": true
},
"contains-path": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
"dev": true
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
@ -4677,6 +4836,105 @@
"text-table": "0.2.0"
}
},
"eslint-import-resolver-node": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
"integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
"dev": true,
"requires": {
"debug": "2.6.9",
"resolve": "1.5.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
}
}
},
"eslint-module-utils": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz",
"integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==",
"dev": true,
"requires": {
"debug": "2.6.9",
"pkg-dir": "1.0.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
}
}
},
"eslint-plugin-import": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz",
"integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=",
"dev": true,
"requires": {
"builtin-modules": "1.1.1",
"contains-path": "0.1.0",
"debug": "2.6.9",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "0.3.2",
"eslint-module-utils": "2.1.1",
"has": "1.0.1",
"lodash": "4.17.5",
"minimatch": "3.0.4",
"read-pkg-up": "2.0.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "2.0.2",
"isarray": "1.0.0"
}
}
}
},
"eslint-plugin-jquery": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jquery/-/eslint-plugin-jquery-1.3.0.tgz",
"integrity": "sha512-YTHb9wcMpCNzu6Ig6SZV6UmHtmy20legETJH/DiANwCGtELHxi4iN8r+LC24IjrrB9LwqeSU/GhI9ojhPO5Hug==",
"dev": true
},
"eslint-plugin-react": {
"version": "7.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz",
"integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==",
"dev": true,
"requires": {
"doctrine": "2.1.0",
"has": "1.0.1",
"jsx-ast-utils": "2.0.1",
"prop-types": "15.6.0"
}
},
"eslint-scope": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
@ -4856,6 +5114,12 @@
"integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=",
"dev": true
},
"exit-hook": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz",
"integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=",
"dev": true
},
"expand-brackets": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
@ -5852,6 +6116,15 @@
"readable-stream": "2.3.4"
}
},
"front-matter": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.1.2.tgz",
"integrity": "sha1-91mDufL0E75ljJPf172M5AePXNs=",
"dev": true,
"requires": {
"js-yaml": "3.10.0"
}
},
"fs-extra": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz",
@ -7131,6 +7404,23 @@
"sparkles": "1.0.0"
}
},
"gonzales-pe-sl": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/gonzales-pe-sl/-/gonzales-pe-sl-4.2.3.tgz",
"integrity": "sha1-aoaLw4BkXxQf7rBCxvl/zHG1n+Y=",
"dev": true,
"requires": {
"minimist": "1.1.3"
},
"dependencies": {
"minimist": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz",
"integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=",
"dev": true
}
}
},
"got": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/got/-/got-5.7.1.tgz",
@ -9213,6 +9503,15 @@
}
}
},
"jsx-ast-utils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
"integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
"dev": true,
"requires": {
"array-includes": "3.0.3"
}
},
"kew": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz",
@ -9243,6 +9542,12 @@
"graceful-fs": "4.1.11"
}
},
"known-css-properties": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.3.0.tgz",
"integrity": "sha512-QMQcnKAiQccfQTqtBh/qwquGZ2XK/DXND1jrcN9M8gMMy99Gwla7GQjndVUsEqIaRyP6bsFRuhwRj5poafBGJQ==",
"dev": true
},
"laravel-mix": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/laravel-mix/-/laravel-mix-1.7.2.tgz",
@ -9727,6 +10032,12 @@
"integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=",
"dev": true
},
"lodash.capitalize": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz",
"integrity": "sha1-+CbJtOKoUR2E46yinbBeGk87cqk=",
"dev": true
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
@ -9796,6 +10107,12 @@
"integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=",
"dev": true
},
"lodash.kebabcase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
"integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=",
"dev": true
},
"lodash.keys": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz",
@ -9807,6 +10124,12 @@
"lodash.isarray": "3.0.4"
}
},
"lodash.map": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz",
"integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=",
"dev": true
},
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
@ -10199,6 +10522,12 @@
}
}
},
"merge": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz",
"integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=",
"dev": true
},
"merge-defaults": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/merge-defaults/-/merge-defaults-0.2.1.tgz",
@ -11710,6 +12039,15 @@
"pngjs": "3.3.2"
}
},
"pkg-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
"integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
"dev": true,
"requires": {
"find-up": "1.1.2"
}
},
"pluralize": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
@ -14282,6 +14620,34 @@
"set-immediate-shim": "1.0.1"
}
},
"readline2": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz",
"integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=",
"dev": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"mute-stream": "0.0.5"
},
"dependencies": {
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"requires": {
"number-is-nan": "1.0.1"
}
},
"mute-stream": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz",
"integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=",
"dev": true
}
}
},
"recast": {
"version": "0.11.23",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz",
@ -15072,6 +15438,388 @@
}
}
},
"sass-lint": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/sass-lint/-/sass-lint-1.12.1.tgz",
"integrity": "sha1-Yw9pwhaqIGuCMvsqqQe98zNrbYM=",
"dev": true,
"requires": {
"commander": "2.14.1",
"eslint": "2.13.1",
"front-matter": "2.1.2",
"fs-extra": "3.0.1",
"glob": "7.1.2",
"globule": "1.2.0",
"gonzales-pe-sl": "4.2.3",
"js-yaml": "3.10.0",
"known-css-properties": "0.3.0",
"lodash.capitalize": "4.2.1",
"lodash.kebabcase": "4.1.1",
"merge": "1.2.0",
"path-is-absolute": "1.0.1",
"util": "0.10.3"
},
"dependencies": {
"ajv": {
"version": "4.11.8",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
"integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=",
"dev": true,
"requires": {
"co": "4.6.0",
"json-stable-stringify": "1.0.1"
}
},
"ajv-keywords": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz",
"integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=",
"dev": true
},
"ansi-escapes": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
"integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=",
"dev": true
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "2.2.1",
"escape-string-regexp": "1.0.5",
"has-ansi": "2.0.0",
"strip-ansi": "3.0.1",
"supports-color": "2.0.0"
}
},
"cli-cursor": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz",
"integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=",
"dev": true,
"requires": {
"restore-cursor": "1.0.1"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "2.0.2",
"isarray": "1.0.0"
}
},
"eslint": {
"version": "2.13.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-2.13.1.tgz",
"integrity": "sha1-5MyPoPAJ+4KaquI4VaKTYL4fbBE=",
"dev": true,
"requires": {
"chalk": "1.1.3",
"concat-stream": "1.6.0",
"debug": "2.6.9",
"doctrine": "1.5.0",
"es6-map": "0.1.5",
"escope": "3.6.0",
"espree": "3.5.3",
"estraverse": "4.2.0",
"esutils": "2.0.2",
"file-entry-cache": "1.3.1",
"glob": "7.1.2",
"globals": "9.18.0",
"ignore": "3.3.7",
"imurmurhash": "0.1.4",
"inquirer": "0.12.0",
"is-my-json-valid": "2.17.2",
"is-resolvable": "1.1.0",
"js-yaml": "3.10.0",
"json-stable-stringify": "1.0.1",
"levn": "0.3.0",
"lodash": "4.17.5",
"mkdirp": "0.5.1",
"optionator": "0.8.2",
"path-is-absolute": "1.0.1",
"path-is-inside": "1.0.2",
"pluralize": "1.2.1",
"progress": "1.1.8",
"require-uncached": "1.0.3",
"shelljs": "0.6.1",
"strip-json-comments": "1.0.4",
"table": "3.8.3",
"text-table": "0.2.0",
"user-home": "2.0.0"
}
},
"figures": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
"integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=",
"dev": true,
"requires": {
"escape-string-regexp": "1.0.5",
"object-assign": "4.1.1"
}
},
"file-entry-cache": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.3.1.tgz",
"integrity": "sha1-RMYepgeuS+nBQC9B9EJwy/4zT/g=",
"dev": true,
"requires": {
"flat-cache": "1.3.0",
"object-assign": "4.1.1"
}
},
"globals": {
"version": "9.18.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
"integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
"dev": true
},
"inquirer": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz",
"integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=",
"dev": true,
"requires": {
"ansi-escapes": "1.4.0",
"ansi-regex": "2.1.1",
"chalk": "1.1.3",
"cli-cursor": "1.0.2",
"cli-width": "2.2.0",
"figures": "1.7.0",
"lodash": "4.17.5",
"readline2": "1.0.1",
"run-async": "0.1.0",
"rx-lite": "3.1.2",
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"through": "2.3.8"
}
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"requires": {
"number-is-nan": "1.0.1"
}
},
"onetime": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
"dev": true
},
"pluralize": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz",
"integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=",
"dev": true
},
"progress": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
"integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=",
"dev": true
},
"restore-cursor": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz",
"integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=",
"dev": true,
"requires": {
"exit-hook": "1.1.1",
"onetime": "1.1.0"
}
},
"run-async": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz",
"integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=",
"dev": true,
"requires": {
"once": "1.4.0"
}
},
"rx-lite": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz",
"integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=",
"dev": true
},
"slice-ansi": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz",
"integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=",
"dev": true
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
},
"strip-json-comments": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz",
"integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=",
"dev": true
},
"table": {
"version": "3.8.3",
"resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz",
"integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=",
"dev": true,
"requires": {
"ajv": "4.11.8",
"ajv-keywords": "1.5.1",
"chalk": "1.1.3",
"lodash": "4.17.5",
"slice-ansi": "0.0.4",
"string-width": "2.1.1"
},
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"is-fullwidth-code-point": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"dev": true
},
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dev": true,
"requires": {
"is-fullwidth-code-point": "2.0.0",
"strip-ansi": "4.0.0"
}
},
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
"dev": true,
"requires": {
"ansi-regex": "3.0.0"
}
}
}
}
}
},
"sass-lint-fix": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/sass-lint-fix/-/sass-lint-fix-1.12.1.tgz",
"integrity": "sha512-tASYSElUTS0f1AAWWVNZyzcpvhuWjfUNnDhvJMo3a7W+wiUJth4HjaG8Jfvy5PixeC3pCLKGUeRKXHvFWGGGjw==",
"dev": true,
"requires": {
"autoprefixer": "7.2.6",
"chalk": "2.3.1",
"commander": "2.14.1",
"front-matter": "2.3.0",
"fs-extra": "4.0.3",
"glob": "7.1.2",
"globule": "1.2.0",
"gonzales-pe-sl": "4.2.3",
"js-yaml": "3.10.0",
"known-css-properties": "0.3.0",
"lodash.capitalize": "4.2.1",
"lodash.kebabcase": "4.1.1",
"lodash.map": "4.6.0",
"lodash.template": "4.4.0",
"merge": "1.2.0",
"path-is-absolute": "1.0.1",
"text-table": "0.2.0",
"util": "0.10.3"
},
"dependencies": {
"front-matter": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.3.0.tgz",
"integrity": "sha1-cgOviWzjV+4E4qpFFp6pHtf2dQQ=",
"dev": true,
"requires": {
"js-yaml": "3.10.0"
}
},
"fs-extra": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"jsonfile": "4.0.0",
"universalify": "0.1.1"
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "4.1.11"
}
},
"lodash.template": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz",
"integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=",
"dev": true,
"requires": {
"lodash._reinterpolate": "3.0.0",
"lodash.templatesettings": "4.1.0"
}
},
"lodash.templatesettings": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz",
"integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=",
"dev": true,
"requires": {
"lodash._reinterpolate": "3.0.0"
}
}
}
},
"sass-loader": {
"version": "6.0.6",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-6.0.6.tgz",
@ -15430,6 +16178,12 @@
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"shelljs": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.1.tgz",
"integrity": "sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=",
"dev": true
},
"shellwords": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
@ -17577,6 +18331,15 @@
}
}
},
"user-home": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz",
"integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=",
"dev": true,
"requires": {
"os-homedir": "1.0.2"
}
},
"util": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",

View File

@ -16,23 +16,33 @@
"start": "cross-env NODE_ENV=development webpack-dev-server --https -d --config webpack.config.dev.js",
"dash": "cross-env NODE_ENV=development webpack-dashboard -- webpack-dev-server --config webpack.config.dev.js",
"prebuild": "rimraf build",
"build": "cross-env NODE_ENV=production webpack -p --config webpack.config.prod.js --progress"
"build": "cross-env NODE_ENV=production webpack -p --config webpack.config.prod.js --progress",
"lint:check": "eslint ./site/src --config .eslintrc && sass-lint ./site/src --config .sasslintrc -v -q",
"lint:fix": "eslint ./site/src --config .eslintrc --fix && sass-lint ./site/src --config .sasslintrc -v -q --fix",
"lint:js": "eslint ./site/src --config .eslintrc",
"lint:sass": "sass-lint ./site/src --config .sasslintrc -v -q"
},
"dependencies": {
"bootbox.js": "makeusabrew/bootbox#*",
"bootstrap": "^4.0.0",
"bootstrap-offcanvas": "^1.0.0",
"font-awesome": "^4.7.0",
"foundation-emails": "zurb/foundation-emails#*",
"jquery": "^3.3.1",
"jquery-hammerjs": "^2.0.0",
"offcanvas-bootstrap": "^2.5.2",
"popper.js": "^1.12.9"
},
"devDependencies": {
"animate.css": "^3.5.2",
"autoprefixer": "^7.2.5",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.2",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"animate.css": "^3.5.2",
"autoprefixer": "^7.2.5",
"browser-sync": "^2.23.6",
"browser-sync-webpack-plugin": "^1.2.0",
"copy-webpack-plugin": "^4.3.1",
@ -40,6 +50,9 @@
"cross-env": "^5.1.3",
"css-loader": "^0.28.9",
"eslint": "^4.18.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jquery": "^1.3.0",
"eslint-plugin-react": "^7.7.0",
"exports-loader": "^0.7.0",
"extract-text-webpack-plugin": "^3.0.2",
"favicons-webpack-plugin": "0.0.7",
@ -58,6 +71,8 @@
"redux-devtools-extension": "^2.13.2",
"resolve-url-loader": "^2.2.1",
"rimraf": "^2.6.2",
"sass-lint": "^1.12.1",
"sass-lint-fix": "^1.12.1",
"sass-loader": "^6.0.6",
"script-ext-html-webpack-plugin": "^1.8.8",
"style-loader": "^0.19.0",

View File

@ -4,16 +4,16 @@
import $ from 'jquery';
const SpinnerUI = (($) => {
class SpinnerUI {
static show(callback) {
$('#PageLoading').show(0, callback);
}
static hide(callback) {
$('#PageLoading').hide('slow', callback);
}
class SpinnerUI {
static show(callback) {
$('#PageLoading').show(0, callback);
}
return SpinnerUI;
static hide(callback) {
$('#PageLoading').hide('slow', callback);
}
}
return SpinnerUI;
})($);
export default SpinnerUI;

View File

@ -3,6 +3,6 @@
*/
module.exports = {
AJAX: 'ajax-load',
LOADED: 'load'
AJAX: 'ajax-load',
LOADED: 'load',
};

View File

@ -1,23 +1,23 @@
import $ from 'jquery';
const TypePage = (($) => {
// Constants
const NAME = 'TypePage';
// const DATA_KEY = "pageUI." + NAME;
// Constants
const NAME = 'TypePage';
// const DATA_KEY = "pageUI." + NAME;
const Events = require('./_events');
const Events = require('./_events');
class TypePage {
// Static methods
static init() {
console.log(`Initializing: ${NAME}`);
}
class TypePage {
// Static methods
static init() {
console.log(`Initializing: ${NAME}`);
}
static destroy() {
console.log(`Destroying: ${NAME}`);
}
static destroy() {
console.log(`Destroying: ${NAME}`);
}
/**
/**
* jQuery extension functions
// Constructor
constructor(element) {
@ -47,14 +47,14 @@ const TypePage = (($) => {
})
}
*/
}
}
$(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {
TypePage.init();
});
$(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {
TypePage.init();
});
// JQuery extension functions
/*
// JQuery extension functions
/*
$.fn[NAME] = TypePage._jQueryInterface;
$.fn[NAME].Constructor = TypePage;
$.fn[NAME].noConflict = function () {
@ -66,7 +66,7 @@ const TypePage = (($) => {
$(".ui." + NAME).TypePage();
}); */
return TypePage;
return TypePage;
})($);
export default TypePage;

View File

@ -1,16 +1,7 @@
// import images
function importAll(r) {
return r.keys().map(r);
}
const images = importAll(require.context('../img/', false, /\.(png|jpe?g|svg)$/));
import '../scss/app.scss';
// import Bootstrap
import Popper from 'popper.js';
window.Popper = Popper;
import 'bootstrap/js/dist/util';
import 'bootstrap/js/dist/alert';
import 'bootstrap/js/dist/button';
@ -27,6 +18,16 @@ import 'bootstrap/js/dist/tab';
// import your custom UI components
import './main';
// bootstrap fix
window.Popper = Popper;
// import images
function importAll(r) {
return r.keys().map(r);
}
const images = importAll(require.context('../img/', false, /\.(png|jpe?g|svg)$/));
// TODO: hot module update
/* const Events = require("./_events");
if (module.hot) {

View File

@ -5,33 +5,33 @@ import Events from './_events';
import Spinner from './_components/_spinner';
const MainUI = (($) => {
// Constants
const NAME = 'MainUI';
// Constants
const NAME = 'MainUI';
class MainUI {
// Static methods
static init() {
this.destroy();
console.log(`Initializing: ${NAME}`);
class MainUI {
// Static methods
static init() {
this.destroy();
console.log(`Initializing: ${NAME}`);
Spinner.hide(() => {
$('body').addClass('loaded');
});
}
static destroy() {
console.log(`Destroying: ${NAME}`);
Spinner.show(() => {
$('body').removeClass('loaded');
});
}
Spinner.hide(() => {
$('body').addClass('loaded');
});
}
$(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {
MainUI.init();
});
static destroy() {
console.log(`Destroying: ${NAME}`);
Spinner.show(() => {
$('body').removeClass('loaded');
});
}
}
return MainUI;
$(window).on(`${Events.AJAX} ${Events.LOADED}`, () => {
MainUI.init();
});
return MainUI;
})($);
export default MainUI;

View File

@ -1,10 +1,10 @@
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";
// bootstrap minify bugfix:
$navbar-dark-toggler-icon-bg: none;
$navbar-light-toggler-icon-bg: none;
// IE > 9
$enable-flex: true;
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";