Skip to content

Commit 6d0748b

Browse files
authored
fix: actually check formatting rather than fixing it silently (#278)
`eslint --fix` returns an exit code 0 even when fixing things. To format the js files, use `npm run format` instead of previously `npm run lint`.
1 parent 506782f commit 6d0748b

17 files changed

+54
-38
lines changed

extensions/aerial-photo/tests/aerial_photo_collection.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.mjs';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/aerial-photo/tests/aerial_photo_item.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.mjs';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/camera/tests/camera_collection.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/camera/tests/camera_item.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/film/tests/film_collection.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/film/tests/film_item.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/historical-imagery/tests/historical-imagery_collection.test.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -98,7 +99,7 @@ o.spec('Historical Imagery Extension Collection', () => {
9899
// given
99100
for (const role of ['producer', 'licensor', 'processor', 'host']) {
100101
const example = JSON.parse(await fs.readFile(examplePath));
101-
example.providers = example.providers.filter((provider) => !role in provider.roles);
102+
example.providers = example.providers.filter((provider) => (!role) in provider.roles);
102103

103104
// when
104105
let valid = validate(example);

extensions/historical-imagery/tests/historical-imagery_item.test.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));

extensions/linz/tests/linz_collection.test.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import o from 'ospec';
21
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
3+
import o from 'ospec';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6+
67
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -404,7 +405,7 @@ o.spec('LINZ collection', () => {
404405
// given
405406
for (const role of ['producer', 'licensor']) {
406407
const example = JSON.parse(await fs.readFile(examplePath));
407-
example.providers = example.providers.filter((provider) => !role in provider.roles);
408+
example.providers = example.providers.filter((provider) => (!role) in provider.roles);
408409

409410
// when
410411
let valid = validate(example);
@@ -423,7 +424,7 @@ o.spec('LINZ collection', () => {
423424
// given
424425
for (const role of ['manager', 'custodian']) {
425426
const example = JSON.parse(await fs.readFile(examplePath));
426-
example['linz:providers'] = example['linz:providers'].filter((provider) => !role in provider.roles);
427+
example['linz:providers'] = example['linz:providers'].filter((provider) => (!role) in provider.roles);
427428

428429
// when
429430
let valid = validate(example);

extensions/linz/tests/linz_item.test.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import Ajv from 'ajv';
2+
import { promises as fs } from 'fs';
13
import o from 'ospec';
2-
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
34
import { dirname, join } from 'path';
45
import { fileURLToPath } from 'url';
5-
import { promises as fs } from 'fs';
6-
import Ajv from 'ajv';
6+
7+
import { AjvOptions, DefaultTimeoutMillis } from '../../../validation.js';
78

89
const __dirname = dirname(fileURLToPath(import.meta.url));
910
const schemaPath = join(__dirname, '..', 'schema.json');

0 commit comments

Comments
 (0)