diff --git a/.config/eslint.config.js b/.config/eslint.config.js index 29d40388..2bfc1e77 100644 --- a/.config/eslint.config.js +++ b/.config/eslint.config.js @@ -49,8 +49,8 @@ export default [ "jsdoc/require-property": "error", "jsdoc/require-property-type": "error", // "jsdoc/require-property-description":"error", - eqeqeq: "error", - camelcase: "error", + "eqeqeq": "error", + "camelcase": "error", "prefer-const": "error", "new-cap": "error", "no-const-assign": "error", @@ -65,7 +65,6 @@ export default [ "prefer-destructuring": ["error",{ "object": true,"array": false }], "prefer-template": "error", "no-useless-concat": "error", - "template-curly-spacing": ["error","never"], "no-eval": "error", "no-implied-eval": "error", "no-useless-escape": "error", @@ -113,22 +112,37 @@ export default [ "semi": ["warn","never"], "style/new-parens": "warn", "style/rest-spread-spacing": ["warn","never"], - "style/space-infix-ops": "warn", - "style/space-unary-ops": "warn", "style/spaced-comment": "warn", "style/switch-colon-spacing": "warn", - "style/template-curly-spacing": "warn", "style/template-tag-spacing": ["warn","never"], "style/one-var-declaration-per-line": ["warn","initializations"], - "style/object-curly-spacing": ["warn","always"], "style/operator-linebreak": ["warn","after"], "style/nonblock-statement-body-position": ["warn","beside"], - //"style/no-trailing-spaces": "warn", + + /** white-space rules */ + "style/indent": ["warn", 2], + "style/no-trailing-spaces": "warn", + "style/space-before-function-paren": ["warn","never"], + "style/space-in-parens": ["warn", "never"], + "style/space-before-blocks": ["warn", "always"], + "style/space-infix-ops": "warn", + "style/space-unary-ops": ["warn",{words: true, nonwords: false}], + "style/keyword-spacing": ["warn", { "before": true, "after": true }], + "style/array-bracket-spacing": ["warn", "never"], + "style/object-curly-spacing": ["warn", "always"], + "style/computed-property-spacing": ["warn", "never"], + "style/template-curly-spacing": ["warn", "never"], + "style/comma-spacing": ["warn", { "before": false, "after": true }], + "style/semi-spacing": ["warn", { "before": false, "after": true }], + "style/block-spacing": ["warn", "always"], "style/no-multi-spaces": "warn", - "style/no-multiple-empty-lines": "warn", + "style/no-multiple-empty-lines": ["warn", { "max": 1, "maxEOF": 0 }], + "style/eol-last": ["warn", "always"], + "style/linebreak-style": ["warn", "unix"], + // "style/padded-blocks": ["warn", "never"], conflicts with another rule + "style/newline-per-chained-call": ["warn", { "ignoreChainWithDepth": 2 }], + "style/no-floating-decimal": "warn", - "style/newline-per-chained-call": ["warn",{ ignoreChainWithDepth: 2 }], - "style/linebreak-style": ["warn","unix"], "style/lines-around-comment": ["warn",{ beforeBlockComment: true, afterBlockComment: false, @@ -139,23 +153,15 @@ export default [ "style/quotes": ["warn","single"], // "style/qoute-props": ["warn","as-needed"], //"style/lines-between-class-members": ["warn", "never"], - "style/array-bracket-spacing": ["warn",{ beforeColon: false,afterColon: true,mode: "strict" }], "style/function-call-spacing": ["warn","never"], "style/line-comment-position": ["warn",{ position: "above" }], - "style/space-before-function-paren": ["warn","never"], - "style/eol-last": ["warn","never"], "style/dot-location": ["warn","property"], - "style/array-bracket-spacing": ["warn","never"], "style/generator-star-spacing": ["warn",{ before: false,after: true }], "style/function-paren-newline": ["warn","multiline-arguments"], "style/array-element-newline": ["warn",{ consistent: true,"multiline": true }], "style/arrow-spacing": "warn", "style/brace-style": ["warn","1tbs",{ allowSingleLine: true }], - "style/block-spacing": "warn", - "style/comma-spacing": ["warn",{ before: false,after: true }], "style/comma-dangle": ["warn","never"], - "style/indent": ["warn", 2], - "style/computed-property-spacing": ["warn","never"], "style/padding-line-between-statements": [ "warn", { blankLine: "always",prev: "for",next: "*" }, diff --git a/demos/demos/animation/basic.js b/demos/demos/animation/basic.js index 7847e7f8..53829c83 100644 --- a/demos/demos/animation/basic.js +++ b/demos/demos/animation/basic.js @@ -39,10 +39,10 @@ export function init(world) { const rawClip = createClip() const clip = clips.add(rawClip) const mesh = meshes.add(Mesh.quad2D(50, 50)) - const material = materials.add(new BasicMaterial()) + const material = materials.add(new BasicMaterial()) const targetname = '/bone' const animationplayer = new AnimationPlayer() - + animationplayer.set(clip, { duration: rawClip.duration, repeatMode: PlaybackRepeat.Forever @@ -51,7 +51,7 @@ export function init(world) { .spawn() .insert(animationplayer) .build() - + commands .spawn() .insertPrefab([ @@ -69,15 +69,15 @@ export function init(world) { */ function createClip() { const clip = new AnimationClip() - + const translate = new AnimationTrack(Position2DAnimationEffector) const rotate = new AnimationTrack(Orientation2DAnimationEffector) const scale = new AnimationTrack(Scale2DAnimationEffector) - + translate.times = [0, 2, 4, 6, 8] rotate.times = [0, 2, 4, 6, 8] scale.times = [0, 2, 4, 6, 8] - + translate.keyframes = [ -100, 100, @@ -109,11 +109,11 @@ function createClip() { 1, 1 ] - + clip.add('/bone', translate) clip.add('/bone', rotate) clip.add('/bone', scale) clip.calculateDuration() - + return clip -} \ No newline at end of file +} diff --git a/demos/demos/animation/basic3d.js b/demos/demos/animation/basic3d.js index 7325eb94..e298d07c 100644 --- a/demos/demos/animation/basic3d.js +++ b/demos/demos/animation/basic3d.js @@ -108,4 +108,4 @@ function createClip() { clip.calculateDuration() return clip -} \ No newline at end of file +} diff --git a/demos/demos/animation/index.js b/demos/demos/animation/index.js index e996858d..c2805ea8 100644 --- a/demos/demos/animation/index.js +++ b/demos/demos/animation/index.js @@ -1,2 +1,2 @@ export { default as animation } from './basic.js' -export { default as basicAnimation3D } from './basic3d.js' \ No newline at end of file +export { default as basicAnimation3D } from './basic3d.js' diff --git a/demos/demos/audio/audioGraph.js b/demos/demos/audio/audioGraph.js index 7079f4a8..313418f3 100644 --- a/demos/demos/audio/audioGraph.js +++ b/demos/demos/audio/audioGraph.js @@ -16,12 +16,12 @@ export default new Demo( ) class Playing { handle - + /** * @type {number?} */ value - + /** * @param {Handle