Closed last-Programmer closed 5 years ago
Hey @rbmanian75 thanks for the report. Could you share the source code for the file throwing the error?
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.
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
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