Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lint/rules/camelcase.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ Of note:
let first_name = "Ichigo";
const obj1 = { last_name: "Hoshimiya" };
const obj2 = { first_name };
const { last_name } = obj1;

function do_something() {}
function foo({ snake_case = "default value" }) {}

class snake_case_class {}
class Also_Not_Valid_Class {}

import { not_camelCased } from "external-module.js";
export * as not_camelCased from "mod.ts";

enum snake_case_enum {
Expand All @@ -54,6 +52,7 @@ const __myPrivateVariable = "Hoshimiya";
const myPrivateVariable_ = "Hoshimiya";
const obj1 = { "last_name": "Hoshimiya" }; // if an object key is wrapped in quotation mark, then it's valid
const obj2 = { "first_name": first_name };
const { last_name } = obj1; // valid, because one has no control over the identifier
const { last_name: lastName } = obj;

function doSomething() {} // function declarations must be camelCase but...
Expand All @@ -62,6 +61,7 @@ function foo({ snake_case: camelCase = "default value" }) {}

class PascalCaseClass {}

import { not_camelCased } from "external-module.js"; // valid, because one has no control over the identifier
import { not_camelCased as camelCased } from "external-module.js";
export * as camelCased from "mod.ts";

Expand Down
Loading