upgrade prettier and run on all files

This commit is contained in:
Przemek Więch 2025-01-11 12:06:24 +01:00
parent 9cadda886e
commit 97c17d47af
9 changed files with 39 additions and 43 deletions

18
package-lock.json generated
View File

@ -67,7 +67,7 @@
"@typescript-eslint/parser": "^4.19.0",
"cypress": "^13.17.0",
"gh-pages": "^3.1.0",
"prettier": "^2.2.1",
"prettier": "^3.4.2",
"react-scripts": "^5.0.1",
"run-script-os": "^1.1.6",
"start-server-and-test": "^2.0.9",
@ -17416,15 +17416,15 @@
}
},
"node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=10.13.0"
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
@ -35609,9 +35609,9 @@
"dev": true
},
"prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true
},
"pretty-bytes": {

View File

@ -62,7 +62,7 @@
"@typescript-eslint/parser": "^4.19.0",
"cypress": "^13.17.0",
"gh-pages": "^3.1.0",
"prettier": "^2.2.1",
"prettier": "^3.4.2",
"react-scripts": "^5.0.1",
"run-script-os": "^1.1.6",
"start-server-and-test": "^2.0.9",

View File

@ -122,7 +122,10 @@ interface Arguments {
config: Config;
}
function getParamFromSearch(name: string, search: queryString.ParsedQuery<string>) {
function getParamFromSearch(
name: string,
search: queryString.ParsedQuery<string>,
) {
const value = search[name];
return typeof value === 'string' ? value : undefined;
}
@ -155,7 +158,8 @@ function getArguments(location: H.Location<any>): Arguments {
const windowSearch = queryString.parse(window.location.search);
sourceSpec = {
source: DataSourceEnum.WIKITREE,
authcode: getParam('authcode') || getParamFromSearch('authcode', windowSearch),
authcode:
getParam('authcode') || getParamFromSearch('authcode', windowSearch),
};
} else if (hash) {
sourceSpec = {
@ -591,4 +595,3 @@ export function App() {
</>
);
}

View File

@ -117,7 +117,10 @@ export function ConfigPanel(props: {
value="generation"
checked={props.config.color === ChartColors.COLOR_BY_GENERATION}
onClick={() =>
props.onChange({...props.config, color: ChartColors.COLOR_BY_GENERATION})
props.onChange({
...props.config,
color: ChartColors.COLOR_BY_GENERATION,
})
}
/>
</Form.Field>
@ -135,7 +138,10 @@ export function ConfigPanel(props: {
value="gender"
checked={props.config.color === ChartColors.COLOR_BY_SEX}
onClick={() =>
props.onChange({...props.config, color: ChartColors.COLOR_BY_SEX})
props.onChange({
...props.config,
color: ChartColors.COLOR_BY_SEX,
})
}
/>
</Form.Field>
@ -159,9 +165,7 @@ export function ConfigPanel(props: {
name="checkboxRadioGroup"
value="hide"
checked={props.config.id === Ids.HIDE}
onClick={() =>
props.onChange({...props.config, id: Ids.HIDE})
}
onClick={() => props.onChange({...props.config, id: Ids.HIDE})}
/>
</Form.Field>
<Form.Field className="no-margin">
@ -177,9 +181,7 @@ export function ConfigPanel(props: {
name="checkboxRadioGroup"
value="show"
checked={props.config.id === Ids.SHOW}
onClick={() =>
props.onChange({...props.config, id: Ids.SHOW})
}
onClick={() => props.onChange({...props.config, id: Ids.SHOW})}
/>
</Form.Field>
</Item.Content>
@ -202,9 +204,7 @@ export function ConfigPanel(props: {
name="checkboxRadioGroup"
value="hide"
checked={props.config.sex === Sex.HIDE}
onClick={() =>
props.onChange({...props.config, sex: Sex.HIDE})
}
onClick={() => props.onChange({...props.config, sex: Sex.HIDE})}
/>
</Form.Field>
<Form.Field className="no-margin">
@ -220,9 +220,7 @@ export function ConfigPanel(props: {
name="checkboxRadioGroup"
value="show"
checked={props.config.sex === Sex.SHOW}
onClick={() =>
props.onChange({...props.config, sex: Sex.SHOW})
}
onClick={() => props.onChange({...props.config, sex: Sex.SHOW})}
/>
</Form.Field>
</Item.Content>

View File

@ -887,4 +887,3 @@ export class WikiTreeDataSource implements DataSource<WikiTreeSourceSpec> {
}
}
}

View File

@ -4,7 +4,7 @@ import {
GedcomData,
getData,
getFileName,
getImageFileEntry
getImageFileEntry,
} from '../util/gedcom_util';
import {Events} from './events';
import {GedcomEntry} from 'parse-gedcom';

View File

@ -158,9 +158,7 @@ function eventSources(entry: GedcomEntry, gedcom: GedcomData): Source[] {
(subEntry) => 'TITL' === subEntry.tag,
);
const abbr = sourceEntry.tree.find(
(subEntry) => 'ABBR' === subEntry.tag,
);
const abbr = sourceEntry.tree.find((subEntry) => 'ABBR' === subEntry.tag);
const author = sourceEntry.tree.find(
(subEntry) => 'AUTH' === subEntry.tag,

View File

@ -58,8 +58,7 @@ function Contents() {
<li>
<ViewLink
params={{
url:
'https://chronoplexsoftware.com/myfamilytree/samples/The%20Kennedy%20Family.gdz',
url: 'https://chronoplexsoftware.com/myfamilytree/samples/The%20Kennedy%20Family.gdz',
}}
text="J. F. Kennedy"
/>{' '}
@ -72,8 +71,7 @@ function Contents() {
<li>
<ViewLink
params={{
url:
'https://webtreeprint.com/tp_downloader.php?path=famous_gedcoms/shakespeare.ged&file=shakespeare.ged',
url: 'https://webtreeprint.com/tp_downloader.php?path=famous_gedcoms/shakespeare.ged&file=shakespeare.ged',
}}
text="Shakespeare"
/>{' '}
@ -86,8 +84,8 @@ function Contents() {
<li>
<ViewLink
params={{
indi:
'Skłodowska-2', source: 'wikitree'
indi: 'Skłodowska-2',
source: 'wikitree',
}}
text="Maria Skłodowska-Curie"
/>{' '}
@ -180,4 +178,3 @@ export function Intro() {
</div>
);
}

View File

@ -289,8 +289,9 @@ export function getName(person: GedcomEntry): string | undefined {
export function getFileName(fileEntry: GedcomEntry): string | undefined {
const fileTitle = fileEntry?.tree.find((entry) => entry.tag === 'TITL')?.data;
const fileExtension = fileEntry?.tree.find((entry) => entry.tag === 'FORM')
?.data;
const fileExtension = fileEntry?.tree.find(
(entry) => entry.tag === 'FORM',
)?.data;
return fileTitle && fileExtension && fileTitle + '.' + fileExtension;
}