Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ const config = createConfig([
typescript,
]),
...NO_CONTROLLER_STATE_CHANGE_SELECTOR_OBJECTS,
{
selector: 'TSEnumDeclaration',
message:
"Don't use enums. There are a number of reasons why they are problematic, but the most important is that TypeScript treats them nominally, not structurally, and this can cause unexpected breaking changes. Instead, use an object + type, an array + type, or just a type. Learn more here: https://github.com/MetaMask/eslint-config/issues/417",
},
],
},
},
Expand Down
28 changes: 16 additions & 12 deletions scripts/create-package/constants.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
/**
* The monorepo files that need to be parsed or modified.
*/
export enum MonorepoFiles {
PackageJson = 'package.json',
TsConfig = 'tsconfig.json',
TsConfigBuild = 'tsconfig.build.json',
}
export const MonorepoFiles = {
PackageJson: 'package.json',
TsConfig: 'tsconfig.json',
TsConfigBuild: 'tsconfig.build.json',
} as const;

export type MonorepoFiles = (typeof MonorepoFiles)[keyof typeof MonorepoFiles];

/**
* Placeholder values in package template files that need to be replaced with
* actual values corresponding to the new package.
*/
export enum Placeholders {
CurrentYear = 'CURRENT_YEAR',
NodeVersions = 'NODE_VERSIONS',
PackageName = 'PACKAGE_NAME',
PackageDescription = 'PACKAGE_DESCRIPTION',
PackageDirectoryName = 'PACKAGE_DIRECTORY_NAME',
}
export const Placeholders = {
CurrentYear: 'CURRENT_YEAR',
NodeVersions: 'NODE_VERSIONS',
PackageName: 'PACKAGE_NAME',
PackageDescription: 'PACKAGE_DESCRIPTION',
PackageDirectoryName: 'PACKAGE_DIRECTORY_NAME',
} as const;

export type Placeholders = (typeof Placeholders)[keyof typeof Placeholders];
Loading