I am working on a project which need to be open source now and we need to add Apache license string at top of the each file.
Having said that, I want my tslint
to check if a particular string is present at top of each typescript file and show error if that string is not present.
/*
* Copyright 2017 proje*** contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
I did not see any TS Lint configuration to check if a string is present or not.
Is there any way I can achieve it.
After reviewing many options, I placed a pre-commit hook in our code and configure the node script to execute before a commit is tried on the repository.
There is a module available in npmjs which will make it more easy and you can do it easily
1.install the module
2.develop a script which will run as procommit hook to find specific sting in your code.
3.place the hook to be executed in the package.json