This repository was archived by the owner on Dec 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +90
-13
lines changed Expand file tree Collapse file tree 5 files changed +90
-13
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "env": {
3
+ "node": true
4
+ },
5
+ "rules": {
6
+ "strict": 0,
7
+ "camelcase": 0,
8
+ "curly": 0,
9
+ "indent": [2, 2, { "SwitchCase": 1 }],
10
+ "eol-last": 1,
11
+ "no-shadow": 0,
12
+ "no-redeclare": 2,
13
+ "no-extra-bind": 1,
14
+ "no-empty": 0,
15
+ "no-process-exit": 1,
16
+ "no-underscore-dangle": 0,
17
+ "no-use-before-define": 0,
18
+ "no-unused-vars": 0,
19
+ "consistent-return": 0,
20
+ "no-inner-declarations": 1,
21
+ "no-loop-func": 1
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ sudo : false
2
+ language : node_js
3
+ node_js :
4
+ - " 4"
5
+ - " 6"
Original file line number Diff line number Diff line change @@ -116,6 +116,12 @@ Don't forget to polyfill require if you want to use it in Node.js. See the webpa
116
116
<br />
117
117
<a href="https://github.com/">Kent C. Dodds</a>
118
118
</td>
119
+ <td align="center">
120
+ <img width="150" height="150"
121
+ src="https://avatars.githubusercontent.com/stevelacy?v=3">
122
+ <br />
123
+ <a href="https://github.com/stevelacy">Steve Lacy</a>
124
+ </td>
119
125
<tr>
120
126
<tbody >
121
127
</table >
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " json5-loader" ,
3
- "version" : " 0.6.0" ,
4
- "author" : " Tobias Koppers @sokra" ,
5
- "description" : " json5 loader module for webpack" ,
6
- "peerDependencies" : {
7
- "json5" : " >= 0.2.0 <= 0.5"
8
- },
9
- "licenses" : [
10
- {
11
- "type" : " MIT" ,
12
- "url" : " http://www.opensource.org/licenses/mit-license.php"
13
- }
14
- ]
2
+ "name" : " json5-loader" ,
3
+ "version" : " 1.0.0" ,
4
+ "author" : " Tobias Koppers @sokra" ,
5
+ "description" : " json5 loader module for webpack" ,
6
+ "dependencies" : {
7
+ "json5" : " ^0.5.0"
8
+ },
9
+ "license" : " MIT" ,
10
+ "devDependencies" : {
11
+ "mocha" : " ^3.0.2" ,
12
+ "should" : " ^11.1.0"
13
+ },
14
+ "scripts" : {
15
+ "test" : " mocha test/*.js"
16
+ }
15
17
}
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var should = require ( 'should' ) ;
4
+ var PROJECT_NAME = require ( '../package.json' ) . name ;
5
+ var loader = require ( '..' ) ;
6
+ var staticJson5 = "{name: 'test'}" ;
7
+
8
+ describe ( PROJECT_NAME , function ( ) {
9
+ it ( 'should export the loader' , function ( done ) {
10
+ should ( loader ) . be . type ( 'function' ) ;
11
+ done ( ) ;
12
+ } ) ;
13
+
14
+ it ( 'should export a default for es2015 support' , function ( done ) {
15
+ should . exist ( loader . default ) ;
16
+ should ( loader . default ) . be . type ( 'function' ) ;
17
+ done ( ) ;
18
+ } ) ;
19
+
20
+ it ( 'should convert to requires' , function ( done ) {
21
+ var content = loader . call ( { } , staticJson5 ) ;
22
+ should ( content ) . be . eql ( 'module.exports = {\n\t"name": "test"\n}' ) ;
23
+ done ( ) ;
24
+ } ) ;
25
+
26
+ it ( 'should fire cacheable' , function ( done ) {
27
+ var cacheable = function ( ) {
28
+ done ( ) ;
29
+ } ;
30
+ var content = loader . call ( { cacheable : cacheable } , staticJson5 ) ;
31
+ should ( content ) . be . eql ( 'module.exports = {\n\t"name": "test"\n}' ) ;
32
+ } ) ;
33
+
34
+ it ( 'should catch invalid JSON5' , function ( done ) {
35
+ var brokenJson5 = '{broken: json5}' ;
36
+ should ( function ( ) {
37
+ loader . call ( { } , brokenJson5 ) ;
38
+ } ) . throw ( 'Error using JSON5 parsing' ) ;
39
+ done ( ) ;
40
+ } ) ;
41
+ } ) ;
You can’t perform that action at this time.
0 commit comments