mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
* fix(enums-eslint): Enum Rule for ESLint - Added enums in the warnings for eslint. * fix(enums-eslint): Enum Rule for ESLint - Updated to error in both places for enums. * fix(enums-eslint): Enum Rule for ESLint - Added new eslint plugin for warning on enums. * fix(enums-eslint): Enum Rule for ESLint - Changed based on suggestion. Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com> * refactor(browser-platform-utils): Remove Deprecation and Fix Code - Changed usages of firefox to private and moved the usages to the preferred public method and removed the deprecations. * fix(enums-eslint): Enum Rule for ESLint - Updated to error and added disable rules for all other places. * fix(enums-eslint): Enum Rule for ESLint - Undid other changes by accident
24 lines
475 B
JavaScript
24 lines
475 B
JavaScript
export const errorMessage = "Enums are discouraged, please use a const object instead";
|
|
|
|
export default {
|
|
meta: {
|
|
type: "suggestion",
|
|
docs: {
|
|
description: "Enforce using consts instead of enums",
|
|
category: "Best Practices",
|
|
recommended: false,
|
|
},
|
|
schema: [],
|
|
},
|
|
create(context) {
|
|
return {
|
|
TSEnumDeclaration(node) {
|
|
context.report({
|
|
node,
|
|
message: errorMessage,
|
|
});
|
|
},
|
|
};
|
|
},
|
|
};
|