//setting this config for both browser and node environment.
"env": {
"node": true,
"es6": true
//parsing options for the linter to understand the newer version of js and jsx.
"parserOptions": {
"ecmaVersion":2018,
"ecmaFeatures": {
"jsx": true
//settings required for eslint-plugin-react
"settings": {
"react": {
"createClass": "createClass",
"pragma": "React",
"version": "detect"
//this config extends the eslint recommended and react presets.
"extends":["eslint:recommended", "plugin:react/recommended"],
//rules to be applied by eslint while validating the code.
"rules": {
"curly": "error", //enforce consistent brace style for all control statements
"no-undef": "error", //disallow the use of undeclared variables unless mentioned in `/*global */` comments
"no-unused-vars": "error",
"no-trailing-spaces": "error",
"semi": "error", //semicolons a must to end a statement
"no-const-assign": "error",
"eqeqeq": "error", //require the use of `===` and `!==`
"no-extra-boolean-cast":"off"
1. anything that is globally used in the code, should be added here.
2. Format is "<Global var>":"<readonly/writable/off>"
"globals": {
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
function lintJs() {
console.log('[LINTIFYING] Lintifying JS and JSX files');
return src(['app.js','./src/**/*.js', './src/**/*.jsx','./lib/**/*.js'])
.pipe(eslint())
.pipe(eslint.formatEach())
.pipe(eslint.failAfterError())
gulp lintJs
What did you expect to happen?
I expect eslint to lint my js and jsx files successfully
What actually happened? Please include the actual, raw output from ESLint.
...calculateStatsPerFile(messages)
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
It looks like you're running ESLint in an environment that doesn't support object spread syntax (e.g., Node < 8.3.0). Can you double-check your Node version?
On Tue, Mar 9, 2021 at 10:16 PM Milos Djermanovic ***@***.***> wrote:
Hi
@shouryamittal <
https://github.com/shouryamittal>, thanks for the
issue!
...calculateStatsPerFile(messages)
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
It looks like you're running ESLint in an environment that doesn't support
object spread syntax (e.g., Node < 8.3.0). Can you double-check your Node
version?
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<
#14188 (comment)>,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/ADFH2J54UV7EV4CABGXOUC3TCZGEVANCNFSM4Y2Y4DLA>
Can you try to run ESLint directly from the command line, and see if the same error will occur?
npx eslint app.js "./src/**/*.js" "./src/**/*.jsx" "./lib/**/*.js"
I ran the command you sent me above, and it worked fine.
But when I run eslint using "gulp-eslint", it throws the same error.
Thanks,
Shourya
On Thu, Mar 18, 2021 at 5:27 AM Milos Djermanovic ***@***.***> wrote:
Can you try to run ESLint directly from the command line, and see if the
same error will occur?
npx eslint app.js "./src/**/*.js" "./src/**/*.jsx" "./lib/**/*.js"
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<
#14188 (comment)>,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/ADFH2J3DORCBVK2STGDK3UTTEE6VNANCNFSM4Y2Y4DLA>
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Oct 26, 2021
archived due to age
This issue has been archived; please open a new issue for any further discussion
Relates to ESLint's core APIs and features