Added ESLint and Prettier.
This commit is contained in:
parent
1f5df65c48
commit
87b63c2142
32
.eslintrc
Normal file
32
.eslintrc
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 10,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"impliedStrict": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true,
|
||||
"jquery": true,
|
||||
"worker": true,
|
||||
"mocha": true,
|
||||
"serviceworker": true
|
||||
},
|
||||
"globals": {
|
||||
"PIXI": false,
|
||||
"TweenLite": false,
|
||||
"TweenMax": false,
|
||||
"TimelineLite": false,
|
||||
"TimelineMax": false,
|
||||
"d3": false,
|
||||
"SystemJS": false,
|
||||
"app": true
|
||||
},
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"extends": ["eslint:recommended", "plugin:prettier/recommended"]
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 10,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"impliedStrict": true
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"mocha"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true,
|
||||
"jquery": true
|
||||
},
|
||||
"globals": {
|
||||
"PIXI": false,
|
||||
"TweenLite": false,
|
||||
"TweenMax": false,
|
||||
"TimelineLite": false,
|
||||
"TimelineMax": false,
|
||||
"SystemJS": false
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"semi": ["error", "never"],
|
||||
"quotes": ["warn", "single", {"allowTemplateLiterals": true}],
|
||||
"no-console": "warn",
|
||||
"no-unused-vars": ["warn", {"argsIgnorePattern": "^(e|event|points|ended)$"}],
|
||||
"indent": ["warn", 4, {"SwitchCase": 1}],
|
||||
"mocha/no-exclusive-tests": "error"
|
||||
}
|
||||
}
|
6
.prettierrc
Normal file
6
.prettierrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": true,
|
||||
"tabWidth": 4,
|
||||
"semi": false
|
||||
}
|
11
lib/app.js
11
lib/app.js
@ -9,11 +9,15 @@ export class IApp extends Interface {
|
||||
/** Build the app by registering event handlers,
|
||||
* adding DOM elements, instanciating templates, etc...
|
||||
*/
|
||||
setup() { return this }
|
||||
setup() {
|
||||
return this
|
||||
}
|
||||
|
||||
/** Run the application by starting a main loop, ...
|
||||
*/
|
||||
run() { return this }
|
||||
run() {
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
export default class App extends Object {
|
||||
@ -48,8 +52,7 @@ export default class App extends Object {
|
||||
this.allTests()
|
||||
var end = performance.now()
|
||||
return ['ok', end - start]
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
console.trace()
|
||||
return ['Tests failed', e.message]
|
||||
}
|
||||
|
915
package-lock.json
generated
915
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -21,11 +21,15 @@
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@pixi/jsdoc-template": "^2.4.2",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-config-prettier": "^6.0.0",
|
||||
"eslint-plugin-prettier": "^3.1.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-uglify": "^3.0.2"
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"prettier": "^1.18.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": "^8.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user