sfdx force:lightning:lint throwing a Parsing Error with ES6 syntax
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
7
down vote
favorite
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
New contributor
add a comment |Â
up vote
7
down vote
favorite
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
New contributor
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
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
New contributor
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
salesforcedx-cli es6 lightning-lint-tool
New contributor
New contributor
New contributor
asked 1 hour ago
Matthew Coleman
363
363
New contributor
New contributor
add a comment |Â
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered 24 mins ago
sfdcfox
230k10177391
230k10177391
add a comment |Â
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered 29 mins ago
Deepak Singh
416
416
add a comment |Â
add a comment |Â
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.
Matthew Coleman is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password