Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslint: add support for class properties #21238

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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