From 4a58c20ba52f7957a241b0d6e0998c2edd6e27bf Mon Sep 17 00:00:00 2001 From: ssube Date: Wed, 29 Jul 2020 08:23:37 -0500 Subject: [PATCH] fix(config): update lint to naming-convention rule --- config/eslint.json | 49 ++++++++++++++++++++++++++++++++++++++++++--- src/type/Include.ts | 8 ++++++-- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/config/eslint.json b/config/eslint.json index a388976..e0ac66e 100644 --- a/config/eslint.json +++ b/config/eslint.json @@ -35,7 +35,6 @@ } } ], - "@typescript-eslint/class-name-casing": "error", "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/consistent-type-definitions": "error", "@typescript-eslint/explicit-member-accessibility": [ @@ -61,7 +60,6 @@ "SwitchCase": 1 } ], - "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-delimiter-style": [ "error", { @@ -89,6 +87,51 @@ ] } ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "default", + "format": [ + "camelCase" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "variable", + "format": [ + "camelCase", + "UPPER_CASE" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "enumMember", + "format": [ + "camelCase", + "UPPER_CASE" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "typeLike", + "format": [ + "PascalCase" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + }, + { + "selector": "interface", + "format": [ + "PascalCase" + ], + "leadingUnderscore": "forbid", + "trailingUnderscore": "forbid" + } + ], "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "error", @@ -386,4 +429,4 @@ } ] } -} \ No newline at end of file +} diff --git a/src/type/Include.ts b/src/type/Include.ts index 2d20fc8..4de8e43 100644 --- a/src/type/Include.ts +++ b/src/type/Include.ts @@ -2,7 +2,11 @@ import { InvalidArgumentError, NotFoundError } from '@apextoaster/js-utils'; import { SAFE_SCHEMA, safeLoad, Schema, Type as YamlType } from 'js-yaml'; import { join } from 'path'; -export type IncludeReader = (path: string, options: { encoding: string }) => string; +export interface IncludeOptions { + encoding: string; +} + +export type IncludeReader = (path: string, options: IncludeOptions) => string; export interface IncludeSchema { exists: (path: string) => boolean; @@ -16,7 +20,7 @@ export interface IncludeSchema { */ export const includeSchema: IncludeSchema = { exists: (path: string) => false, - read: (path: string, encoding: object) => { + read: (path: string, encoding: IncludeOptions) => { throw new Error('read stub'); }, resolve: (path: string) => {