Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d875a3

Browse files
authored
Update js/closure to new algorithm (google#328)
* fix library, add benchmark tests * update js, format, enforce style checks
1 parent 5d5b736 commit 3d875a3

File tree

5 files changed

+221
-183
lines changed

5 files changed

+221
-183
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ matrix:
7171
- chmod +x install.sh
7272
- ./install.sh --user && rm -f install.sh
7373
- ~/bin/bazel test ${OLC_PATH}:all
74+
- cd js && npm install && ./node_modules/.bin/eslint closure/*js
7475

7576
# Javascript implementation. Lives in js/.
7677
- language: node_js

js/closure/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library", "closure
33
closure_js_library(
44
name = "openlocationcode_lib",
55
srcs = ["openlocationcode.js"],
6+
convention = "GOOGLE",
67
)
78

89
closure_js_test(

js/closure/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ You can use it in Closure projects like this:
1111
var code = openlocationcode.encode(47.36628,8.52513);
1212
```
1313

14+
## Code Style And Formatting
15+
16+
Code should be formatted according to the
17+
[Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html).
18+
19+
You can run checks on the code using `eslint`:
20+
21+
```
22+
cd js
23+
npm install eslint
24+
eslint closure/*js
25+
```
26+
27+
If there are any syntax or style errors, it will output messages. Note that
28+
syntax or style errors will cause the TravisCI tests to **fail**.
29+
1430
## Building and Testing
1531

1632
Included is a `BUILD` file that uses the [Bazel](https://bazel.build/) build system to produce a JavaScript library and to run tests. You will need to install Bazel on your system to run the tests.

0 commit comments

Comments
 (0)