我想将我的角应用程序迁移到ESLint,而不是TSLint,原因有两个:
我似乎找不到任何关于角的教程。有人这么做了吗?我可以使用ESLint,但是剩下的TSLint文件/设置怎么办?
我只想让缩进选项起作用。
"indent": {
"options": ["spaces", 2]
}有什么建议吗?你们用的是什么?
发布于 2019-09-13 08:39:25
目前,我正在将我的角度应用程序迁移到eslint。我通过添加包@typescript-eslint/解析器和@†打字本-eslint/eslint-plugin来扩展eslint配置。目前,我仍在设置整个斯林特配置,但我希望这两个链接已经对你有所帮助。
对于缩进,我补充道:
"@typescript-eslint/indent": ["error", 4]到rules对象。
发布于 2021-01-04 15:02:30
尝试这个https://stackoverflow.com/a/65552444/14764759 tslint到eslint-config
代码样式:更漂亮的覆盖范围: 100% TypeScript:严格的NPM版本循环CI加入https://gitter.im/tslint-to-eslint-config/community代码样式的聊天:更漂亮
将TSLint配置转换为最接近的合理ESLint等效值。
TSLint被否决了。使用来加快将项目迁移到ESLint上。
考虑浏览一下相关的文档:
ESLint itself
typescript-eslint, which allows TypeScript files to be linted by ESLint用法
npx tslint-to-eslint-config
命令读取任何现有的linter、TypeScript和package配置文件,然后根据它们创建一个.eslintrc.js结果。
对于具有相应的TSLint等效项的任何ESLint规则,将在新配置中使用这些等效项。没有TSLint等价物的ESLint规则将用包装。
Requires Node 10+ (LTS) and TSLint 5.18+常见问题
我们强烈建议您在计划从TSLint到ESLint的转换之前阅读docs/FAQs.md。CLI旗
这些标志的每一个都是可选的:
comments: TypeScript configuration or file glob path(s) to convert TSLint rule flags to ESLint within.
config: Path to print the generated ESLint configuration file to.
editor: Path to an editor configuration file to convert linter settings within.
eslint: Path to an ESLint configuration file to read settings from.
package: Path to a package.json file to read dependencies from.
prettier: Add eslint-config-prettier to the plugins list.
tslint: Path to a TSLint configuration file to read settings from.
typescript: Path to a TypeScript configuration file to read TypeScript compiler options from.评论
npx tslint-to-eslint-config --注释
默认值:无
指示要将TSLint规则标志转换为ESLint内联注释。注释如// tslint:禁用:tslint-规则名称将转换为类似// eslint-禁用eslint-规则-名称等等价物。
如果在没有参数的情况下传递,则尊重TypeScript配置中的排除、文件和包含。
如果传递一个以.json结尾的文件路径,则将其视为描述要转换的文件的TypeScript配置文件。
npx tslint-to-eslint-config --注释tsconfig.json
如果传递任何其他参数,这些参数将被视为供文件路径转换的glob路径:
npx tslint-to-eslint-config --注释“src/**/*..ts”
配置
npx tslint到eslint-config --config .eslintrc.json
默认值:.eslintrc.js
将生成的ESLint配置文件打印到。
此路径的文件扩展名将用于确定所创建文件的格式:
.js file paths will be written module.exports = ... JavaScript
Other file paths will default to JSON编辑器
npx tslint到eslint-config--编辑器./path/to/..vscode/path ings.json
默认值:..vscode/setings.json
用于转换内部设置的编辑器配置文件的路径。TSLint的任何VS代码样式编辑器设置都将转换为它们的ESLint等价物。埃斯林
npx tslint到eslint-config-eslint ./path/to/eslintrc.js
默认值:-config的值
要读取设置的ESLint配置文件的路径。生成的ESLint配置文件将包括从该文件导入的任何设置。套餐
npx tslint-to-eslint-config --package ./path/to/package.json
默认值: package.json
要从package.json文件读取依赖项的路径。这将有助于通知生成的ESLint配置文件的env设置。更漂亮
npx tslint-to-eslint-config -更漂亮
缺省值: false
在ESLint插件列表中添加更漂亮的ESLint。我们强烈建议您使用更漂亮的代码格式设置。
当.更漂亮的时候:
If the output configuration already doesn't enable any formatting rules, it'll extend from eslint-config-prettier.
Otherwise, a CLI message will suggest running with --prettier.茨林特
npx tslint-to-eslint-config --tslint ./path/to/tslint.json
默认值: tslint.json
要读取设置的TSLint配置文件的路径。此文件通过管道传输到TSLint的-print中,以生成在生成的ESLint配置文件中启用的规则列表。打字脚本
npx tslint-to-eslint-config --类型记录./path/to/tsconfig.json
默认值: tsconfig.json
从TypeScript配置文件读取TypeScript编译器选项的路径。这将有助于通知生成的ESLint配置文件的env设置。节点API
您可以通过其导出的函数以编程方式使用。有关详细信息,请参阅docs/API。
从“”导入{ convertLintConfig };
结果=等待convertLintConfig();
开发
请参阅一般开发文档。
https://stackoverflow.com/questions/57823941
复制相似问题