Switch from jshint to eslint
This commit is contained in:
parent
a05dc21977
commit
9f30b25d3e
19
.babelrc
19
.babelrc
|
@ -1,11 +1,18 @@
|
|||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
},
|
||||
"modules": false
|
||||
}]
|
||||
[
|
||||
"env",
|
||||
{
|
||||
"targets": {
|
||||
"browsers": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
},
|
||||
"modules": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"external-helpers"
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"indent": [
|
||||
"warn",
|
||||
"tab",
|
||||
{
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"double"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"no-console": [
|
||||
"error",
|
||||
{
|
||||
allow: ["warn", "error"]
|
||||
}
|
||||
],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "none"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,7 @@
|
|||
"scripts": {
|
||||
"build": "rollup -c tools/rollup.default.js && rollup -c tools/rollup.min.js && rollup -c tools/rollup.babel.js && rollup -c tools/rollup.babel.min.js",
|
||||
"prepare": "npm test && rm -rf build && npm run build",
|
||||
"test": "jshint src"
|
||||
"test": "eslint src/** tools/**"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -26,7 +26,7 @@
|
|||
"babel-cli": "^6.26.0",
|
||||
"babel-plugin-external-helpers": "^6.22.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"jshint": "^2.9.5",
|
||||
"eslint": "^4.14.0",
|
||||
"rollup": "^0.50.0",
|
||||
"rollup-plugin-babel": "^3.0.2",
|
||||
"rollup-plugin-uglify": "^2.0.1",
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { SkinObject, CapeObject, PlayerObject } from "./skinview3d";
|
||||
|
||||
let WalkAnimation = (player, time) => {
|
||||
let skin = player.skin;
|
||||
let angleRot = time + Math.PI / 2;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import THREE from "three";
|
||||
import { SkinObject, CapeObject, PlayerObject } from "./model";
|
||||
import { PlayerObject } from "./model";
|
||||
import { OrbitControls } from "./orbit_controls";
|
||||
|
||||
function copyImage(context, sX, sY, w, h, dX, dY, flipHorizontal) {
|
||||
|
@ -95,14 +95,14 @@ class SkinViewer {
|
|||
|
||||
// texture loading
|
||||
this.skinImg.crossOrigin = "";
|
||||
this.skinImg.onerror = () => console.log("Failed loading " + this.skinImg.src);
|
||||
this.skinImg.onerror = () => console.error("Failed loading " + this.skinImg.src);
|
||||
this.skinImg.onload = () => {
|
||||
let isOldFormat = false;
|
||||
if (this.skinImg.width !== this.skinImg.height) {
|
||||
if (this.skinImg.width === 2 * this.skinImg.height) {
|
||||
isOldFormat = true;
|
||||
} else {
|
||||
console.log("Bad skin size");
|
||||
console.error("Bad skin size");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -130,10 +130,10 @@ class SkinViewer {
|
|||
};
|
||||
|
||||
this.capeImg.crossOrigin = "";
|
||||
this.capeImg.onerror = () => console.log("Failed loading " + this.capeImg.src);
|
||||
this.capeImg.onerror = () => console.error("Failed loading " + this.capeImg.src);
|
||||
this.capeImg.onload = () => {
|
||||
if (this.capeImg.width !== 2 * this.capeImg.height) {
|
||||
console.log("Bad cape size");
|
||||
console.error("Bad cape size");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import { buildType } from './rollup.common';
|
||||
export default buildType({ postfix: '.babel', babel: true, uglify: false });
|
||||
import { buildType } from "./rollup.common";
|
||||
export default buildType({ postfix: ".babel", babel: true, uglify: false });
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import { buildType } from './rollup.common';
|
||||
export default buildType({ postfix: '.babel.min', babel: true, uglify: true });
|
||||
import { buildType } from "./rollup.common";
|
||||
export default buildType({ postfix: ".babel.min", babel: true, uglify: true });
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
import uglify from 'rollup-plugin-uglify';
|
||||
import { minify } from 'uglify-es';
|
||||
import babel from 'rollup-plugin-babel';
|
||||
import uglify from "rollup-plugin-uglify";
|
||||
import { minify } from "uglify-es";
|
||||
import babel from "rollup-plugin-babel";
|
||||
let buildType = config => {
|
||||
let options = {
|
||||
input: 'src/skinview3d.js',
|
||||
indent: '\t',
|
||||
input: "src/skinview3d.js",
|
||||
indent: "\t",
|
||||
sourcemap: true,
|
||||
external: ['three'],
|
||||
external: ["three"],
|
||||
globals: {
|
||||
three: 'THREE'
|
||||
three: "THREE"
|
||||
},
|
||||
output: [
|
||||
{
|
||||
format: 'umd',
|
||||
name: 'skinview3d',
|
||||
format: "umd",
|
||||
name: "skinview3d",
|
||||
file: `build/skinview3d${config.postfix}.js`
|
||||
},
|
||||
{
|
||||
format: 'es',
|
||||
format: "es",
|
||||
file: `build/skinview3d${config.postfix}.module.js`
|
||||
}
|
||||
],
|
||||
|
@ -26,7 +26,7 @@ let buildType = config => {
|
|||
if (config.babel) {
|
||||
options.plugins.push(
|
||||
babel({
|
||||
exclude: 'node_modules/**',
|
||||
exclude: "node_modules/**",
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import { buildType } from './rollup.common';
|
||||
export default buildType({ postfix: '', babel: false, uglify: false });
|
||||
import { buildType } from "./rollup.common";
|
||||
export default buildType({ postfix: "", babel: false, uglify: false });
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import { buildType } from './rollup.common';
|
||||
export default buildType({ postfix: '.min', babel: false, uglify: true });
|
||||
import { buildType } from "./rollup.common";
|
||||
export default buildType({ postfix: ".min", babel: false, uglify: true });
|
||||
|
|
Loading…
Reference in New Issue