Another eslint rule

This commit is contained in:
David Carley
2022-09-05 21:44:57 +00:00
parent 135b46df23
commit 70bbee974f
6 changed files with 38 additions and 34 deletions

View File

@@ -19,6 +19,8 @@ globals:
SvelteComponents: readonly
Clusterize: readonly
SockJS: readonly
ignorePatterns:
- "**/dist/**/*"
rules:
indent:
- off
@@ -57,6 +59,8 @@ rules:
- error
keyword-spacing:
- error
no-multi-spaces:
- error
"@typescript-eslint/no-var-requires":
- off
no-multiple-empty-lines:

View File

@@ -23,8 +23,8 @@ const OrbitControls = function (object, domElement) {
const scope = this;
const changeEvent = { type: "change" };
const startEvent = { type: "start" };
const endEvent = { type: "end" };
const startEvent = { type: "start" };
const endEvent = { type: "end" };
const STATE = {
NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY_PAN: 4
@@ -68,13 +68,13 @@ const OrbitControls = function (object, domElement) {
// How far you can orbit vertically, upper and lower limits.
// Range is 0 to Math.PI radians.
this.minPolarAngle = 0; // radians
this.minPolarAngle = 0; // radians
this.maxPolarAngle = Math.PI; // radians
// How far you can orbit horizontally, upper and lower limits.
// If set, must be a sub-interval of the interval [- Math.PI, Math.PI].
this.minAzimuthAngle = -Infinity; // radians
this.maxAzimuthAngle = Infinity; // radians
this.maxAzimuthAngle = Infinity; // radians
// Set to true to enable damping (inertia)
// If damping is enabled, call controls.update() in your animation loop

View File

@@ -464,10 +464,10 @@ module.exports = {
geometry.translate(0, -length - radius, 0);
group.add(new THREE.Mesh(geometry, material));
if (axis == 0) {
if (axis == 0) {
group.rotateZ((up ? 0.5 : 1.5) * Math.PI);
} else if (axis == 1) {
group.rotateX((up ? 0 : 1 ) * Math.PI);
group.rotateX((up ? 0 : 1 ) * Math.PI);
} else if (axis == 2) {
group.rotateX((up ? 1.5 : 0.5) * Math.PI);
}

View File

@@ -33,7 +33,7 @@ export const numberWithUnit = {
regex: /^\s*(?:(\d+)\s*\/\s*(\d+)|(\d*\.\d+)|(\d+(?:\.\d+)?))\s*("|in|inch|inches|mm|millimeters)\s*$/,
parse: function (str: string) {
// eslint-disable-next-line prefer-const
let [, numerator, denominator, decimal1, decimal2, unit]: any = str?.match(numberWithUnit.regex) ?? [];
let [ , numerator, denominator, decimal1, decimal2, unit ]: any = str?.match(numberWithUnit.regex) ?? [];
numerator = Number.parseFloat(numerator);
denominator = Number.parseFloat(denominator);

View File

@@ -1,7 +1,7 @@
import sveltePreprocess from 'svelte-preprocess'
import sveltePreprocess from "svelte-preprocess";
export default {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess()
}
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess()
};

View File

@@ -1,26 +1,26 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { resolve } from 'path';
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { resolve } from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
svelte()
],
resolve: {
alias: {
$lib: resolve('./src/lib'),
$dialogs: resolve('./src/dialogs'),
$components: resolve('./src/components')
plugins: [
svelte()
],
resolve: {
alias: {
$lib: resolve("./src/lib"),
$dialogs: resolve("./src/dialogs"),
$components: resolve("./src/components")
}
},
build: {
target: "chrome60",
lib: {
entry: resolve(__dirname, "src/main.ts"),
name: "SvelteComponents",
formats: [ "iife" ],
fileName: () => "index.js"
}
}
},
build: {
target: "chrome60",
lib: {
entry: resolve(__dirname, 'src/main.ts'),
name: 'SvelteComponents',
formats: ['iife'],
fileName: () => "index.js"
}
}
})
});