Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Commit eb34322

Browse files
committed
⬆️ upgrade dependecies
1 parent d1916ab commit eb34322

File tree

4 files changed

+1230
-888
lines changed

4 files changed

+1230
-888
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ module.exports = {
1111
// cwdからのpath
1212
project: "./tsconfig.json",
1313
},
14-
rules: {},
14+
rules: {
15+
"@typescript-eslint/ban-ts-ignore": "warn",
16+
},
1517
env: {
1618
node: true,
1719
},

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@
1010
"test": "jest"
1111
},
1212
"dependencies": {
13-
"@babel/core": "^7.4.5",
14-
"@babel/types": "^7.4.4"
13+
"@babel/core": "^7.7.7",
14+
"@babel/types": "^7.7.4"
1515
},
1616
"devDependencies": {
17-
"@babel/cli": "^7.4.4",
17+
"@babel/cli": "^7.7.7",
1818
"@types/babel-core": "^6.25.6",
1919
"@types/babel-types": "^7.0.7",
20-
"@types/jest": "^24.0.15",
21-
"@typescript-eslint/eslint-plugin": "^1.11.0",
22-
"@typescript-eslint/parser": "^1.11.0",
23-
"babel-plugin-tester": "^6.4.0",
24-
"eslint": "^6.0.1",
25-
"eslint-config-prettier": "^6.0.0",
26-
"husky": "^2.7.0",
27-
"jest": "^24.8.0",
28-
"lint-staged": "^8.2.1",
29-
"prettier": "^1.18.2",
30-
"ts-jest": "^24.0.2",
31-
"typescript": "^3.5.2"
20+
"@types/jest": "^24.0.25",
21+
"@typescript-eslint/eslint-plugin": "^2.14.0",
22+
"@typescript-eslint/parser": "^2.14.0",
23+
"babel-plugin-tester": "^8.0.1",
24+
"eslint": "^6.8.0",
25+
"eslint-config-prettier": "^6.9.0",
26+
"husky": "^3.1.0",
27+
"jest": "^24.9.0",
28+
"lint-staged": "^9.5.0",
29+
"prettier": "^1.19.1",
30+
"ts-jest": "^24.2.0",
31+
"typescript": "^3.7.4"
3232
},
3333
"jest": {
3434
"transform": {

test/visitors/object_expression.test.ts

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,46 @@ pluginTester({
99
pluginOptions: {
1010
minJSONStringSize: 0
1111
},
12-
code: `const a = {};`,
13-
output: `const a = JSON.parse('{}');`
12+
code: `const a = {}`,
13+
output: `const a = JSON.parse('{}')`
1414
}, {
1515
title: 'respects minJSONStringSize (default : 1024)',
16-
code: `const a = { b: 1, c: 2 };`,
16+
code: `const a = { b: 1, c: 2 }`,
1717
output: `
1818
const a = {
1919
b: 1,
2020
c: 2
21-
};
21+
}
2222
`
2323
}, {
2424
title: 'respects minJSONStringSize',
2525
pluginOptions: {
2626
minJSONStringSize: 15
2727
},
28-
code: `const a = { b: 1, c: 2 };`,
28+
code: `const a = { b: 1, c: 2 }`,
2929
output: `
3030
const a = {
3131
b: 1,
3232
c: 2
33-
};
33+
}
3434
`
3535
}, {
3636
title: 'respects minJSONStringSize',
3737
pluginOptions: {
3838
minJSONStringSize: 0
3939
},
40-
code: `const a = { b: 1, c: 2 };`,
40+
code: `const a = { b: 1, c: 2 }`,
4141
output: `
42-
const a = JSON.parse('{"b":1,"c":2}');
42+
const a = JSON.parse('{"b":1,"c":2}')
4343
`
4444
}, {
4545
title: 'does not convert objects which include the spread syntax',
46-
code: `const a = { ...a, b: 1 };`,
46+
code: `const a = { ...a, b: 1 }`,
4747
pluginOptions: {
4848
minJSONStringSize: 0
4949
},
5050
output: `
51-
const a = { ...a,
52-
b: 1
53-
};
51+
const a = { ...a, b: 1 }
5452
`
5553
}, {
5654
title: 'does not convert objects which include the object method',
@@ -60,145 +58,145 @@ pluginTester({
6058
code: `
6159
const a = {
6260
method(arg) {
63-
return arg;
61+
return arg
6462
},
6563
b: 1
66-
};
64+
}
6765
`,
6866
output: `
6967
const a = {
7068
method(arg) {
71-
return arg;
69+
return arg
7270
},
7371
7472
b: 1
75-
};
73+
}
7674
`
7775
}, {
7876
title: 'does not convert objects which include the invalid value',
7977
pluginOptions: {
8078
minJSONStringSize: 0
8179
},
82-
code: `const a = { b: () => console.log("b") };`,
80+
code: `const a = { b: () => console.log('b') }`,
8381
output: `
8482
const a = {
85-
b: () => console.log("b")
86-
};
83+
b: () => console.log('b')
84+
}
8785
`
8886
}, {
8987
title: 'does not convert objects which have computed property names',
9088
pluginOptions: {
9189
minJSONStringSize: 0
9290
},
93-
code: `const a = { b : "b_val", ["c"]: "c_val" };`,
91+
code: `const a = { b : 'b_val', ['c']: 'c_val' }`,
9492
output: `
9593
const a = {
96-
b: "b_val",
97-
["c"]: "c_val"
98-
};
94+
b: 'b_val',
95+
['c']: 'c_val'
96+
}
9997
`
10098
}, {
10199
title: 'does not convert objects which have double quotes in string',
102100
pluginOptions: {
103101
minJSONStringSize: 0
104102
},
105-
code: `const a = { b: 'ab\"c' };`,
103+
code: `const a = { b: 'ab\"c' }`,
106104
output: `
107105
const a = {
108106
b: 'ab\"c'
109-
};
107+
}
110108
`
111109
}, {
112110
title: 'does not convert objects which have double quotes in string',
113111
pluginOptions: {
114112
minJSONStringSize: 0
115113
},
116-
code: `const a = { b: 'ab"c' };`,
114+
code: `const a = { b: 'ab"c' }`,
117115
output: `
118116
const a = {
119117
b: 'ab"c'
120-
};
118+
}
121119
`
122120
}, {
123121
title: 'does not convert objects which have invalid numeric key',
124122
pluginOptions: {
125123
minJSONStringSize: 0
126124
},
127-
code: `const a ={ 77777777777777777.1: "foo" };`,
125+
code: `const a ={ 77777777777777777.1: 'foo' }`,
128126
output: `
129127
const a = {
130-
77777777777777777.1: "foo"
131-
};
128+
77777777777777777.1: 'foo'
129+
}
132130
`
133131
}, {
134132
title: 'string',
135133
pluginOptions: {
136134
minJSONStringSize: 0
137135
},
138-
code: `const a = { b: "b_val" };`,
139-
output: `const a = JSON.parse('{"b":"b_val"}');`
136+
code: `const a = { b: "b_val" }`,
137+
output: `const a = JSON.parse('{"b":"b_val"}')`
140138
}, {
141139
title: 'string (include single quote)',
142140
pluginOptions: {
143141
minJSONStringSize: 0
144142
},
145-
code: `const a = { b: "'abc'" };`,
146-
output: `const a = JSON.parse('{"b":"\\'abc\\'"}');`
143+
code: `const a = { b: "'abc'" }`,
144+
output: `const a = JSON.parse('{"b":"\\'abc\\'"}')`
147145
}, {
148146
title: 'string (include single quote)',
149147
pluginOptions: {
150148
minJSONStringSize: 0
151149
},
152-
code: `const a = { b: "ab\'c" };`,
153-
output: `const a = JSON.parse('{"b":"ab\\'c"}');`
150+
code: `const a = { b: "ab\'c" }`,
151+
output: `const a = JSON.parse('{"b":"ab\\'c"}')`
154152
}, {
155153
title: 'number',
156154
pluginOptions: {
157155
minJSONStringSize: 0
158156
},
159-
code: `const a = { b: 1 };`,
160-
output: `const a = JSON.parse('{"b":1}');`
157+
code: `const a = { b: 1 }`,
158+
output: `const a = JSON.parse('{"b":1}')`
161159
}, {
162160
title: 'null',
163161
pluginOptions: {
164162
minJSONStringSize: 0
165163
},
166-
code: `const a = { b: null };`,
167-
output: `const a = JSON.parse('{"b":null}');`
164+
code: `const a = { b: null }`,
165+
output: `const a = JSON.parse('{"b":null}')`
168166
}, {
169167
title: 'boolean',
170168
pluginOptions: {
171169
minJSONStringSize: 0
172170
},
173-
code: `const a = { b: false };`,
174-
output: `const a = JSON.parse('{"b":false}');`
171+
code: `const a = { b: false }`,
172+
output: `const a = JSON.parse('{"b":false}')`
175173
}, {
176174
title: 'Array',
177175
pluginOptions: {
178176
minJSONStringSize: 0
179177
},
180-
code: `const a = { b: [1, 'b_val', null] };`,
181-
output: `const a = JSON.parse('{"b":[1,"b_val",null]}');`
178+
code: `const a = { b: [1, 'b_val', null] }`,
179+
output: `const a = JSON.parse('{"b":[1,"b_val",null]}')`
182180
}, {
183181
title: 'Nested Array',
184182
pluginOptions: {
185183
minJSONStringSize: 0
186184
},
187-
code: `const a = { b: [1, ['b_val', { a: 1 }], null] };`,
188-
output: `const a = JSON.parse('{"b":[1,["b_val",{"a":1}],null]}');`
185+
code: `const a = { b: [1, ['b_val', { a: 1 }], null] }`,
186+
output: `const a = JSON.parse('{"b":[1,["b_val",{"a":1}],null]}')`
189187
}, {
190188
title: 'Object',
191189
pluginOptions: {
192190
minJSONStringSize: 0
193191
},
194-
code: `const a = { b: { c: 1 } };`,
195-
output: `const a = JSON.parse('{"b":{"c":1}}');`
192+
code: `const a = { b: { c: 1 } }`,
193+
output: `const a = JSON.parse('{"b":{"c":1}}')`
196194
}, {
197195
title: 'Object (having numeric keys)',
198196
pluginOptions: {
199197
minJSONStringSize: 0
200198
},
201-
code: `const a = { 1: "123", 23: 45, b: "b_val" };`,
202-
output: `const a = JSON.parse('{"1":"123","23":45,"b":"b_val"}');`
199+
code: `const a = { 1: "123", 23: 45, b: "b_val" }`,
200+
output: `const a = JSON.parse('{"1":"123","23":45,"b":"b_val"}')`
203201
},]
204202
})

0 commit comments

Comments
 (0)