JSLint and ESLint Problems (Brackets) Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!What does the JSLint error 'body of a for in should be wrapped in an if statement' mean?The “unexpected ++” error in jslintJSLint is suddenly reporting: Use the function form of “use strict”Should I use JSLint or JSHint JavaScript validation?JSLint says “missing radix parameter”; what should I do?Turning off eslint rule for a specific lineESLint - “window” is not defined. How to allow global variables in package.jsonEslint: How to disable “unexpected console statement” in Node.js?Turning off eslint rule for a specific fileEslint (Airbnb) indentation issues with React code(JSX)

Putting Ant-Man on house arrest

Mistake in years of experience in resume?

Raising a bilingual kid. When should we introduce the majority language?

Would reducing the reference voltage of an ADC have any effect on accuracy?

How to find the right literary agent in the USA?

What's the difference between using dependency injection with a container and using a service locator?

Are all CP/M-80 implementations binary compatible?

Check if a string is entirely made of the same substring

Refugee travel document from Spain to US

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?

SQL Query not selecting all points that it should?

Why did Israel vote against lifting the American embargo on Cuba?

Additive group of local rings

What is this word supposed to be?

What's parked in Mil Moscow helicopter plant?

std::is_constructible on incomplete types

Split coins into combinations of different denominations

c++ diamond problem - How to call base method only once

How to get even lighting when using flash for group photos near wall?

Need of separate security plugins for both root and subfolder sites Wordpress?

A strange hotel

Seek and ye shall find

Book with legacy programming code on a space ship that the main character hacks to escape



JSLint and ESLint Problems (Brackets)



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!What does the JSLint error 'body of a for in should be wrapped in an if statement' mean?The “unexpected ++” error in jslintJSLint is suddenly reporting: Use the function form of “use strict”Should I use JSLint or JSHint JavaScript validation?JSLint says “missing radix parameter”; what should I do?Turning off eslint rule for a specific lineESLint - “window” is not defined. How to allow global variables in package.jsonEslint: How to disable “unexpected console statement” in Node.js?Turning off eslint rule for a specific fileEslint (Airbnb) indentation issues with React code(JSX)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am creating a mock website for a small project that I am doing. I am using nunjucks to perform some tasks. When I try to create a .js file that I can run later, I am getting errors.



I have looked online, and tried every solution out there. I couldn't get any of them to work.



My Code:



const nunjucks = require('nunjucks');
const fs = require('fs'); // The file system module

let files = ["index.html", "About.html", "Membership.html", "Fighting%20Kites.html"];
let srcDir = "./content/";
let outDir = "./output/";

// Tells nunjucks where to look for templates and set any options
nunjucks.configure('views', autoescape: true );

for (let fname of files)
let contents = fs.readFileSync(srcDir + fname);
let outString = nunjucks.render('base.njk', mainContent: contents);
fs.writeFileSync(outDir + fname, outString);
console.log(`Wrote file: $fname`);



My Error Messages:



JSLint (2)
1 Expected an identifier and instead saw 'const'. const nunjucks = require('nunjucks');
1 Stopping. (10% scanned). const nunjucks = require('nunjucks');

ESLint (1)
1 ERROR: Parsing error: The keyword 'const' is reserved const nunjucks = require('nunjucks');


I have no idea how to fix this. Any ideas help.










