It is shown as underlined when naming wrong while writing code in Android Studio. However, I did not see such a thing in VS Code. Is there a way to turn it on or is there no such feature?
2
Install Camel Case Navigation Extensions
Download from here or Go to Extensions or search "Camel Case Navigation"
I think you are trying to 2 do things at once here.
First, dart has 2 lints rules that ensure your code is using camelCase
camelCase
The rules are by default included in the recommended set of lint rules.
They prevent you from writting:
const PI = 3.14; const kDefaultTimeout = 1000; final URL_SCHEME = RegExp('^([a-z]+):'); class Dice { static final NUMBER_GENERATOR = Random(); } var Item; HttpRequest http_request; ALIGN(clearItems) { // ... }
But they don’t prevent you from writing
var userage; var familyname; var studentnumber;
because those names verify the camelCase regexp.
userAge
userage
What you want now is to verify the spelling of your variables.
You can install the VSCode extension cSpell for that and it will verify that each sub-words of a variable exist and are properly spelled.
cSpell
Click here to cancel reply.
2
Answers
Install Camel Case Navigation Extensions
Download from here or Go to Extensions or search "Camel Case Navigation"
I think you are trying to 2 do things at once here.
First, dart has 2 lints rules that ensure your code is using
camelCase
The rules are by default included in the recommended set of lint rules.
They prevent you from writting:
But they don’t prevent you from writing
because those names verify the
camelCase
regexp.userAge
is a combination of 2 words ("user" and "age").userage
implies your variable is one single word ("userage"). This word doesn’t exist in English but dart doesn’t know that.What you want now is to verify the spelling of your variables.
You can install the VSCode extension
cSpell
for that and it will verify that each sub-words of a variable exist and are properly spelled.