Skip to content

Commit

Permalink
update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Dec 3, 2024
1 parent 8e69621 commit 7d3a7cb
Show file tree
Hide file tree
Showing 11 changed files with 6,365 additions and 6,393 deletions.
1 change: 1 addition & 0 deletions client/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ import { createContext } from 'react';
import type { Output } from './types';

export const DataContext = createContext(undefined as never as Output);
DataContext.displayName = 'DataContext';
2 changes: 0 additions & 2 deletions client/src/pages/LayerInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ export const LayerInfo: React.FC = () => {
</td>
<td>{type}</td>
<td>{stats && formatNumber(total(stats))}</td>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label -- bug with the rule */}
<td>
<Tags type={type} data={data} />
</td>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label -- bug with the rule */}
<td>
<Tags type={type} data={data} acceptTags />
</td>
Expand Down
1 change: 0 additions & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies */
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'eslint-config-kyle';
19 changes: 3 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"scripts": {
"start": "node --import tsx --env-file=.env.local src/main",
"lint": "eslint --ext .ts,.tsx,.js --ignore-path .gitignore . && tsc",
"lint": "eslint . && tsc",
"test": "vitest"
},
"dependencies": {
Expand All @@ -19,25 +19,12 @@
"devDependencies": {
"@types/geojson": "^7946.0.14",
"@types/node": "^20.14.0",
"eslint": "^8.56.0",
"eslint-config-kyle": "^22.4.0",
"eslint": "^9.16.0",
"eslint-config-kyle": "^25.0.0",
"osm-api": "^2.1.1",
"tsx": "^4.11.2",
"vitest": "^1.6.0"
},
"eslintConfig": {
"extends": "kyle",
"rules": {
"camelcase": 0,
"no-param-reassign": 0,
"@typescript-eslint/no-dynamic-delete": 0
},
"settings": {
"jest": {
"version": 29
}
}
},
"prettier": "eslint-config-kyle/prettier",
"engineStrict": true,
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions src/api/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { promises as fs } from 'node:fs';
import { project } from '../../taginfo.json' assert { type: 'json' };
import taginfo from '../../taginfo.json' assert { type: 'json' };
import { configRawPath } from '../core/constants.js';
import type { Config } from '../core/types/general.def.js';
import { parseJsonc } from '../core/jsonc.js';

const url = project.project_url.replace(
const url = taginfo.project.project_url.replace(
'github.com',
'raw.githubusercontent.com/wiki',
);
Expand Down
1 change: 0 additions & 1 deletion src/conflate/applyCustomMerges.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable unicorn/prevent-abbreviations -- refs is a common OSM term */
import { distanceBetween } from '../core/geo.js';
import type { TransformedNzgb } from '../core/types/nzgb.def.js';
import type { TransformedOsm } from '../core/types/osm.def.js';
Expand Down
4 changes: 3 additions & 1 deletion src/conflate/compareFeatures/exceptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ export function isUnofficialAndOsmHasMacrons(
osm: OSMFeature,
config: Config,
) {
const ref = osm.tags['ref:linz:place_id']!;

// for official names, an inconsistency is only
// acceptable if there's an override for this ref.
const shouldAllowInconsistency = nzgb.official
? osm.tags['ref:linz:place_id']! in config.allowInconsistentDiacritics
? ref in config.allowInconsistentDiacritics
: true;

return (
Expand Down
1 change: 0 additions & 1 deletion src/conflate/findBestWikidata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable unicorn/prevent-abbreviations -- refs is a common OSM term */
import type { NZGBFeature } from '../core/types/nzgb.def.js';
import type { WikidataItem } from '../core/types/wikidata.def.js';

Expand Down
1 change: 0 additions & 1 deletion src/transformer/nzgb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ async function tempToFinal(temp: TempObject, config: Config) {
return out;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function transformNzgb(_: number, config: Config) {
console.log('Preprocessing NZGB data...');
const temp = await csvToTemp();
Expand Down
Loading

0 comments on commit 7d3a7cb

Please sign in to comment.