woldner / VisualLinter

Visual Studio Linter using ESLint.
MIT License
25 stars 3 forks source link

Unexpected character encountered while parsing value: =. Path '', line 0, position 0. #56

Closed last-Programmer closed 5 years ago

last-Programmer commented 5 years ago

We have installed this extension in VS2019 and whenever we make a change to file and save it we are getting the error

Unexpected character encountered while parsing value: =. Path '', line 0, position 0.

However the errors are displayed in the error list. Dont know which is causing the issue.

this is the config file we have

module.exports = { parser: '@typescript-eslint/parser', // Specifies the ESLint parser plugins: ['@typescript-eslint'], extends: [ 'plugin:@typescript-eslint/recommended' // Uses the recommended rules from the @typescript-eslint/eslint-plugin ], parserOptions: { ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features sourceType: 'module', // Allows for the use of imports }, rules: { "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/array-type": "error" } };

Thanks

woldner commented 5 years ago

Hey @rbmanian75 thanks for the report. Could you share the source code for the file throwing the error?

last-Programmer commented 5 years ago

Oh sorry we cant share the source. Since it is part of big project. But when i run eslint from command line it works without any errors.

last-Programmer commented 5 years ago

but i get this in the output

[{"filePath":"C:\S\SGC\Sgc.Web\Sgc.Web\Scripts\Default.ts","messages":[{"ruleId":"@typescript-eslint/prefer-namespace-keyword","severity":2,"message":"Use 'namespace' instead of 'module' to declare custom TypeScript modules.","line":1,"column":1,"nodeType":"TSModuleDeclaration","messageId":"useNamespace","endLine":485,"endColumn":2,"fix":{"range":[0,6],"text":"namespace"}},{"ruleId":"@typescript-eslint/no-namespace","severity":2,"message":"ES2015 module syntax is preferred over custom TypeScript modules and namespaces.","line":1,"column":1,"nodeType":"TSModuleDeclaration","messageId":"moduleSyntaxIsPreferred","endLine":485,"endColumn":2},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":5,"column":38,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":5,"endColumn":41},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":28,"column":40,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":28,"endColumn":43},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":43,"column":35,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":43,"endColumn":38},{"ruleId":"@typescript-eslint/explicit-member-accessibility","severity":2,"message":"Missing accessibility modifier on method definition constructor.","line":89,"column":9,"nodeType":"MethodDefinition","messageId":"missingAccessibility","endLine":105,"endColumn":10},{"ruleId":"@typescript-eslint/array-type","severity":2,"message":"Array type using 'Array' is forbidden. Use 'any[]' instead.","line":89,"column":42,"nodeType":"TSTypeReference","messageId":"errorStringArray","endLine":89,"endColumn":52,"fix":{"range":[2641,2651],"text":"any[]"}},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":89,"column":48,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":89,"endColumn":51},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":114,"column":35,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":120,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":122,"column":30,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":124,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":126,"column":24,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":130,"endColumn":10},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":126,"column":61,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":126,"endColumn":64},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":143,"column":26,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":167,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":173,"column":31,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":185,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":192,"column":31,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":230,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":237,"column":37,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":256,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":262,"column":32,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":269,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":271,"column":36,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":285,"endColumn":10},{"ruleId":"@typescript-eslint/no-unused-vars","severity":1,"message":"'event' is defined but never used.","line":271,"column":37,"nodeType":"Identifier","endLine":271,"endColumn":48},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":271,"column":45,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":271,"endColumn":48},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":287,"column":35,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":301,"endColumn":10},{"ruleId":"@typescript-eslint/no-unused-vars","severity":1,"message":"'event' is defined but never used.","line":287,"column":36,"nodeType":"Identifier","endLine":287,"endColumn":47},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":287,"column":44,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":287,"endColumn":47},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":303,"column":35,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":305,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":307,"column":28,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":324,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":335,"column":43,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":339,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":341,"column":34,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":370,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":353,"column":17,"nodeType":"ArrowFunctionExpression","messageId":"missingReturnType","endLine":353,"endColumn":91},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":372,"column":36,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":391,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":393,"column":31,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":414,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":416,"column":40,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":443,"endColumn":10},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":433,"column":21,"nodeType":"ArrowFunctionExpression","messageId":"missingReturnType","endLine":441,"endColumn":22},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":439,"column":29,"nodeType":"ArrowFunctionExpression","messageId":"missingReturnType","endLine":439,"endColumn":60},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":448,"column":39,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":456,"endColumn":10},{"ruleId":"@typescript-eslint/array-type","severity":2,"message":"Array type using 'Array' is forbidden. Use 'any[]' instead.","line":448,"column":61,"nodeType":"TSTypeReference","messageId":"errorStringArray","endLine":448,"endColumn":71,"fix":{"range":[16587,16597],"text":"any[]"}},{"ruleId":"@typescript-eslint/no-explicit-any","severity":1,"message":"Unexpected any. Specify a different type.","line":448,"column":67,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":448,"endColumn":70},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":465,"column":25,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":474,"endColumn":10},{"ruleId":"@typescript-eslint/no-unused-vars","severity":1,"message":"'y' is assigned a value but never used.","line":468,"column":19,"nodeType":"Identifier","endLine":468,"endColumn":20},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":470,"column":20,"nodeType":"ArrowFunctionExpression","messageId":"missingReturnType","endLine":473,"endColumn":14},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":472,"column":43,"nodeType":"ArrowFunctionExpression","messageId":"missingReturnType","endLine":472,"endColumn":55},{"ruleId":"@typescript-eslint/explicit-function-return-type","severity":2,"message":"Missing return type on function.","line":476,"column":52,"nodeType":"FunctionExpression","messageId":"missingReturnType","endLine":481,"endColumn":10}],"errorCount":30,"warningCount":11,"fixableErrorCount":3,"fixableWarningCount":0,"source":"module Pages {\r\n\r\n \"use strict\";\r\n\r\n declare let libMenuSidebarReact: any;\r\n\r\n /\r\n Script file associated with Default.aspx.\r\n /\r\n export class Default extends Pages.SuperPage {\r\n\r\n //#region Static Variables\r\n\r\n public static Page: Default;\r\n\r\n //#endregion\r\n\r\n //#region Instance Variables\r\n\r\n /\r\n Is the contentFrame still loading ?\r\n /\r\n public isContentFrameLoading: boolean = false;\r\n\r\n /\r\n Class instance for MenuSiebar's App entry point class\r\n /\r\n public libMenuSidebarReactApp: any = null;\r\n\r\n /\r\n Is the jqxSplitter collapsed ?\r\n /\r\n private isSplitterCollapsed: boolean = false;\r\n\r\n /\r\n the top container (SGC top image + superfish menu)\r\n /\r\n private $headerContainer: JQuery = null;\r\n\r\n /\r\n the central container (menu sidebar + splitter + content frame)\r\n /\r\n private $centerContainer: any = null;\r\n\r\n /\r\n the container

that holds inside the content