let linter handle type naming conventions

Summary: {gif:kosnw403}

Reviewed By: passy

Differential Revision: D33846715

fbshipit-source-id: 5de4bb0cf88f24f5a26acedb82a0816417fb0787
This commit is contained in:
Anton Kastritskiy
2022-01-31 02:47:55 -08:00
committed by Facebook GitHub Bot
parent c28c454373
commit 1aff8466b1
5 changed files with 11 additions and 1 deletions

View File

@@ -189,6 +189,14 @@ module.exports = {
caughtErrorsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_',
}, },
], ],
'@typescript-eslint/naming-convention': [
2,
{
selector: 'typeLike',
format: ['PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
],
}, },
}, },
{ {

View File

@@ -64,6 +64,7 @@ export function parsePath(content: string): string | null {
return path.trim(); return path.trim();
} }
// eslint-disable-next-line @typescript-eslint/naming-convention
export class iOSCrashWatcher extends DeviceListener { export class iOSCrashWatcher extends DeviceListener {
constructor(private readonly device: ServerDevice) { constructor(private readonly device: ServerDevice) {
super(() => device.connected); super(() => device.connected);

View File

@@ -25,6 +25,7 @@ import {getFlipperServerConfig} from '../../FlipperServerConfig';
import {IdbConfig, setIdbConfig} from './idbConfig'; import {IdbConfig, setIdbConfig} from './idbConfig';
import {assertNotNull} from 'flipper-server-core/src/comms/Utilities'; import {assertNotNull} from 'flipper-server-core/src/comms/Utilities';
// eslint-disable-next-line @typescript-eslint/naming-convention
type iOSSimulatorDevice = { type iOSSimulatorDevice = {
state: 'Booted' | 'Shutdown' | 'Shutting Down'; state: 'Booted' | 'Shutdown' | 'Shutting Down';
availability?: string; availability?: string;

View File

@@ -61,6 +61,7 @@ type RawLogEntry = {
// Mar 25 17:06:38 iPhone symptomsd(SymptomEvaluator)[125] <Notice>: Stuff // Mar 25 17:06:38 iPhone symptomsd(SymptomEvaluator)[125] <Notice>: Stuff
const logRegex = /(^.{15}) ([^ ]+?) ([^\[]+?)\[(\d+?)\] <(\w+?)>: (.*)$/s; const logRegex = /(^.{15}) ([^ ]+?) ([^\[]+?)\[(\d+?)\] <(\w+?)>: (.*)$/s;
// eslint-disable-next-line @typescript-eslint/naming-convention
export class iOSLogListener extends DeviceListener { export class iOSLogListener extends DeviceListener {
constructor( constructor(
isDeviceConnected: () => boolean, isDeviceConnected: () => boolean,

View File

@@ -160,7 +160,6 @@ To start Flipper against a specific OnDemand instance, set FB_ONDEMAND flag, e.g
## Guidelines for writing TypeScript ## Guidelines for writing TypeScript
* Prefer `type` for React props and state over interfaces * Prefer `type` for React props and state over interfaces
* Dont prefix interfaces with `I` * Dont prefix interfaces with `I`
* Enums, Types and Interfaces use PascalCase (uppercase first letter)
* Install 3rd party type definitions as dev dependency (e.g. `yarn add @types/lodash --dev`) * Install 3rd party type definitions as dev dependency (e.g. `yarn add @types/lodash --dev`)
## Submitting a diff / PR ## Submitting a diff / PR