tslint

Tslint: JSX elements with no children must be self closing [Error]

自作多情 提交于 2020-06-17 09:12:06
问题 So I've been searching for a solution to this issue. My solution will not build via the command npm run build as I have the error: JSX elements with no children must be self-closing. There is a similar issue here with no accepted (or working) answers: JSX elements with no children must be self-closing The associated Typescript / HTML is of the format: class ExampleClass { render() { return <div> <div> <div>Content 1</div> <div>Content 2</div> <div>Content 3</div> </div> </div>; } } export

How to define enum type in Angular to not violating tslint typedef rule

半腔热情 提交于 2020-06-08 19:17:11
问题 To be able to use enumerations in template, we write below codes in ts file. in workflowProgress.ts export enum WorkflowProgress { cancelled = 0, inProgress, done } in component.ts export class Component { WorkflowProgress = WorkflowProgress; x : WorkflowProgress = WorkflowProgress.done; } in template.html <div *ngIf="x === WorkflowProgress.done"> and we already have tslint with typedef rule enabled. but tslint is nagging about this line WorkflowProgress = WorkflowProgress; [tslint] expected

TSLint configuration for Angular 1 project

江枫思渺然 提交于 2020-05-15 02:44:08
问题 my team is working on project using Angular 1.5.* + typescript. Can someone give me advice for best TSLint configuration for such project as mine? I want now to add TSLint config ( https://github.com/Microsoft/TypeScript/blob/master/tslint.json) from official TS repo and with ESlint rules set. https://github.com/Microsoft/TypeScript/blob/master/tslint.json Will it be enough? What do you think? Thank you in advance for your answers. 回答1: Will it be enough? What do you think? Personally I don't

@typescript-eslint/eslint-plugin error: 'Route' is defined but never used (no-unused-vars)

為{幸葍}努か 提交于 2020-04-10 16:21:12
问题 After eslint adds typescript check, there will be an error when the attribute variable in the class definition is Array. this is my eslintrc.js module.exports = { root: true, env: { node: true }, 'extends': ['plugin:vue/essential', '@vue/standard'], rules: {}, parserOptions: { parser: '@typescript-eslint/parser', project: "./tsconfig.json" }, plugins: ['@typescript-eslint'] }; 回答1: Looking at the eslint repository on github, there have been lots of issues opened about the no-unused-vars rule.

@typescript-eslint/eslint-plugin error: 'Route' is defined but never used (no-unused-vars)

空扰寡人 提交于 2020-04-10 16:20:50
问题 After eslint adds typescript check, there will be an error when the attribute variable in the class definition is Array. this is my eslintrc.js module.exports = { root: true, env: { node: true }, 'extends': ['plugin:vue/essential', '@vue/standard'], rules: {}, parserOptions: { parser: '@typescript-eslint/parser', project: "./tsconfig.json" }, plugins: ['@typescript-eslint'] }; 回答1: Looking at the eslint repository on github, there have been lots of issues opened about the no-unused-vars rule.

@typescript-eslint/eslint-plugin error: 'Route' is defined but never used (no-unused-vars)

痞子三分冷 提交于 2020-04-10 16:18:11
问题 After eslint adds typescript check, there will be an error when the attribute variable in the class definition is Array. this is my eslintrc.js module.exports = { root: true, env: { node: true }, 'extends': ['plugin:vue/essential', '@vue/standard'], rules: {}, parserOptions: { parser: '@typescript-eslint/parser', project: "./tsconfig.json" }, plugins: ['@typescript-eslint'] }; 回答1: Looking at the eslint repository on github, there have been lots of issues opened about the no-unused-vars rule.