Skip to content

Commit 557e1e0

Browse files
committed
Added option to turn off JSHint for translations
When the option is set to true, the comment "// jshint ignore: start" is prepended to the compiled translations file. Thus the file is ignored by JSHint.
1 parent 1c7fb2e commit 557e1e0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Check the website for usage instructions: [http://angular-gettext.rocketeer.be/]
1717

1818
## Options
1919

20-
All options and defaults are displayed below:
20+
All options and defaults are displayed below:
2121

2222
```JSON
2323
{
@@ -33,11 +33,12 @@ All options and defaults are displayed below:
3333
"lineNumbers": true,
3434
"format": "javascript",
3535
"defaultLanguage": false,
36-
"requirejs": false
36+
"requirejs": false,
37+
"jshintIgnore": false
3738
}
3839
```
3940

40-
## License
41+
## License
4142

4243
(The MIT License)
4344

lib/compile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ var formats = {
2020
module += '}]);';
2121

2222
if (options.requirejs) {
23-
return 'define([\'angular\', \'' + options.modulePath + '\'], function (angular) {\n' + module + '\n});';
23+
module = 'define([\'angular\', \'' + options.modulePath + '\'], function (angular) {\n' + module + '\n});';
24+
}
25+
26+
if (options.jshintIgnore) {
27+
module = '// jshint ignore: start\n' + module;
2428
}
2529

2630
return module;

0 commit comments

Comments
 (0)