Skip to content

Commit e457105

Browse files
committed
Get eslint running with typescript
1 parent be18dc7 commit e457105

4 files changed

Lines changed: 17 additions & 19 deletions

File tree

.eslintrc.cjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module.exports = {
2-
env: {
3-
browser: true,
4-
es2021: true,
5-
node: true
6-
},
7-
extends: 'eslint:recommended',
2+
root: true,
3+
env: { es2023: true },
4+
parser: '@typescript-eslint/parser',
85
parserOptions: {
96
ecmaVersion: 'latest',
10-
sourceType: 'module'
7+
sourceType: 'module',
8+
project: ['./tsconfig.json']
119
},
10+
plugins: ['@typescript-eslint'],
11+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
1212
rules: {
13-
indent: ['error', 2],
14-
'linebreak-style': ['error', 'unix'],
15-
quotes: ['error', 'single'],
16-
semi: ['error', 'never']
17-
}
13+
'@typescript-eslint/no-explicit-any': 'off',
14+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
15+
'no-extra-semi': 'warn'
16+
},
17+
ignorePatterns: ['dist/', 'node_modules/']
1818
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"devDependencies": {
1919
"@types/mocha": "^10.0.10",
2020
"@types/node": "^20.10.6",
21+
"@typescript-eslint/eslint-plugin": "^7.0.0",
22+
"@typescript-eslint/parser": "^7.0.0",
2123
"c8": "^7.11.3",
2224
"eslint": "^8.18.0",
2325
"mocha": "^10.0.0",

src/astronomy/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const astro = (time: Date): AstroData => {
162162
// in the more convenient unit of degrees per hour.
163163
const dTdHour = 1 / (24 * 365.25 * 100)
164164
Object.keys(polynomials).forEach((name) => {
165-
;(result as any)[name] = {
165+
(result as any)[name] = {
166166
value: modulus(polynomial(polynomials[name], T(time)), 360.0),
167167
speed: derivativePolynomial(polynomials[name], T(time)) * dTdHour
168168
}

src/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import harmonics from './harmonics/index.js'
22
import type { HarmonicConstituent } from './harmonics/index.js'
3-
import type {
4-
TimelinePoint,
5-
Extreme,
6-
ExtremesOptions
7-
} from './harmonics/prediction.js'
3+
import type { TimelinePoint, Extreme } from './harmonics/prediction.js'
84

95
export interface TidePredictionOptions {
106
phaseKey?: string
@@ -53,7 +49,7 @@ const tidePredictionFactory = (
5349
if (typeof options !== 'undefined') {
5450
Object.keys(harmonicsOptions).forEach((key) => {
5551
if (typeof options[key as keyof TidePredictionOptions] !== 'undefined') {
56-
;(harmonicsOptions as any)[key] =
52+
(harmonicsOptions as any)[key] =
5753
options[key as keyof TidePredictionOptions]
5854
}
5955
})

0 commit comments

Comments
 (0)