File tree Expand file tree Collapse file tree 6 files changed +21
-2
lines changed Expand file tree Collapse file tree 6 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @aws-amplify/deployed-backend-client ' : minor
3+ ---
4+
5+ remove static method
Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ module.exports = {
141141 'MethodDefinition[kind!=/[constructor|get]/]' ,
142142 'FunctionDeclaration' ,
143143 'VariableDeclarator > FunctionExpression' ,
144+ {
145+ selector : 'MethodDefinition[static=true]' ,
146+ message : 'Static methods are not allowed in classes.' ,
147+ } ,
144148 ] ,
145149 'jsdoc/require-description' : 'error' ,
146150 'jsdoc/require-jsdoc' : [
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ export type DeployedBackendClient = {
133133
134134// @public
135135export class DeployedBackendClientFactory {
136- static getInstance(options : DeployedBackendClientFactoryOptions ): DeployedBackendClient ;
136+ getInstance(options : DeployedBackendClientFactoryOptions ): DeployedBackendClient ;
137137}
138138
139139// @public (undocumented)
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export class DeployedBackendClientFactory {
128128 /**
129129 * Returns a single instance of DeploymentClient
130130 */
131- static getInstance (
131+ getInstance (
132132 options : DeployedBackendClientFactoryOptions
133133 ) : DeployedBackendClient {
134134 const stackStatusMapper = new StackStatusMapper ( ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ export class BackendIdentifierConversions {
1515 *
1616 * If the stack name is ambiguous, undefined is returned
1717 */
18+ // It's fine to ignore the rule here because the anti-static rule is to ban the static function which should use constructor
19+ // eslint-disable-next-line no-restricted-syntax
1820 static fromStackName ( stackName ?: string ) : BackendIdentifier | undefined {
1921 if ( ! stackName ) {
2022 return ;
@@ -47,6 +49,8 @@ export class BackendIdentifierConversions {
4749 *
4850 * Changing this method will change how stack names are generated which could be a massive breaking change for existing Amplify stacks.
4951 */
52+ // It's fine to ignore the rule here because the anti-static rule is to ban the static function which should use constructor
53+ // eslint-disable-next-line no-restricted-syntax
5054 static toStackName ( backendId : BackendIdentifier ) : string {
5155 const hash = getHash ( backendId ) ;
5256
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export class ParameterPathConversions {
1111 /**
1212 * Convert a BackendIdentifier to a parameter prefix.
1313 */
14+ // It's fine to ignore the rule here because the anti-static rule is to ban the static function which should use constructor
15+ // eslint-disable-next-line no-restricted-syntax
1416 static toParameterPrefix ( backendId : BackendIdentifier | AppId ) : string {
1517 if ( typeof backendId === 'object' ) {
1618 return getBackendParameterPrefix ( backendId ) ;
@@ -21,6 +23,8 @@ export class ParameterPathConversions {
2123 /**
2224 * Convert a BackendIdentifier to a parameter full path.
2325 */
26+ // It's fine to ignore the rule here because the anti-static rule is to ban the static function which should use constructor
27+ // eslint-disable-next-line no-restricted-syntax
2428 static toParameterFullPath (
2529 backendId : BackendIdentifier | AppId ,
2630 parameterName : string
@@ -34,6 +38,8 @@ export class ParameterPathConversions {
3438 /**
3539 * Generate an SSM path for references to other backend resources
3640 */
41+ // It's fine to ignore the rule here because the anti-static rule is to ban the static function which should use constructor
42+ // eslint-disable-next-line no-restricted-syntax
3743 static toResourceReferenceFullPath (
3844 backendId : BackendIdentifier ,
3945 referenceName : string
You can’t perform that action at this time.
0 commit comments