Browse Source

Added ESLint and Prettier.

obersalzberg
Sebastian Kupke 1 year ago
parent
commit
87b63c2142
6 changed files with 966 additions and 41 deletions
  1. +32
    -0
      .eslintrc
  2. +0
    -35
      .eslintrc.json
  3. +6
    -0
      .prettierrc
  4. +8
    -5
      lib/app.js
  5. +915
    -0
      package-lock.json
  6. +5
    -1
      package.json

+ 32
- 0
.eslintrc View 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"]
}

+ 0
- 35
.eslintrc.json View File

@ -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
- 0
.prettierrc View File

@ -0,0 +1,6 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 4,
"semi": false
}

+ 8
- 5
lib/app.js View File

@ -9,16 +9,20 @@ 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 {
/** Override this method to build your app.
*/
*/
setup() {
return this
}
@ -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
- 0
package-lock.json
File diff suppressed because it is too large
View File


+ 5
- 1
package.json View File

@ -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…
Cancel
Save