- 该规则默认检查字符串是否正确使用双引号。如需修改请参考选项。
- 该规则建议在对.ts文件进行检查时使用。如需检查.ets文件,建议使用@hw-stylistic/quotes。
强制使用一致的反引号、双引号或单引号风格。
- // code-linter.json5
- {
- "rules": {
- "@typescript-eslint/quotes": "error"
- }
- }
- export const double = "double";
- export const foo = `back
- tick`; // backticks are allowed due to newline
- // 默认推荐使用双引号
- export const single = 'single';
- export const unescaped = 'a string containing "double" quotes';
- export const backtick = `back\ntick`; // you can use \n in single or double quoted strings
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功