总是错误
`16:3 error Property name `type_array` must match one of the following formats: camelCase, UPPER_CASE, PascalCase @typescript-eslint/naming-convention
16:3 error Identifier 'type_array' is not in camel case
16:3 error Property name `instument_view_id` must match one of the following formats: camelCase, UPPER_CASE, PascalCase`
我尝试规则从页面https://eslint.org/docs/2.0.0/rules/camelcase添加到.eslintrc.js变量,但没有什么对我有用。:(
`rules: {
camelcase: ['error', {properties: 'always'}],
},
rules: {
camelcase: ['error', {allow: ['aa_bb']}],,
},`
3条答案
按热度按时间jogvjijk1#
ESLint不支持
snake_case
。如果你想使用snake_case
,试试这个ESLint plugin。6ovsh4lw2#
如果你使用的是typescript,你可以这样做:
这可能不是最好的选择,但至少对我有用。
yyhrrdl83#
有时候你真的无法解决这个问题。例如,我在执行以下操作时出现了此错误
但是,将http-header-property-name
Content-Type
更改为camelcase(因为它将不再工作)确实没有意义,因此不幸的是,为此目的的唯一选择是插入行在导致linting-message的行之前。