Skip to content

Commit bfa7144

Browse files
alex-okrushkoshicks
authored andcommitted
Add TypeScript style guide
1 parent d5b5104 commit bfa7144

File tree

3 files changed

+2447
-4
lines changed

3 files changed

+2447
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Google Style Guides
2-
===================
1+
# Google Style Guides
32

43
Every major open-source project has its own style guide: a set of conventions
54
(sometimes arbitrary) about how to write code for that project. It is much
@@ -13,11 +12,11 @@ style guidelines we use for Google code. If you are modifying a project that
1312
originated at Google, you may be pointed to this page to see the style guides
1413
that apply to that project.
1514

16-
This project holds the [C++ Style Guide][cpp], [C# Style Guide][csharp],
15+
This project holds the [C++ Style Guide][cpp], [C# Style Guide][csharp],
1716
[Swift Style Guide][swift], [Objective-C Style Guide][objc],
1817
[Java Style Guide][java], [Python Style Guide][py], [R Style Guide][r],
1918
[Shell Style Guide][sh], [HTML/CSS Style Guide][htmlcss],
20-
[JavaScript Style Guide][js], [AngularJS Style Guide][angular],
19+
[JavaScript Style Guide][js], [TypeScript Style Guide][ts], [AngularJS Style Guide][angular],
2120
[Common Lisp Style Guide][cl], and [Vimscript Style Guide][vim]. This project
2221
also contains [cpplint][cpplint], a tool to assist with style guide compliance,
2322
and [google-c-style.el][emacs], an Emacs settings file for Google style.
@@ -46,6 +45,7 @@ The following Google style guides live outside of this project:
4645
[sh]: https://google.github.io/styleguide/shellguide.html
4746
[htmlcss]: https://google.github.io/styleguide/htmlcssguide.html
4847
[js]: https://google.github.io/styleguide/jsguide.html
48+
[ts]: https://google.github.io/styleguide/tsguide.html
4949
[angular]: https://google.github.io/styleguide/angularjs-google-style.html
5050
[cl]: https://google.github.io/styleguide/lispguide.xml
5151
[vim]: https://google.github.io/styleguide/vimscriptguide.xml

include/jsguide.js

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ window.initStyleGuide = function(init) {
4141
// properly. Fix it by moving the code directly into the pre.
4242
find('pre > code', function(code) {
4343
var pre = code.parentElement;
44+
// internal TS style guide does not want prettyprint
45+
if (code.classList.contains("language-ts")) {
46+
code.classList.add("prettyprint");
47+
}
4448
pre.className = code.className;
4549
pre.innerHTML = code.innerHTML;
4650
});

0 commit comments

Comments
 (0)