Skip to content

Commit

Permalink
Build-examples: use eslint indentation (#21677)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofugaro committed Apr 19, 2021
1 parent 6a85683 commit a123368
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions utils/build/rollup.examples.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@ const EOL = os.EOL;

function babelCleanup() {

const doubleSpaces = / {2}/g;

return {

transform( code ) {

code = code.replace( doubleSpaces, '\t' );


// remove comments messed up by babel that break eslint
// example:
// setSize: function ()
Expand All @@ -26,7 +21,6 @@ function babelCleanup() {
// setSize: function () {
code = code.replace( new RegExp( `\\(\\)${EOL}\\s*\\/\\*([a-zA-Z0-9_, ]+)\\*\\/${EOL}\\s*{`, 'g' ), '( ) {' );


return {
code: code,
map: null
Expand Down Expand Up @@ -103,7 +97,7 @@ function unmodularize() {
// fix for BasisTextureLoader.js
imports.forEach( imp => {

code = code.replace( new RegExp( `${EOL}(\\s)THREE\\.${imp}:`, 'g' ), ( match, p1 ) => {
code = code.replace( new RegExp( `${EOL}(\\s)*THREE\\.${imp}:`, 'g' ), ( match, p1 ) => {

return `${EOL}${p1}${imp}:`;

Expand Down

0 comments on commit a123368

Please sign in to comment.