Skip to content

Commit 9f1b74b

Browse files
committed
chore(lints): double quotes issues
1 parent 8443f69 commit 9f1b74b

File tree

10 files changed

+35
-36
lines changed

10 files changed

+35
-36
lines changed

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export default tseslint.config([
3939
"@typescript-eslint/no-require-imports": "off",
4040
"@typescript-eslint/no-unused-vars": "off",
4141
"linebreak-style": ["error", process.platform === "win32" ? "windows" : "unix"],
42-
quotes: ["error", "double"],
4342
semi: ["error", "always"],
4443
"@typescript-eslint/ban-ts-comment": "off",
4544
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class SwaggerParser extends $RefParser {
4444
if (schema.swagger) {
4545
if (typeof schema.swagger === "number") {
4646
// This is a very common mistake, so give a helpful error message
47-
throw new SyntaxError("Swagger version number must be a string (e.g. \"2.0\") not a number.");
47+
throw new SyntaxError('Swagger version number must be a string (e.g. "2.0") not a number.');
4848
} else if (schema.info && typeof schema.info.version === "number") {
4949
// This is a very common mistake, so give a helpful error message
50-
throw new SyntaxError("API version number must be a string (e.g. \"1.0.0\") not a number.");
50+
throw new SyntaxError('API version number must be a string (e.g. "1.0.0") not a number.');
5151
} else if (schema.swagger !== "2.0") {
5252
throw new SyntaxError(`Unrecognized Swagger version: ${schema.swagger}. Expected 2.0`);
5353
}
@@ -62,10 +62,10 @@ class SwaggerParser extends $RefParser {
6262
}
6363
} else if (typeof schema.openapi === "number") {
6464
// This is a very common mistake, so give a helpful error message
65-
throw new SyntaxError("Openapi version number must be a string (e.g. \"3.0.0\") not a number.");
65+
throw new SyntaxError('Openapi version number must be a string (e.g. "3.0.0") not a number.');
6666
} else if (schema.info && typeof schema.info.version === "number") {
6767
// This is a very common mistake, so give a helpful error message
68-
throw new SyntaxError("API version number must be a string (e.g. \"1.0.0\") not a number.");
68+
throw new SyntaxError('API version number must be a string (e.g. "1.0.0") not a number.');
6969
} else if (supportedVersions.indexOf(schema.openapi) === -1) {
7070
throw new SyntaxError(
7171
`Unsupported OpenAPI version: ${schema.openapi}. ` +

test/specs/circular/circular.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe("API with circular (recursive) $refs", () => {
5656
expect(api.definitions.child.properties.parents.items).to.equal(api.definitions.parent);
5757
});
5858

59-
it("should not dereference circular $refs if \"options.dereference.circular\" is \"ignore\"", async () => {
59+
it('should not dereference circular $refs if "options.dereference.circular" is "ignore"', async () => {
6060
let parser = new SwaggerParser();
6161
const api = await parser.validate(path.rel("specs/circular/circular.yaml"), {
6262
dereference: { circular: "ignore" },
@@ -67,7 +67,7 @@ describe("API with circular (recursive) $refs", () => {
6767
expect(api.paths["/pet"].get.responses["200"].schema).to.equal(api.definitions.pet);
6868
});
6969

70-
it("should fail validation if \"options.dereference.circular\" is false", async () => {
70+
it('should fail validation if "options.dereference.circular" is false', async () => {
7171
let parser = new SwaggerParser();
7272

7373
try {

test/specs/invalid/invalid.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe("Invalid APIs (can't be parsed)", () => {
5252
helper.shouldNotGetCalled();
5353
} catch (err) {
5454
expect(err).to.be.an.instanceOf(SyntaxError);
55-
expect(err.message).to.equal("Swagger version number must be a string (e.g. \"2.0\") not a number.");
55+
expect(err.message).to.equal('Swagger version number must be a string (e.g. "2.0") not a number.');
5656
}
5757
});
5858

@@ -62,7 +62,7 @@ describe("Invalid APIs (can't be parsed)", () => {
6262
helper.shouldNotGetCalled();
6363
} catch (err) {
6464
expect(err).to.be.an.instanceOf(SyntaxError);
65-
expect(err.message).to.equal("API version number must be a string (e.g. \"1.0.0\") not a number.");
65+
expect(err.message).to.equal('API version number must be a string (e.g. "1.0.0") not a number.');
6666
}
6767
});
6868
});

test/specs/real-world/known-errors.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ function getKnownApiErrors() {
128128
},
129129
{
130130
api: "github.com",
131-
error: "Token \"0\" does not exist",
131+
error: 'Token "0" does not exist',
132132
whatToDo: "ignore",
133133
},
134134
{
135135
api: "github.com",
136-
error: "Token \"expires_at\" does not exist",
136+
error: 'Token "expires_at" does not exist',
137137
whatToDo: "ignore",
138138
},
139139

@@ -169,7 +169,7 @@ function getKnownApiErrors() {
169169

170170
{
171171
api: "personio.de",
172-
error: "Token \"comment\" does not exist",
172+
error: 'Token "comment" does not exist',
173173
whatToDo: "ignore",
174174
},
175175

@@ -182,12 +182,12 @@ function getKnownApiErrors() {
182182

183183
{
184184
api: "rebilly.com",
185-
error: "Token \"feature\" does not exist",
185+
error: 'Token "feature" does not exist',
186186
whatToDo: "ignore",
187187
},
188188
{
189189
api: "statsocial.com",
190-
error: "Token \"18_24\" does not exist",
190+
error: 'Token "18_24" does not exist',
191191
whatToDo: "ignore",
192192
},
193193
{
@@ -215,7 +215,7 @@ function getKnownApiErrors() {
215215
},
216216
{
217217
api: "viator.com",
218-
error: "Token \"pas\" does not exist",
218+
error: 'Token "pas" does not exist',
219219
whatToDo: "ignore",
220220
},
221221
{

test/specs/unknown/dereferenced.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
schema: {
3030
type: "file",
3131
default:
32-
"<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <style>\n html {\n color: #888;\n font-family: sans-serif;\n height: 100%;\n width: 100%;\n }\n </style>\n</head>\n<body>\n <h1>Hello World</h1>\n</body>\n</html>\n",
32+
'<!doctype html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <style>\n html {\n color: #888;\n font-family: sans-serif;\n height: 100%;\n width: 100%;\n }\n </style>\n</head>\n<body>\n <h1>Hello World</h1>\n</body>\n</html>\n',
3333
},
3434
},
3535
},

test/specs/unknown/parsed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = {
7676

7777
text: "Hello\nWorld\n",
7878

79-
html: "<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <style>\n html {\n color: #888;\n font-family: sans-serif;\n height: 100%;\n width: 100%;\n }\n </style>\n</head>\n<body>\n <h1>Hello World</h1>\n</body>\n</html>\n",
79+
html: '<!doctype html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <style>\n html {\n color: #888;\n font-family: sans-serif;\n height: 100%;\n width: 100%;\n }\n </style>\n</head>\n<body>\n <h1>Hello World</h1>\n</body>\n</html>\n',
8080

8181
binary: {
8282
type: "Buffer",

test/specs/validate-schema/validate-schema.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,24 @@ describe("Invalid APIs (Swagger 2.0 schema validation)", () => {
4242
file: "invalid-param-location.yaml",
4343
},
4444
{
45-
name: "\"file\" type used for non-formData param",
45+
name: '"file" type used for non-formData param',
4646
valid: false,
4747
file: "file-header-param.yaml",
4848
},
4949
{
50-
name: "\"file\" type used for body param",
50+
name: '"file" type used for body param',
5151
valid: false,
5252
file: "file-body-param.yaml",
5353
error:
5454
"Validation failed. /paths/users/{username}/profile/image/post/parameters/image has an invalid type (file)",
5555
},
5656
{
57-
name: "\"multi\" header param",
57+
name: '"multi" header param',
5858
valid: false,
5959
file: "multi-header-param.yaml",
6060
},
6161
{
62-
name: "\"multi\" path param",
62+
name: '"multi" path param',
6363
valid: false,
6464
file: "multi-path-param.yaml",
6565
},
@@ -89,23 +89,23 @@ describe("Invalid APIs (Swagger 2.0 schema validation)", () => {
8989
file: "ref-to-invalid-path.yaml",
9090
},
9191
{
92-
name: "Schema with \"allOf\"",
92+
name: 'Schema with "allOf"',
9393
valid: true,
9494
file: "allof.yaml",
9595
},
9696
{
97-
name: "Schema with \"anyOf\"",
97+
name: 'Schema with "anyOf"',
9898
valid: false,
9999
file: "anyof.yaml",
100100
},
101101
{
102-
name: "Schema with \"oneOf\"",
102+
name: 'Schema with "oneOf"',
103103
valid: false,
104104
file: "oneof.yaml",
105105
},
106106
];
107107

108-
it("should pass validation if \"options.validate.schema\" is false", async () => {
108+
it('should pass validation if "options.validate.schema" is false', async () => {
109109
let invalid = tests[0];
110110
expect(invalid.valid).to.equal(false);
111111

test/specs/validate-spec/validate-spec.spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe("Invalid APIs (Swagger 2.0 specification validation)", () => {
5454
valid: false,
5555
file: "path-param-no-placeholder.yaml",
5656
error:
57-
"Validation failed. /paths/users/{username}/post has a path parameter named \"foo\", but there is no corresponding {foo} in the path string",
57+
'Validation failed. /paths/users/{username}/post has a path parameter named "foo", but there is no corresponding {foo} in the path string',
5858
},
5959
{
6060
name: "path placeholder with no param",
@@ -79,42 +79,42 @@ describe("Invalid APIs (Swagger 2.0 specification validation)", () => {
7979
name: "array param without items",
8080
valid: false,
8181
file: "array-no-items.yaml",
82-
error: "Validation failed. /paths/users/get/parameters/tags is an array, so it must include an \"items\" schema",
82+
error: 'Validation failed. /paths/users/get/parameters/tags is an array, so it must include an "items" schema',
8383
},
8484
{
8585
name: "array body param without items",
8686
valid: false,
8787
file: "array-body-no-items.yaml",
88-
error: "Validation failed. /paths/users/post/parameters/people is an array, so it must include an \"items\" schema",
88+
error: 'Validation failed. /paths/users/post/parameters/people is an array, so it must include an "items" schema',
8989
},
9090
{
9191
name: "array response header without items",
9292
valid: false,
9393
file: "array-response-header-no-items.yaml",
9494
error:
95-
"Validation failed. /paths/users/get/responses/default/headers/Last-Modified is an array, so it must include an \"items\" schema",
95+
'Validation failed. /paths/users/get/responses/default/headers/Last-Modified is an array, so it must include an "items" schema',
9696
},
9797
{
98-
name: "\"file\" param without \"consumes\"",
98+
name: '"file" param without "consumes"',
9999
valid: false,
100100
file: "file-no-consumes.yaml",
101101
error:
102102
"Validation failed. /paths/users/{username}/profile/image/post has a file parameter, so it must consume multipart/form-data or application/x-www-form-urlencoded",
103103
},
104104
{
105-
name: "\"file\" param with invalid \"consumes\"",
105+
name: '"file" param with invalid "consumes"',
106106
valid: false,
107107
file: "file-invalid-consumes.yaml",
108108
error:
109109
"Validation failed. /paths/users/{username}/profile/image/post has a file parameter, so it must consume multipart/form-data or application/x-www-form-urlencoded",
110110
},
111111
{
112-
name: "\"file\" param with vendor specific form-data \"consumes\"",
112+
name: '"file" param with vendor specific form-data "consumes"',
113113
valid: true,
114114
file: "file-vendor-specific-consumes-formdata.yaml",
115115
},
116116
{
117-
name: "\"file\" param with vendor specific urlencoded \"consumes\"",
117+
name: '"file" param with vendor specific urlencoded "consumes"',
118118
valid: true,
119119
file: "file-vendor-specific-consumes-urlencoded.yaml",
120120
},
@@ -147,7 +147,7 @@ describe("Invalid APIs (Swagger 2.0 specification validation)", () => {
147147
valid: false,
148148
file: "array-response-body-no-items.yaml",
149149
error:
150-
"Validation failed. /paths/users/get/responses/200/schema is an array, so it must include an \"items\" schema",
150+
'Validation failed. /paths/users/get/responses/200/schema is an array, so it must include an "items" schema',
151151
},
152152
{
153153
name: "only validate required properties on objects",
@@ -156,7 +156,7 @@ describe("Invalid APIs (Swagger 2.0 specification validation)", () => {
156156
},
157157
];
158158

159-
it("should pass validation if \"options.validate.spec\" is false", async () => {
159+
it('should pass validation if "options.validate.spec" is false', async () => {
160160
let invalid = tests[0];
161161
expect(invalid.valid).to.equal(false);
162162

test/utils/path.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function filesystemPathHelpers() {
8080
*/
8181
function urlPathHelpers() {
8282
// Get the URL of the "test" directory
83-
let filename = document.querySelector("script[src*=\"/fixtures/\"]").src;
83+
let filename = document.querySelector('script[src*="/fixtures/"]').src;
8484
let testsDir = filename.substr(0, filename.indexOf("/fixtures/")) + "/";
8585

8686
/**

0 commit comments

Comments
 (0)