浏览代码

Merge pull request #21239 from mrdoob/revert-21238-eslint-class-properties-fix-2

Revert "Eslint: add support for class properties"
Mr.doob 4 年之前
父节点
当前提交
7e79a42cc6
共有 4 个文件被更改,包括 35 次插入60 次删除
  1. 0 21
      babel.config.json
  2. 1 36
      package-lock.json
  3. 0 2
      package.json
  4. 34 1
      utils/build/rollup.config.js

+ 0 - 21
babel.config.json

@@ -1,21 +0,0 @@
-{
-  "presets": [
-    [
-      "@babel/preset-env",
-      {
-        "modules": false,
-        "targets": ">0.3%, not dead",
-        "loose": true,
-        "bugfixes": true
-      }
-    ]
-  ],
-  "plugins": [
-    [
-      "@babel/plugin-proposal-class-properties",
-      {
-        "loose": true
-      }
-    ]
-  ]
-}

+ 1 - 36
package-lock.json

@@ -152,41 +152,6 @@
         }
       }
     },
-    "@babel/eslint-parser": {
-      "version": "7.12.13",
-      "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.12.13.tgz",
-      "integrity": "sha512-+VF2M8ZWXc2KVf6L0tFcv6w8IZkCc1rvN65oj6hXxhYtOanlCA6ONpgEdy/HVGmcogu4El4ohdzuyfWYxSsKow==",
-      "dev": true,
-      "requires": {
-        "eslint-scope": "5.1.0",
-        "eslint-visitor-keys": "^1.3.0",
-        "semver": "^6.3.0"
-      },
-      "dependencies": {
-        "eslint-scope": {
-          "version": "5.1.0",
-          "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz",
-          "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==",
-          "dev": true,
-          "requires": {
-            "esrecurse": "^4.1.0",
-            "estraverse": "^4.1.1"
-          }
-        },
-        "eslint-visitor-keys": {
-          "version": "1.3.0",
-          "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
-          "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
-          "dev": true
-        },
-        "semver": {
-          "version": "6.3.0",
-          "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
-          "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
-          "dev": true
-        }
-      }
-    },
     "@babel/generator": {
       "version": "7.12.1",
       "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
@@ -3113,7 +3078,7 @@
     },
     "path-is-absolute": {
       "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+      "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
       "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
       "dev": true
     },

+ 0 - 2
package.json

@@ -26,7 +26,6 @@
     "test": "test"
   },
   "eslintConfig": {
-    "parser": "@babel/eslint-parser",
     "root": true,
     "extends": "mdcs",
     "plugins": [
@@ -84,7 +83,6 @@
   "homepage": "https://threejs.org/",
   "devDependencies": {
     "@babel/core": "^7.12.10",
-    "@babel/eslint-parser": "^7.12.13",
     "@babel/plugin-proposal-class-properties": "^7.12.1",
     "@babel/preset-env": "^7.12.11",
     "@rollup/plugin-babel": "^5.2.2",

+ 34 - 1
utils/build/rollup.config.js

@@ -1,7 +1,16 @@
 import babel from '@rollup/plugin-babel';
 import { nodeResolve } from '@rollup/plugin-node-resolve';
 import { terser } from 'rollup-plugin-terser';
-import babelrc from '../../babel.config.json';
+
+if ( String.prototype.replaceAll === undefined ) {
+
+	String.prototype.replaceAll = function ( find, replace ) {
+
+		return this.split( find ).join( replace );
+
+	};
+
+}
 
 function glconstants() {
 
@@ -285,6 +294,30 @@ function polyfills() {
 
 }
 
+const babelrc = {
+	presets: [
+		[
+			'@babel/preset-env',
+			{
+				modules: false,
+				// the supported browsers of the three.js browser bundle
+				// https://browsersl.ist/?q=%3E0.3%25%2C+not+dead
+				targets: '>0.3%, not dead',
+				loose: true,
+				bugfixes: true,
+			},
+		],
+	],
+	plugins: [
+		[
+			'@babel/plugin-proposal-class-properties',
+			{
+				loose: true
+			}
+		]
+	]
+};
+
 export default [
 	{
 		input: 'src/Three.js',