mirror of
https://github.com/acamarata/qibla.git
synced 2026-06-30 19:04:28 +00:00
chore: adopt shared config packages (tsconfig, eslint, prettier)
This commit is contained in:
parent
d0a04896b9
commit
1546cd5c71
6 changed files with 716 additions and 1262 deletions
|
|
@ -1 +0,0 @@
|
|||
{}
|
||||
|
|
@ -1,10 +1,16 @@
|
|||
import eslint from "@eslint/js";
|
||||
import tseslint from "typescript-eslint";
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
import { typescript } from '@acamarata/eslint-config';
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
export default [
|
||||
{
|
||||
ignores: ["dist/", "*.cjs"],
|
||||
plugins: { '@typescript-eslint': tsPlugin },
|
||||
languageOptions: { parser: tsParser },
|
||||
},
|
||||
);
|
||||
...typescript,
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
ignores: ['dist/', 'node_modules/', '*.cjs'],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@
|
|||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@acamarata/eslint-config": "^0.1.0",
|
||||
"@acamarata/prettier-config": "^0.1.0",
|
||||
"@acamarata/tsconfig": "^0.1.0",
|
||||
"@eslint/js": "^9.27.0",
|
||||
"@types/node": "^22.15.3",
|
||||
"eslint": "^9.27.0",
|
||||
|
|
@ -78,5 +81,6 @@
|
|||
"typescript-eslint": "^8.32.1"
|
||||
},
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@10.11.1"
|
||||
"packageManager": "pnpm@10.11.1",
|
||||
"prettier": "@acamarata/prettier-config"
|
||||
}
|
||||
|
|
|
|||
1934
pnpm-lock.yaml
1934
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -60,7 +60,9 @@ export function qiblaAngle(lat: number, lng: number): number {
|
|||
* @returns Two-letter compass abbreviation (N, NE, E, SE, S, SW, W, NW).
|
||||
*/
|
||||
export function compassDir(bearing: number): CompassAbbr {
|
||||
return COMPASS_ABBR[Math.round(bearing / 45) % 8];
|
||||
// Non-null assertion: index is always 0-7 (Math.round(bearing/45) % 8), which is within COMPASS_ABBR bounds.
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
return COMPASS_ABBR[Math.round(bearing / 45) % 8]!;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -70,7 +72,9 @@ export function compassDir(bearing: number): CompassAbbr {
|
|||
* @returns Full direction name (North, Northeast, etc.).
|
||||
*/
|
||||
export function compassName(bearing: number): CompassName {
|
||||
return COMPASS_NAMES[Math.round(bearing / 45) % 8];
|
||||
// Non-null assertion: index is always 0-7 (Math.round(bearing/45) % 8), which is within COMPASS_NAMES bounds.
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
return COMPASS_NAMES[Math.round(bearing / 45) % 8]!;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,16 +1,9 @@
|
|||
{
|
||||
"extends": "@acamarata/tsconfig/tsconfig.library.json",
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"esModuleInterop": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"types": ["node"]
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue