Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only apply method/param decorator rules for specific SuperClasses #7

Open
robdobtob opened this issue Nov 21, 2024 · 0 comments
Open

Comments

@robdobtob
Copy link

Want to have the ability to enforce decorator usage for methods and parameters only when the class they are associated with extends a specific super class

For example, only enforce the use of the assert decorator if the associated class extends Mixins

// This one fails the eslint rule
class SomeClass extends Mixins {
	private somePrivateMethod(
		someParameter: number
	): number {
		return someParameter;
	}


	someMethod(
		someParameter: number
	): number {
		return someParameter;
	}

	async someAsyncMethod(
		someParameter: number
	): number {
		return someParameter;
	}
}

// This one doesnt fail the eslint rule
class SomeClass extends Vue {
	private somePrivateMethod(
		someParameter: number
	): number {
		return someParameter;
	}


	someMethod(
		someParameter: number
	): number {
		return someParameter;
	}

	async someAsyncMethod(
		someParameter: number
	): number {
		return someParameter;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant