We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use grunt with grunt-contrib-jshint on my bundle process for my asp.net core typescript files. I have this super simple typescript code:
grunt-contrib-jshint
function delay(delay: number) { return new Promise(r => { setTimeout(r, delay); }) } class Timer { constructor(public counter: number = 3, public delayMs: number = 1000) { this.doTimer(); } async doTimer() { for (let i = 0; i < this.counter; i++) { await delay(this.delayMs); this.counter = this.counter - 1; console.log(this.counter); } } }
The result js looks like this:
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function delay(delay) { return new Promise(r => { setTimeout(r, delay); }); } class Timer { constructor(counter = 3, delayMs = 1000) { this.counter = counter; this.delayMs = delayMs; this.doTimer(); } doTimer() { return __awaiter(this, void 0, void 0, function* () { for (let i = 0; i < this.counter; i++) { yield delay(this.delayMs); this.counter = this.counter - 1; console.log(this.counter); } }); } } //# sourceMappingURL=Timer.js.map
grunt-contrib-jshint is configured like that in my Gruntfile.js:
Gruntfile.js
module.exports = function (grunt) { grunt.initConfig({ concat: { all: { src: ['Script/Timer.js'], dest: 'temp/app.js' } }, jshint: { files: ['temp/app.js'], options: { '-W069': false, 'esversion': 6, } }, } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-jshint'); };
grunt-contrib-jshint outputs the following errors:
temp/app.js 3 | return new (P || (P = Promise))(function (resolve, reject) { ^ Bad constructor. 6 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } ^ Expected an
I also tried to configure jshint with esversion 9. grunt-contrib-jshintis version 2.1.0. What is wrong?
esversion
2.1.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I use grunt with
grunt-contrib-jshint
on my bundle process for my asp.net core typescript files.I have this super simple typescript code:
The result js looks like this:
grunt-contrib-jshint
is configured like that in myGruntfile.js
:grunt-contrib-jshint
outputs the following errors:I also tried to configure jshint with
esversion
9.grunt-contrib-jshint
is version2.1.0
.What is wrong?
The text was updated successfully, but these errors were encountered: