0

I am working on a reactJS project and have added prettierrc file to maintain the coding standards. The issue i am facing right now is a few of the identifiers are in snake_case and i need to maintain them in the same way, but prettier is flagging it as a error and asking me to convert it to camelCase.

Below is my prettierrc file contents in JSON.

{
    "semi": false,
    "tabWidth": 2,
    "printWidth": 100,
    "singleQuote": true,
    "trailingComma": "none",
    "jsxSingleQuote": true,
    "bracketSpacing": true
}

I tried adding conditions to ignore the camelCase error as per a few solutions on StackOverflow, but none of them seem to work for me.

Can someone help me out with this?

  • It would be useful if you could detail what solutions you've tried. Also, if the idea is "to maintain the coding standards" and only "a few of the identifiers are in snake_case" (which seems to imply snake case is the exception, not the rule), is there any reason you want to apply the ignore globally via `.prettierrc` rather than on a per-line basis with `eslint-disable-next-line ...` comments? – ben Feb 06 '23 at 10:11

0 Answers0