Another eslint rule
This commit is contained in:
@@ -19,6 +19,8 @@ globals:
|
|||||||
SvelteComponents: readonly
|
SvelteComponents: readonly
|
||||||
Clusterize: readonly
|
Clusterize: readonly
|
||||||
SockJS: readonly
|
SockJS: readonly
|
||||||
|
ignorePatterns:
|
||||||
|
- "**/dist/**/*"
|
||||||
rules:
|
rules:
|
||||||
indent:
|
indent:
|
||||||
- off
|
- off
|
||||||
@@ -57,6 +59,8 @@ rules:
|
|||||||
- error
|
- error
|
||||||
keyword-spacing:
|
keyword-spacing:
|
||||||
- error
|
- error
|
||||||
|
no-multi-spaces:
|
||||||
|
- error
|
||||||
"@typescript-eslint/no-var-requires":
|
"@typescript-eslint/no-var-requires":
|
||||||
- off
|
- off
|
||||||
no-multiple-empty-lines:
|
no-multiple-empty-lines:
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ const OrbitControls = function (object, domElement) {
|
|||||||
const scope = this;
|
const scope = this;
|
||||||
|
|
||||||
const changeEvent = { type: "change" };
|
const changeEvent = { type: "change" };
|
||||||
const startEvent = { type: "start" };
|
const startEvent = { type: "start" };
|
||||||
const endEvent = { type: "end" };
|
const endEvent = { type: "end" };
|
||||||
|
|
||||||
const STATE = {
|
const STATE = {
|
||||||
NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY_PAN: 4
|
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.
|
// How far you can orbit vertically, upper and lower limits.
|
||||||
// Range is 0 to Math.PI radians.
|
// Range is 0 to Math.PI radians.
|
||||||
this.minPolarAngle = 0; // radians
|
this.minPolarAngle = 0; // radians
|
||||||
this.maxPolarAngle = Math.PI; // radians
|
this.maxPolarAngle = Math.PI; // radians
|
||||||
|
|
||||||
// How far you can orbit horizontally, upper and lower limits.
|
// How far you can orbit horizontally, upper and lower limits.
|
||||||
// If set, must be a sub-interval of the interval [- Math.PI, Math.PI].
|
// If set, must be a sub-interval of the interval [- Math.PI, Math.PI].
|
||||||
this.minAzimuthAngle = -Infinity; // radians
|
this.minAzimuthAngle = -Infinity; // radians
|
||||||
this.maxAzimuthAngle = Infinity; // radians
|
this.maxAzimuthAngle = Infinity; // radians
|
||||||
|
|
||||||
// Set to true to enable damping (inertia)
|
// Set to true to enable damping (inertia)
|
||||||
// If damping is enabled, call controls.update() in your animation loop
|
// If damping is enabled, call controls.update() in your animation loop
|
||||||
|
|||||||
@@ -464,10 +464,10 @@ module.exports = {
|
|||||||
geometry.translate(0, -length - radius, 0);
|
geometry.translate(0, -length - radius, 0);
|
||||||
group.add(new THREE.Mesh(geometry, material));
|
group.add(new THREE.Mesh(geometry, material));
|
||||||
|
|
||||||
if (axis == 0) {
|
if (axis == 0) {
|
||||||
group.rotateZ((up ? 0.5 : 1.5) * Math.PI);
|
group.rotateZ((up ? 0.5 : 1.5) * Math.PI);
|
||||||
} else if (axis == 1) {
|
} else if (axis == 1) {
|
||||||
group.rotateX((up ? 0 : 1 ) * Math.PI);
|
group.rotateX((up ? 0 : 1 ) * Math.PI);
|
||||||
} else if (axis == 2) {
|
} else if (axis == 2) {
|
||||||
group.rotateX((up ? 1.5 : 0.5) * Math.PI);
|
group.rotateX((up ? 1.5 : 0.5) * Math.PI);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const numberWithUnit = {
|
|||||||
regex: /^\s*(?:(\d+)\s*\/\s*(\d+)|(\d*\.\d+)|(\d+(?:\.\d+)?))\s*("|in|inch|inches|mm|millimeters)\s*$/,
|
regex: /^\s*(?:(\d+)\s*\/\s*(\d+)|(\d*\.\d+)|(\d+(?:\.\d+)?))\s*("|in|inch|inches|mm|millimeters)\s*$/,
|
||||||
parse: function (str: string) {
|
parse: function (str: string) {
|
||||||
// eslint-disable-next-line prefer-const
|
// 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);
|
numerator = Number.parseFloat(numerator);
|
||||||
denominator = Number.parseFloat(denominator);
|
denominator = Number.parseFloat(denominator);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import sveltePreprocess from 'svelte-preprocess'
|
import sveltePreprocess from "svelte-preprocess";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
// Consult https://github.com/sveltejs/svelte-preprocess
|
||||||
// for more information about preprocessors
|
// for more information about preprocessors
|
||||||
preprocess: sveltePreprocess()
|
preprocess: sveltePreprocess()
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
||||||
import { resolve } from 'path';
|
import { resolve } from "path";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
svelte()
|
svelte()
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
$lib: resolve('./src/lib'),
|
$lib: resolve("./src/lib"),
|
||||||
$dialogs: resolve('./src/dialogs'),
|
$dialogs: resolve("./src/dialogs"),
|
||||||
$components: resolve('./src/components')
|
$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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|||||||
Reference in New Issue
Block a user