0.0.3 • Published 11 months ago

@blastlabs/eslint-config v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

Naming Convention 테스트 코드

아래 코드는 ESLint 규칙을 테스트하기 위한 예제입니다.

// ✅ 통과: camelCase 변수
export const validVariable = 'This is valid';

// ❌ 실패: snake_case 변수 (허용되지 않음)
export const invalid_variable = 'This is invalid';

// ✅ 통과: PascalCase 변수
export const ValidVariable = 'This is valid';

// ✅ 통과: UPPER_CASE 변수
export const VALID_VARIABLE = 'This is valid';

// ❌ 실패: 인터페이스 이름에 I 접두어 사용 (허용되지 않음)
export interface IInvalidInterface {
    id: number;
}

// ✅ 통과: PascalCase 인터페이스 이름
export interface ValidInterface {
    id: number;

// ❌ 실패: typeAlias 이름에 T 접두어 사용 (허용되지 않음)
export type TInvalidType = string;

// ✅ 통과: PascalCase typeAlias 이름
export type ValidType = string;

// ❌ 실패: typeParameter 이름에 T 접두어 사용 (허용되지 않음)
function exampleFunction<TInvalid>() {
    return 'Invalid Type Parameter';
}

// ✅ 통과: PascalCase typeParameter 이름
function anotherExampleFunction<ValidParameter>() {
    return 'Valid Type Parameter';
}

// ✅ 통과: camelCase 함수
export function validFunctionName() {
    return 'This is valid';
}

// ✅ 통과: PascalCase 함수
export function ValidFunctionName() {
    return 'This is valid';
}

// ❌ 실패: snake_case 함수 (허용되지 않음)
export function invalid_function_name() {
    return 'This is invalid';
}