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;
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
add a comment |
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
add a comment |
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
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
node.js json eslint jslint nunjucks
edited Mar 9 at 6:43
John Doee
asked Mar 9 at 6:03
John DoeeJohn Doee
937
937
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:
"parserOptions":
"ecmaVersion": 6,
"sourceType": "module",
Where would I put this code?
– John Doee
Mar 9 at 7:09
In.eslintrc.jsonin your project directory. eslint.org/docs/user-guide/configuring
– Rashomon
Mar 9 at 7:13
add a comment |
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
);
);
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
Required, but never shown
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
const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:
"parserOptions":
"ecmaVersion": 6,
"sourceType": "module",
Where would I put this code?
– John Doee
Mar 9 at 7:09
In.eslintrc.jsonin your project directory. eslint.org/docs/user-guide/configuring
– Rashomon
Mar 9 at 7:13
add a comment |
const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:
"parserOptions":
"ecmaVersion": 6,
"sourceType": "module",
Where would I put this code?
– John Doee
Mar 9 at 7:09
In.eslintrc.jsonin your project directory. eslint.org/docs/user-guide/configuring
– Rashomon
Mar 9 at 7:13
add a comment |
const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:
"parserOptions":
"ecmaVersion": 6,
"sourceType": "module",
const is a ES6 JavaScript feature. Try enabling the ES6 syntax for Eslint:
"parserOptions":
"ecmaVersion": 6,
"sourceType": "module",
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.jsonin your project directory. eslint.org/docs/user-guide/configuring
– Rashomon
Mar 9 at 7:13
add a comment |
Where would I put this code?
– John Doee
Mar 9 at 7:09
In.eslintrc.jsonin 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
add a comment |
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.
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
Required, but never shown
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
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
Required, but never shown
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
Required, but never shown
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
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