Skip to content

Commit

Permalink
Bump dependencies, see below
Browse files Browse the repository at this point in the history
- updates country-coder to v5.3.0 (for Sark)
- updates eslint to v9
  - This means I needed to upgrade to the more modern config file
  - Because import asserts with json are still a problem and we were only
    using this feature in the tests, I just switch the tests over to loading
    the fixtures using normal Node filesystem `fs.readFileSync` stuff
  • Loading branch information
bhousel committed Jul 17, 2024
1 parent a7503d8 commit af91e72
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
41 changes: 26 additions & 15 deletions .eslintrc → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": [
"eslint:recommended"
],
"rules": {
import js from '@eslint/js';
import globals from 'globals';

const common = {
rules: {
"dot-notation": "error",
"eqeqeq": ["error", "smart"],
"keyword-spacing": "error",
Expand Down Expand Up @@ -49,7 +41,7 @@
"no-unneeded-ternary": "error",
"no-unused-expressions": "error",
"no-unexpected-multiline": "error",
"no-unused-vars": "warn",
"no-unused-vars": ["warn", { "vars": "all", "args": "none", "caughtErrors": "none" }],
"no-void": "error",
"no-warning-comments": "warn",
"no-with": "error",
Expand All @@ -59,4 +51,23 @@
"space-unary-ops": "error",
"wrap-regex": "off"
}
}
};


export default [
js.configs.recommended,
common,
{
files: ['index.mjs'],
languageOptions: {
}
},
{
files: ['test/**/*.js'],
languageOptions: {
globals: {
...globals.node
}
}
}
];
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,22 @@
"build:browser": "esbuild ./index.mjs --platform=browser --format=iife --global-name=LocationConflation --bundle --sourcemap --outfile=./dist/location-conflation.iife.js",
"build:cjs": "esbuild ./index.mjs --platform=node --format=cjs --sourcemap --outfile=./dist/location-conflation.cjs",
"lint": "eslint index.mjs test/*.js",
"test": "run-s build test:node",
"test": "run-s lint build test:node",
"test:node": "c8 node --test test/"
},
"dependencies": {
"@aitodotai/json-stringify-pretty-compact": "^1.3.0",
"@mapbox/geojson-area": "^0.2.2",
"@rapideditor/country-coder": "^5.2.2",
"@rapideditor/country-coder": "^5.3.0",
"circle-to-polygon": "^2.2.0",
"geojson-precision": "^1.0.0",
"polyclip-ts": "~0.16.3"
"polyclip-ts": "~0.16.5"
},
"devDependencies": {
"c8": "^8.0.1",
"esbuild": "^0.19.10",
"eslint": "^8.56.0",
"c8": "^10.1.2",
"esbuild": "^0.23.0",
"eslint": "^9.7.0",
"globals": "^15.8.0",
"npm-run-all": "^4.1.5",
"shx": "^0.3.4"
},
Expand Down
3 changes: 2 additions & 1 deletion test/resolveLocation.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'node:fs';
import { test } from 'node:test';
import { strict as assert } from 'node:assert';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const features = JSON.parse(fs.readFileSync('test/fixtures/features.json', 'utf8'));
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features);
locoNS.strict = false;
Expand Down
3 changes: 2 additions & 1 deletion test/resolveLocationSet.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'node:fs';
import { test } from 'node:test';
import { strict as assert } from 'node:assert';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const features = JSON.parse(fs.readFileSync('test/fixtures/features.json', 'utf8'));
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features);
locoNS.strict = false;
Expand Down
3 changes: 2 additions & 1 deletion test/validateLocation.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'node:fs';
import { test } from 'node:test';
import { strict as assert } from 'node:assert';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const features = JSON.parse(fs.readFileSync('test/fixtures/features.json', 'utf8'));
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features);
locoNS.strict = false;
Expand Down
3 changes: 2 additions & 1 deletion test/validateLocationSet.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from 'node:fs';
import { test } from 'node:test';
import { strict as assert } from 'node:assert';
import { LocationConflation } from '../index.mjs';

import features from './fixtures/features.json' assert {type: 'json'};
const features = JSON.parse(fs.readFileSync('test/fixtures/features.json', 'utf8'));
const loco = new LocationConflation(features);
const locoNS = new LocationConflation(features);
locoNS.strict = false;
Expand Down

0 comments on commit af91e72

Please sign in to comment.