Migrate to eslint

This commit is contained in:
yushijinhun 2020-01-23 02:15:02 +08:00
parent 92b8334e8e
commit ff24bcec58
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
5 changed files with 806 additions and 123 deletions

12
.eslintrc.yaml Normal file
View File

@ -0,0 +1,12 @@
root: true
parser: '@typescript-eslint/parser'
plugins:
- '@typescript-eslint'
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
rules:
'@typescript-eslint/no-inferrable-types': off
'@typescript-eslint/explicit-function-return-type': off
'@typescript-eslint/interface-name-prefix': off

879
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
"build": "rollup -c",
"test": "npm run lint",
"prepublishOnly": "rimraf dist && npm run build",
"lint": "tslint --formatters-dir ./node_modules/tslint-formatter-beauty -t beauty -p .",
"lint": "eslint --ext .ts src/",
"dev": "npm-run-all --parallel watch serve",
"watch": "rollup -w -c",
"serve": "ws"
@ -38,6 +38,9 @@
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^7.0.0",
"@typescript-eslint/eslint-plugin": "^2.17.0",
"@typescript-eslint/parser": "^2.17.0",
"eslint": "^6.8.0",
"local-web-server": "^3.0.7",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.0",
@ -45,8 +48,6 @@
"rollup-plugin-license": "^0.13.0",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-typescript2": "^0.25.3",
"tslint": "^6.0.0",
"tslint-formatter-beauty": "^3.0.0-beta.2",
"typescript": "^3.7.5"
}
}

View File

@ -83,8 +83,8 @@ export class OrbitControls extends EventDispatcher {
minAzimuthAngle: number;
maxAzimuthAngle: number;
enableKeys: boolean;
keys: { LEFT: number; UP: number; RIGHT: number; BOTTOM: number; };
mouseButtons: { ORBIT: MOUSE; ZOOM: MOUSE; PAN: MOUSE; };
keys: { LEFT: number; UP: number; RIGHT: number; BOTTOM: number };
mouseButtons: { ORBIT: MOUSE; ZOOM: MOUSE; PAN: MOUSE };
enableDamping: boolean;
dampingFactor: number;

View File

@ -1,27 +0,0 @@
{
"extends": "tslint:latest",
"rules": {
"curly": false,
"ordered-imports": false,
"member-access": false,
"trailing-comma": [ false, {"multiline": "never", "singleline": "never"} ],
"max-line-length": false,
"variable-name": false,
"object-literal-sort-keys": false,
"arrow-parens": [true, "ban-single-arg-parens"],
"array-type": [true, "generic"],
"no-console": false,
"indent": [
true,
"tabs"
],
"eofline": true,
"linebreak-style": [
true,
"LF"
],
"max-classes-per-file": false,
"interface-name": false,
"member-ordering": false
}
}