share|improve this question






























    1















    I am creating a mock website for a small project that I am doing. I am using nunjucks to perform some tasks. When I try to create a .js file that I can run later, I am getting errors.



    I have looked online, and tried every solution out there. I couldn't get any of them to work.



    My Code:



    const nunjucks = require('nunjucks');
    const fs = require('fs'); // The file system module

    let files = ["index.html", "About.html", "Membership.html", "Fighting%20Kites.html"];
    let srcDir = "./content/";
    let outDir = "./output/";

    // Tells nunjucks where to look for templates and set any options
    nunjucks.configure('views', autoescape: true );

    for (let fname of files)
    let contents = fs.readFileSync(srcDir + fname);
    let outString = nunjucks.render('base.njk', mainContent: contents);
    fs.writeFileSync(outDir + fname, outString);
    console.log(`Wrote file: $fname`);



    My Error Messages:



    JSLint (2)
    1 Expected an identifier and instead saw 'const'. const nunjucks = require('nunjucks');
    1 Stopping. (10% scanned). const nunjucks = require('nunjucks');

    ESLint (1)
    1 ERROR: Parsing error: The keyword 'const' is reserved const nunjucks = require('nunjucks');


    I have no idea how to fix this. Any ideas help.










    share|improve this question


























      1












      1








      1








      I am creating a mock website for a small project that I am doing. I am using nunjucks to perform some tasks. When I try to create a .js file that I can run later, I am getting errors.



      I have looked online, and tried every solution out there. I couldn't get any of them to work.



      My Code:



      const nunjucks = require('nunjucks');
      const fs = require('fs'); // The file system module

      let files = ["index.html", "About.html", "Membership.html", "Fighting%20Kites.html"];
      let srcDir = "./content/";
      let outDir = "./output/";

      // Tells nunjucks where to look for templates and set any options
      nunjucks.configure('views', autoescape: true );

      for (let fname of files)
      let contents = fs.readFileSync(srcDir + fname);
      let outString = nunjucks.render('base.njk', mainContent: contents);
      fs.writeFileSync(outDir + fname, outString);
      console.log(`Wrote file: $fname`);



      My Error Messages:



      JSLint (2)
      1 Expected an identifier and instead saw 'const'. const nunjucks = require('nunjucks');
      1 Stopping. (10% scanned). const nunjucks = require('nunjucks');

      ESLint (1)
      1 ERROR: Parsing error: The keyword 'const' is reserved const nunjucks = require('nunjucks');


      I have no idea how to fix this. Any ideas help.










      share|improve this question
















      I am creating a mock website for a small project that I am doing. I am using nunjucks to perform some tasks. When I try to create a .js file that I can run later, I am getting errors.



      I have looked online, and tried every solution out there. I couldn't get any of them to work.



      My Code:



      const nunjucks = require('nunjucks');
      const fs = require('fs'); // The file system module

      let files = ["index.html", "About.html", "Membership.html", "Fighting%20Kites.html"];
      let srcDir = "./content/";
      let outDir = "./output/";

      // Tells nunjucks where to look for templates and set any options
      nunjucks.configure('views', autoescape: true );

      for (let fname of files)
      let contents = fs.readFileSync(srcDir + fname);
      let outString = nunjucks.render('base.njk', mainContent: contents);
      fs.writeFileSync(outDir + fname, outString);
      console.log(`Wrote file: $fname`);



      My Error Messages:



      JSLint (2)
      1 Expected an identifier and instead saw 'const'. const nunjucks = require('nunjucks');
      1 Stopping. (10% scanned). const nunjucks = require('nunjucks');

      ESLint (1)
      1 ERROR: Parsing error: The keyword 'const' is reserved const nunjucks = require('nunjucks');


      I have no idea how to fix this. Any ideas help.







      node.js json eslint jslint nunjucks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 9 at 6:43







      John Doee

















      asked Mar 9 at 6:03









      John DoeeJohn Doee

      937




      937






















          1 Answer
          1






          active

          oldest

          votes


















          1














          const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:




          "parserOptions":
          "ecmaVersion": 6,
          "sourceType": "module",







          share|improve this answer

























          • Where would I put this code?

            – John Doee
            Mar 9 at 7:09











          • In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

            – Rashomon
            Mar 9 at 7:13











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55074499%2fjslint-and-eslint-problems-brackets%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:




          "parserOptions":
          "ecmaVersion": 6,
          "sourceType": "module",







          share|improve this answer

























          • Where would I put this code?

            – John Doee
            Mar 9 at 7:09











          • In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

            – Rashomon
            Mar 9 at 7:13















          1














          const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:




          "parserOptions":
          "ecmaVersion": 6,
          "sourceType": "module",







          share|improve this answer

























          • Where would I put this code?

            – John Doee
            Mar 9 at 7:09











          • In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

            – Rashomon
            Mar 9 at 7:13













          1












          1








          1







          const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:




          "parserOptions":
          "ecmaVersion": 6,
          "sourceType": "module",







          share|improve this answer















          const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:




          "parserOptions":
          "ecmaVersion": 6,
          "sourceType": "module",








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 9 at 7:23

























          answered Mar 9 at 7:09









          RashomonRashomon

          6151418




          6151418












          • Where would I put this code?

            – John Doee
            Mar 9 at 7:09











          • In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

            – Rashomon
            Mar 9 at 7:13

















          • Where would I put this code?

            – John Doee
            Mar 9 at 7:09











          • In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

            – Rashomon
            Mar 9 at 7:13
















          Where would I put this code?

          – John Doee
          Mar 9 at 7:09





          Where would I put this code?

          – John Doee
          Mar 9 at 7:09













          In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

          – Rashomon
          Mar 9 at 7:13





          In .eslintrc.json in your project directory. eslint.org/docs/user-guide/configuring

          – Rashomon
          Mar 9 at 7:13



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55074499%2fjslint-and-eslint-problems-brackets%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

          Алба-Юлія

          Захаров Федір Захарович