Skip to content

Commit

Permalink
Merge pull request #21238 from marcofugaro/eslint-class-properties-fix-2
Browse files Browse the repository at this point in the history
Eslint: add support for class properties
  • Loading branch information
mrdoob authored Feb 9, 2021
2 parents 3fb5f06 + d6c7962 commit 5d7f47f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 35 deletions.
21 changes: 21 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false,
"targets": ">0.3%, not dead",
"loose": true,
"bugfixes": true
}
]
],
"plugins": [
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
]
]
}
37 changes: 36 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"test": "test"
},
"eslintConfig": {
"parser": "@babel/eslint-parser",
"root": true,
"extends": "mdcs",
"plugins": [
Expand Down Expand Up @@ -83,6 +84,7 @@
"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",
Expand Down
35 changes: 1 addition & 34 deletions utils/build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import babel from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';

if ( String.prototype.replaceAll === undefined ) {

String.prototype.replaceAll = function ( find, replace ) {

return this.split( find ).join( replace );

};

}
import babelrc from '../../babel.config.json';

function glconstants() {

Expand Down Expand Up @@ -294,30 +285,6 @@ 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',
Expand Down

0 comments on commit 5d7f47f

Please sign in to comment.