mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 21:04:16 +02:00
Replace prettier with stylistic, improve types, and add no-undef rule (#1975)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
This commit is contained in:
parent
6312a171e2
commit
a4428fd5be
59 changed files with 886 additions and 614 deletions
|
|
@ -82,7 +82,7 @@ function getMean(numbers) {
|
|||
}
|
||||
|
||||
function getMedianAverageDeviation(numbers, { median }) {
|
||||
const residuals = allDamage.map(d => Math.abs(d - median));
|
||||
const residuals = numbers.map(d => Math.abs(d - median));
|
||||
return getMedian(residuals);
|
||||
}
|
||||
|
||||
|
|
@ -98,8 +98,8 @@ function parseDamage(damage) {
|
|||
p.value.custom.enabled
|
||||
? p.value.custom.formula
|
||||
: [p.value.flatMultiplier ? `${p.value.flatMultiplier}${p.value.dice}` : 0, p.value.bonus ?? 0]
|
||||
.filter(p => !!p)
|
||||
.join('+')
|
||||
.filter(p => !!p)
|
||||
.join('+')
|
||||
)
|
||||
.join('+');
|
||||
return getExpectedDamage(formula);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import fs from 'fs';
|
|||
import path from 'path';
|
||||
import readline from 'readline';
|
||||
|
||||
console.log('Creates a foundry symlink in the base folder for type purposes\n');
|
||||
|
||||
const askQuestion = question => {
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
|
|
|
|||
20
tools/eslint.config.mjs
Normal file
20
tools/eslint.config.mjs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import globals from 'globals';
|
||||
import { defineConfig, globalIgnores } from 'eslint/config';
|
||||
import { stylisticRules } from '../eslint.config.mjs';
|
||||
import stylistic from '@stylistic/eslint-plugin';
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['foundry/**/*']),
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs}'],
|
||||
plugins: {
|
||||
'@stylistic': stylistic
|
||||
},
|
||||
languageOptions: { globals: globals.node },
|
||||
rules: {
|
||||
'no-undef': 'error',
|
||||
'no-unused-vars': 0,
|
||||
...stylisticRules
|
||||
}
|
||||
}
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue