0

I'm trying to git commit my work. I have an error :

"Identifier 'code_reponse' is not in camel case (@typescript-eslint/camelcase)"

I can't easily replace my var, so I'd like to ignore that control, is that possible ?

ANAFLY
  • 1
  • 2
  • Sure, you can disable the rule entirely, or use a comment to disable it for a particular line or file. See https://eslint.org/docs/user-guide/configuring/ – jonrsharpe Mar 23 '21 at 09:19
  • `// eslint-disable-next-line @typescript-eslint/camelcase` before the variable or `// eslint-disable-line @typescript-eslint/camelcase` on the same line – VLAZ Mar 23 '21 at 09:19
  • It doesn't work (my var is in a json var) but I had --no-verify at the end of my command and it works – ANAFLY Mar 23 '21 at 09:43
  • `--no-verify` will skip *all* the git hooks, your code will just fail in CI instead. If that data is in a JSON file, ESLint shouldn't be checking it. – jonrsharpe Mar 23 '21 at 10:40
  • unfortunetly I can't put my data in a JSON file, I associate var to my JSON structure. What do you mean by my code will fail in CI instead ? @jonrsharpe – ANAFLY Mar 24 '21 at 12:56
  • If it's in a JS file then what exactly do you mean "it doesn't work" and "json car"? And I mean that if you skip the hooks that check your code before committing, that *doesn't actually solve the problem* - if you have a CI pipeline running those checks it will fail, anyone you're collaborating with will get that error once they've integrated your changes, etc. – jonrsharpe Mar 24 '21 at 12:59

0 Answers0