diff --git a/.eslintignore b/.eslintignore index f910d66c..d88e5152 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,4 +3,6 @@ dist **.test.ts **.test.js **.cy.js -**/cypress/** \ No newline at end of file +**/cypress/** +docs/.vitepress/cache +docs/.vitepress/dist \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index ade84fef..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - browser: true, - es6: true, - }, - parser: 'vue-eslint-parser', - plugins: ['vue', '@typescript-eslint'], - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:vue/vue3-recommended', 'prettier'], - parserOptions: { - tsconfigRootDir: __dirname, - parser: '@typescript-eslint/parser', - ecmaVersion: 2020, - sourceType: 'module', - allowImportExportEverywhere: true, - }, - ignorePatterns: ['**/*.test.ts', 'packages/**/dist', 'package.json'], - rules: { - 'no-console': 'warn', - 'arrow-parens': ['error', 'as-needed'], - 'comma-dangle': 'off', - 'space-before-function-paren': 'off', - 'max-len': [1, { code: 120 }], - 'require-jsdoc': 0, - 'no-invalid-this': 0, - 'import/no-absolute-path': 'off', - '@typescript-eslint/no-explicit-any': 'off', - 'vue/no-deprecated-slot-attribute': 'off', - 'vue/require-default-prop': 'off', - 'vue/html-self-closing': 'off', - 'vue/max-attributes-per-line': 'off', - 'vue/multi-word-component-names': 0, - 'vue/no-multiple-template-root': 'off', - 'vue/first-attribute-linebreak': 'off', - 'vue/setup-compiler-macros': 0, - 'vue/no-dupe-keys': 'off', // TODO: remove this when https://github.com/vuejs/eslint-plugin-vue/issues/2121 is fixed - }, -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..f592a0d8 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "@tresjs/eslint-config-vue", + "rules": { + "@typescript-eslint/no-use-before-define": "off" + } +} diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index c7e30143..00000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - ...require('@alvarosabu/prettier-config'), - printWidth: 120, -} diff --git a/docs/.eslintrc.json b/docs/.eslintrc.json new file mode 100644 index 00000000..abc08e54 --- /dev/null +++ b/docs/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "@tresjs/eslint-config-vue" +} diff --git a/docs/.vitepress/theme/components/BackdropDemo.vue b/docs/.vitepress/theme/components/BackdropDemo.vue index cde940ad..d0dcd689 100644 --- a/docs/.vitepress/theme/components/BackdropDemo.vue +++ b/docs/.vitepress/theme/components/BackdropDemo.vue @@ -3,9 +3,7 @@ import { TresCanvas } from '@tresjs/core' import { PCFSoftShadowMap, SRGBColorSpace, NoToneMapping } from 'three' import { useProgress, Backdrop, GLTFModel } from '@tresjs/cientos' -import { ref } from 'vue' -import { watch } from 'vue' -import { watchEffect } from 'vue' +import { ref, watch, watchEffect } from 'vue' const gl = { clearColor: 'pink', @@ -18,7 +16,7 @@ const gl = { const model = ref(null) watch(model, ({ value }) => { - value.traverse(child => { + value.traverse((child) => { if (child.isMesh) { child.castShadow = true } @@ -26,6 +24,7 @@ watch(model, ({ value }) => { }) function onCameraChange(e) { + // eslint-disable-next-line no-console console.log('camera changed', e) } @@ -51,21 +50,37 @@ const { hasFinishLoading, progress, items } = await useProgress() v-show="!hasFinishLoading" class="absolute bg-grey-600 t-0 l-0 w-full h-full z-20 flex justify-center items-center text-black font-mono" > -
Loading... {{ progress }} %
+
+ Loading... {{ progress }} % +
- + - - + + @@ -83,8 +98,8 @@ const { hasFinishLoading, progress, items } = await useProgress() cast-shadow :position="[-3, 2, 4]" :look-at="[0, 0, 0]" - :shadow-mapSize-width="256" - :shadow-mapSize-height="256" + :shadow-map-size-width="256" + :shadow-map-size-height="256" :shadow-camera-near="0.5" :shadow-camera-left="-10" /> diff --git a/docs/.vitepress/theme/components/Feather.vue b/docs/.vitepress/theme/components/Feather.vue index 2c4b4a0e..1f01726f 100644 --- a/docs/.vitepress/theme/components/Feather.vue +++ b/docs/.vitepress/theme/components/Feather.vue @@ -1,7 +1,7 @@ + diff --git a/docs/.vitepress/theme/components/LeviosoDemo.vue b/docs/.vitepress/theme/components/LeviosoDemo.vue index 48a5e7ee..fd4cc369 100644 --- a/docs/.vitepress/theme/components/LeviosoDemo.vue +++ b/docs/.vitepress/theme/components/LeviosoDemo.vue @@ -15,13 +15,18 @@ const gl = { diff --git a/docs/.vitepress/theme/components/LoveVueThreeJS.vue b/docs/.vitepress/theme/components/LoveVueThreeJS.vue index 0b46ded0..6b6f14c4 100644 --- a/docs/.vitepress/theme/components/LoveVueThreeJS.vue +++ b/docs/.vitepress/theme/components/LoveVueThreeJS.vue @@ -1,10 +1,10 @@ diff --git a/docs/package.json b/docs/package.json index e89a1a49..d0ad4691 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,12 +9,10 @@ "preview": "vitepress preview" }, "devDependencies": { - "unocss": "^0.53.5", - "vite-svg-loader": "^4.0.0", - "vitepress": "1.0.0-beta.5" + "unocss": "^0.54.0", + "vite-svg-loader": "^4.0.0" }, "dependencies": { - "@tresjs/cientos": "workspace:^", - "gsap": "^3.12.2" + "@tresjs/cientos": "workspace:^" } } diff --git a/package.json b/package.json index 0d1a5948..1807f504 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "vue": ">=3.3" }, "devDependencies": { - "@alvarosabu/prettier-config": "^1.3.0", + "@tresjs/eslint-config-vue": "^0.1.1", "@release-it/conventional-changelog": "^7.0.0", "@tweakpane/core": "^1.1.9", "@types/node": "^20.5.4", @@ -59,12 +59,10 @@ "@typescript-eslint/parser": "^6.4.1", "@vitejs/plugin-vue": "^4.3.3", "eslint": "^8.47.0", - "eslint-config-prettier": "^9.0.0", "eslint-plugin-vue": "^9.17.0", "gsap": "^3.12.2", "kolorist": "^1.8.0", "pathe": "^1.1.1", - "prettier": "^3.0.2", "release-it": "^16.1.5", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-visualizer": "^5.9.2", diff --git a/playground/.eslintrc.json b/playground/.eslintrc.json new file mode 100644 index 00000000..a5a64c13 --- /dev/null +++ b/playground/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "@tresjs/eslint-config-vue", + "rules": { + "no-console": "off" + } +} diff --git a/playground/src/components/EnvironmentDemo.vue b/playground/src/components/EnvironmentDemo.vue index e774cea0..f5cb13a3 100644 --- a/playground/src/components/EnvironmentDemo.vue +++ b/playground/src/components/EnvironmentDemo.vue @@ -1,10 +1,11 @@ diff --git a/playground/src/components/LeviosoDemo.vue b/playground/src/components/LeviosoDemo.vue index 0a8fb1bf..4737771b 100644 --- a/playground/src/components/LeviosoDemo.vue +++ b/playground/src/components/LeviosoDemo.vue @@ -40,14 +40,16 @@ pane.addInput(leviosoState, 'floatFactor', { max: 10, }) const groupRef = shallowRef() -