sfdx force:lightning:lint throwing a Parsing Error with ES6 syntax

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
7
down vote

favorite
1












I'm running the SFDX lightning linter on a lightning component as part of a pull request for my organization, but am hitting the following error:



error Parsing error: Unexpected token >
Line:57:48
searchMap = searchMap.filter(item => item.get("fieldName") !== component.get("v.fieldName"));
^


The issue seems to be that the Lightning Linter does not support ES6 syntax, while the lightning language does. I know from other questions on here that ES6 was added to "the linter" about a year ago and has been supported in the language for some time, but its not clear if it was added to the specific CLI linter at that time. Does anyone know of a way around this? Am I just doing something wrong in getting the linter to accept ES6 syntax? Or has it simply not been added yet? I'm very confidant that I'm on the latest releases of everything.



$ sfdx plugins --core
@salesforce/plugin-generator 0.0.10 (core)
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 43.17.0 (core)
$ sfdx update
sfdx-cli: Updating CLI... already on latest version: 6.34.0-6fec0d751a









share|improve this question







New contributor




Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    up vote
    7
    down vote

    favorite
    1












    I'm running the SFDX lightning linter on a lightning component as part of a pull request for my organization, but am hitting the following error:



    error Parsing error: Unexpected token >
    Line:57:48
    searchMap = searchMap.filter(item => item.get("fieldName") !== component.get("v.fieldName"));
    ^


    The issue seems to be that the Lightning Linter does not support ES6 syntax, while the lightning language does. I know from other questions on here that ES6 was added to "the linter" about a year ago and has been supported in the language for some time, but its not clear if it was added to the specific CLI linter at that time. Does anyone know of a way around this? Am I just doing something wrong in getting the linter to accept ES6 syntax? Or has it simply not been added yet? I'm very confidant that I'm on the latest releases of everything.



    $ sfdx plugins --core
    @salesforce/plugin-generator 0.0.10 (core)
    @salesforce/sfdx-trust 1.0.8 (core)
    builtins 1.0.0 (core)
    salesforcedx 43.17.0 (core)
    $ sfdx update
    sfdx-cli: Updating CLI... already on latest version: 6.34.0-6fec0d751a









    share|improve this question







    New contributor




    Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      7
      down vote

      favorite
      1









      up vote
      7
      down vote

      favorite
      1






      1





      I'm running the SFDX lightning linter on a lightning component as part of a pull request for my organization, but am hitting the following error:



      error Parsing error: Unexpected token >
      Line:57:48
      searchMap = searchMap.filter(item => item.get("fieldName") !== component.get("v.fieldName"));
      ^


      The issue seems to be that the Lightning Linter does not support ES6 syntax, while the lightning language does. I know from other questions on here that ES6 was added to "the linter" about a year ago and has been supported in the language for some time, but its not clear if it was added to the specific CLI linter at that time. Does anyone know of a way around this? Am I just doing something wrong in getting the linter to accept ES6 syntax? Or has it simply not been added yet? I'm very confidant that I'm on the latest releases of everything.



      $ sfdx plugins --core
      @salesforce/plugin-generator 0.0.10 (core)
      @salesforce/sfdx-trust 1.0.8 (core)
      builtins 1.0.0 (core)
      salesforcedx 43.17.0 (core)
      $ sfdx update
      sfdx-cli: Updating CLI... already on latest version: 6.34.0-6fec0d751a









      share|improve this question







      New contributor




      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm running the SFDX lightning linter on a lightning component as part of a pull request for my organization, but am hitting the following error:



      error Parsing error: Unexpected token >
      Line:57:48
      searchMap = searchMap.filter(item => item.get("fieldName") !== component.get("v.fieldName"));
      ^


      The issue seems to be that the Lightning Linter does not support ES6 syntax, while the lightning language does. I know from other questions on here that ES6 was added to "the linter" about a year ago and has been supported in the language for some time, but its not clear if it was added to the specific CLI linter at that time. Does anyone know of a way around this? Am I just doing something wrong in getting the linter to accept ES6 syntax? Or has it simply not been added yet? I'm very confidant that I'm on the latest releases of everything.



      $ sfdx plugins --core
      @salesforce/plugin-generator 0.0.10 (core)
      @salesforce/sfdx-trust 1.0.8 (core)
      builtins 1.0.0 (core)
      salesforcedx 43.17.0 (core)
      $ sfdx update
      sfdx-cli: Updating CLI... already on latest version: 6.34.0-6fec0d751a






      salesforcedx-cli es6 lightning-lint-tool






      share|improve this question







      New contributor




      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      Matthew Coleman

      363




      363




      New contributor




      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Matthew Coleman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          There are two different linters in play, which is where some of your confusion stems from. Aura has a linter that prevalidates code before it is ultimately transpiled into what the browser will actually execute (in debug mode, it's basically just the file, but in production mode, there's some obfuscation that occurs). Contrariwise, the salesforcedx module has a linter that plays by a different, relatively limited set of rules. One of those rules is that, currently, ES6 isn't supported by this linter. It's not known when support for this will appear, but it is not supported yet, even in the pre-release version (44.0.25).



          Using ES6 will cause problems in Internet Explorer 11, although browsers that do support it seem to work okay with ES6 code, including let, arrow functions, const, and a few other supported elements. For now, it is generally recommended that you stick with ES5 code (except, you can safely use Promises).



          As an aside, you can always preview the latest version with the following command:



          sfdx plugins:install salesforcedx@pre-release


          And you can revert back to the latest supported version with:



          sfdx plugins:install salesforcedx@latest





          share|improve this answer



























            up vote
            1
            down vote













            Please refer the last post from here ecma-script-6-eslint-with-lightninglint



            You can change the ecmaVersion in C:Program FilesSalesforce CLIclientnode_modulessalesforce-lightning-clilibaura-component-config.js



            And as per the post it is mentioned that ES6 is not officially supported in Lightning Components.



            Please try changing the ecmaVersion to 6 and try.






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "459"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Matthew Coleman is a new contributor. Be nice, and check out our Code of Conduct.









               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f234384%2fsfdx-forcelightninglint-throwing-a-parsing-error-with-es6-syntax%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              There are two different linters in play, which is where some of your confusion stems from. Aura has a linter that prevalidates code before it is ultimately transpiled into what the browser will actually execute (in debug mode, it's basically just the file, but in production mode, there's some obfuscation that occurs). Contrariwise, the salesforcedx module has a linter that plays by a different, relatively limited set of rules. One of those rules is that, currently, ES6 isn't supported by this linter. It's not known when support for this will appear, but it is not supported yet, even in the pre-release version (44.0.25).



              Using ES6 will cause problems in Internet Explorer 11, although browsers that do support it seem to work okay with ES6 code, including let, arrow functions, const, and a few other supported elements. For now, it is generally recommended that you stick with ES5 code (except, you can safely use Promises).



              As an aside, you can always preview the latest version with the following command:



              sfdx plugins:install salesforcedx@pre-release


              And you can revert back to the latest supported version with:



              sfdx plugins:install salesforcedx@latest





              share|improve this answer
























                up vote
                2
                down vote













                There are two different linters in play, which is where some of your confusion stems from. Aura has a linter that prevalidates code before it is ultimately transpiled into what the browser will actually execute (in debug mode, it's basically just the file, but in production mode, there's some obfuscation that occurs). Contrariwise, the salesforcedx module has a linter that plays by a different, relatively limited set of rules. One of those rules is that, currently, ES6 isn't supported by this linter. It's not known when support for this will appear, but it is not supported yet, even in the pre-release version (44.0.25).



                Using ES6 will cause problems in Internet Explorer 11, although browsers that do support it seem to work okay with ES6 code, including let, arrow functions, const, and a few other supported elements. For now, it is generally recommended that you stick with ES5 code (except, you can safely use Promises).



                As an aside, you can always preview the latest version with the following command:



                sfdx plugins:install salesforcedx@pre-release


                And you can revert back to the latest supported version with:



                sfdx plugins:install salesforcedx@latest





                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  There are two different linters in play, which is where some of your confusion stems from. Aura has a linter that prevalidates code before it is ultimately transpiled into what the browser will actually execute (in debug mode, it's basically just the file, but in production mode, there's some obfuscation that occurs). Contrariwise, the salesforcedx module has a linter that plays by a different, relatively limited set of rules. One of those rules is that, currently, ES6 isn't supported by this linter. It's not known when support for this will appear, but it is not supported yet, even in the pre-release version (44.0.25).



                  Using ES6 will cause problems in Internet Explorer 11, although browsers that do support it seem to work okay with ES6 code, including let, arrow functions, const, and a few other supported elements. For now, it is generally recommended that you stick with ES5 code (except, you can safely use Promises).



                  As an aside, you can always preview the latest version with the following command:



                  sfdx plugins:install salesforcedx@pre-release


                  And you can revert back to the latest supported version with:



                  sfdx plugins:install salesforcedx@latest





                  share|improve this answer












                  There are two different linters in play, which is where some of your confusion stems from. Aura has a linter that prevalidates code before it is ultimately transpiled into what the browser will actually execute (in debug mode, it's basically just the file, but in production mode, there's some obfuscation that occurs). Contrariwise, the salesforcedx module has a linter that plays by a different, relatively limited set of rules. One of those rules is that, currently, ES6 isn't supported by this linter. It's not known when support for this will appear, but it is not supported yet, even in the pre-release version (44.0.25).



                  Using ES6 will cause problems in Internet Explorer 11, although browsers that do support it seem to work okay with ES6 code, including let, arrow functions, const, and a few other supported elements. For now, it is generally recommended that you stick with ES5 code (except, you can safely use Promises).



                  As an aside, you can always preview the latest version with the following command:



                  sfdx plugins:install salesforcedx@pre-release


                  And you can revert back to the latest supported version with:



                  sfdx plugins:install salesforcedx@latest






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 24 mins ago









                  sfdcfox

                  230k10177391




                  230k10177391






















                      up vote
                      1
                      down vote













                      Please refer the last post from here ecma-script-6-eslint-with-lightninglint



                      You can change the ecmaVersion in C:Program FilesSalesforce CLIclientnode_modulessalesforce-lightning-clilibaura-component-config.js



                      And as per the post it is mentioned that ES6 is not officially supported in Lightning Components.



                      Please try changing the ecmaVersion to 6 and try.






                      share|improve this answer
























                        up vote
                        1
                        down vote













                        Please refer the last post from here ecma-script-6-eslint-with-lightninglint



                        You can change the ecmaVersion in C:Program FilesSalesforce CLIclientnode_modulessalesforce-lightning-clilibaura-component-config.js



                        And as per the post it is mentioned that ES6 is not officially supported in Lightning Components.



                        Please try changing the ecmaVersion to 6 and try.






                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          Please refer the last post from here ecma-script-6-eslint-with-lightninglint



                          You can change the ecmaVersion in C:Program FilesSalesforce CLIclientnode_modulessalesforce-lightning-clilibaura-component-config.js



                          And as per the post it is mentioned that ES6 is not officially supported in Lightning Components.



                          Please try changing the ecmaVersion to 6 and try.






                          share|improve this answer












                          Please refer the last post from here ecma-script-6-eslint-with-lightninglint



                          You can change the ecmaVersion in C:Program FilesSalesforce CLIclientnode_modulessalesforce-lightning-clilibaura-component-config.js



                          And as per the post it is mentioned that ES6 is not officially supported in Lightning Components.



                          Please try changing the ecmaVersion to 6 and try.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 29 mins ago









                          Deepak Singh

                          416




                          416




















                              Matthew Coleman is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              Matthew Coleman is a new contributor. Be nice, and check out our Code of Conduct.












                              Matthew Coleman is a new contributor. Be nice, and check out our Code of Conduct.











                              Matthew Coleman is a new contributor. Be nice, and check out our Code of Conduct.













                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f234384%2fsfdx-forcelightninglint-throwing-a-parsing-error-with-es6-syntax%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              Installing NextGIS Connect into QGIS 3?

                              One-line joke