From 693c49f8e1d5d0c5ad4309d0c0486de43d08d8f5 Mon Sep 17 00:00:00 2001 From: huyang Date: Thu, 16 Nov 2023 16:13:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dwindows=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8Bshader=E5=AD=97=E7=AC=A6=E4=B8=B2=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=8D=A2=E8=A1=8C=E7=AC=A6=E5=AF=BC=E8=87=B4shader?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E7=BB=93=E6=9E=9C=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?bug=20feat:=20=E6=9B=B4=E6=96=B0.eslintrc.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 11 ++++++----- .../core/src/services/shader/ShaderModuleService.ts | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b46ba964b2..e748139a22 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,7 @@ module.exports = { globals: { - "AMap": true, - "L7": true, + 'AMap': true, + 'L7': true, }, env: { browser: true, @@ -15,9 +15,9 @@ module.exports = { ecmaVersion: 12, sourceType: 'module' }, - plugins: ['@typescript-eslint',"unused-imports"], + plugins: ['@typescript-eslint','unused-imports'], rules: { - "unused-imports/no-unused-imports": "error", + 'unused-imports/no-unused-imports': 'error', '@typescript-eslint/no-loss-of-precision':0, '@typescript-eslint/no-inferrable-types': 0, 'no-constant-condition': 0, @@ -29,7 +29,8 @@ module.exports = { 'no-useless-catch': 0, '@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/no-explicit-any':0, - "@typescript-eslint/no-unused-vars": 0, + '@typescript-eslint/no-unused-vars': 0, + '@typescript-eslint/no-duplicate-enum-values':0, 'prefer-rest-params':0, }, settings: { diff --git a/packages/core/src/services/shader/ShaderModuleService.ts b/packages/core/src/services/shader/ShaderModuleService.ts index 97cbb823d6..cac86a1101 100644 --- a/packages/core/src/services/shader/ShaderModuleService.ts +++ b/packages/core/src/services/shader/ShaderModuleService.ts @@ -56,6 +56,8 @@ export default class ShaderModuleService implements IShaderModuleService { // return; // } + moduleParams.vs = moduleParams.vs.replace(/\r\n/g, '\n'); // 将所有的\r\n替换为\n + moduleParams.fs = moduleParams.fs.replace(/\r\n/g, '\n'); // 将所有的\r\n替换为\n const { vs, fs, uniforms: declaredUniforms, inject } = moduleParams; const { content: extractedVS, uniforms: vsUniforms } = extractUniforms(vs); const { content: extractedFS, uniforms: fsUniforms } = extractUniforms(fs);