Skip to content

Commit

Permalink
refactor: sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bonjourmauko committed Aug 9, 2024
1 parent f89b537 commit 294d5ed
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 58 deletions.
10 changes: 5 additions & 5 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { defineConfig } from 'astro/config'
import svelte from '@astrojs/svelte'
import sitemap from '@astrojs/sitemap'
import svelte from '@astrojs/svelte'
import tailwind from '@astrojs/tailwind'
import metadata from 'astro-meta-tags'
import insights from 'astro-page-insight'
import purgecss from 'astro-purgecss'
import assetMinifier from '@playform/compress'
import imageCompressor from 'astro-better-image-service'
import assetCompressor from 'astro-compressor'
import metadata from 'astro-meta-tags'
import insights from 'astro-page-insight'
import purgecss from 'astro-purgecss'
import { defineConfig } from 'astro/config'
import { FontaineTransform } from 'fontaine'

/** @type {import('astro').AstroUserConfig} */
Expand Down
6 changes: 3 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import neostandard from 'neostandard'
import tailwind from 'eslint-plugin-tailwindcss'
import prettier from 'eslint-config-prettier'
import functional from 'eslint-plugin-functional'
import astro from 'eslint-plugin-astro'
import functional from 'eslint-plugin-functional'
import svelte from 'eslint-plugin-svelte'
import tailwind from 'eslint-plugin-tailwindcss'
import neostandard from 'neostandard'
import { parser } from 'typescript-eslint'

const standard = neostandard({
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@astrojs/tailwind": "^5.1.0",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@playform/compress": "^0.1.1",
"@types/node": "^22.1.0",
"astro": "^4.13.1",
Expand Down
21 changes: 20 additions & 1 deletion prettier.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ export default {
embeddedLanguageFormatting: 'auto',
endOfLine: 'lf',
htmlWhitespaceSensitivity: 'css',
importOrder: [
'<TYPES>',
'<TYPES>^(#)',
'<TYPES>^(~)',
'<TYPES>^[.]',
'',
'<BUILTIN_MODULES>',
'',
'<THIRD_PARTY_MODULES>',
'',
'^#/(.*)$',
'',
'^~/(.*)$',
'',
'^!/(.*)$',
'',
'^[./]'
],
insertPragma: false,
jsxSingleQuote: true,
printWidth: 80,
Expand All @@ -24,7 +42,8 @@ export default {
plugins: [
'prettier-plugin-astro',
'prettier-plugin-svelte',
'prettier-plugin-tailwindcss'
'prettier-plugin-tailwindcss',
'@ianvs/prettier-plugin-sort-imports'
],
overrides: [
{
Expand Down
5 changes: 3 additions & 2 deletions src/components/Bio.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import BioArticle from '@components/BioArticle.svelte'
import BioFigure from '@components/BioFigure.astro'
import BioArticle from '~/components/BioArticle.svelte'
import BioFigure from '~/components/BioFigure.astro'
const { title, text, figure } = Astro.props
---

Expand Down
5 changes: 3 additions & 2 deletions src/components/BioFigure.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import tailwindConfig from '#/tailwind.config'
import resolveConfig from 'tailwindcss/resolveConfig'
import { Image } from 'astro:assets'
import resolveConfig from 'tailwindcss/resolveConfig'
import tailwindConfig from '#/tailwind.config'
const { theme } = resolveConfig(tailwindConfig)
const { screens } = theme
Expand Down
7 changes: 5 additions & 2 deletions src/components/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
import { getImage } from 'astro:assets'
import { get } from 'svelte/store'
import resolveConfig from 'tailwindcss/resolveConfig'
import { adresseMaisonQuiroga } from '@stores/PostalAddressStore'
import '@styles/global.css'
import { adresseMaisonQuiroga } from '~/stores/PostalAddressStore'
import '!/styles/global.css'
import tailwindConfig from '#/tailwind.config'
const { streetAddress, addressLocality } = get(adresseMaisonQuiroga)
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Logo from '@components/Logo.astro'
import HeaderTitle from '@components/HeaderTitle.svelte'
import HeaderTitle from '~/components/HeaderTitle.svelte'
import Logo from '~/components/Logo.astro'
const { logo } = Astro.props
const h1 = {
Expand Down
14 changes: 8 additions & 6 deletions src/layouts/Home.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
import { get } from 'svelte/store'
import Head from '@components/Head.astro'
import Header from '@components/Header.astro'
import Nav from '@components/Nav.svelte'
import Footer from '@components/Footer.svelte'
import { adresseMaisonQuiroga } from '@stores/PostalAddressStore'
import coverImage from '@images/logo.jpg'
import Footer from '~/components/Footer.svelte'
import Head from '~/components/Head.astro'
import Header from '~/components/Header.astro'
import Nav from '~/components/Nav.svelte'
import { adresseMaisonQuiroga } from '~/stores/PostalAddressStore'
import coverImage from '!/images/logo.jpg'
const { profileImage } = Astro.props
const images = { coverImage, profileImage }
Expand Down
9 changes: 5 additions & 4 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
import Home from '@layouts/Home.astro'
import Bio from '@components/Bio.astro'
import Curriculum from '@components/Curriculum.svelte'
import imgRoberto from '@images/roberto.jpg'
import Bio from '~/components/Bio.astro'
import Curriculum from '~/components/Curriculum.svelte'
import Home from '~/layouts/Home.astro'
import imgRoberto from '!/images/roberto.jpg'
const bio = {
title: 'Biographie de Roberto Quiroga Valdovinos',
Expand Down
7 changes: 4 additions & 3 deletions src/stores/CityStore.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { get, readable } from 'svelte/store'
import { france, chili } from '@stores/CountryStore'

import type { Readable } from 'svelte/store'
import type { City } from '~/schemas'

import { get, readable } from 'svelte/store'

import { chili, france } from '~/stores/CountryStore'

export const paris: Readable<City> = readable({
'@context': 'https://schema.org',
'@type': 'City',
Expand Down
4 changes: 2 additions & 2 deletions src/stores/CountryStore.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readable } from 'svelte/store'

import type { Readable } from 'svelte/store'
import type { Country } from '~/schemas'

import { readable } from 'svelte/store'

export const france: Readable<Country> = readable({
'@context': 'https://schema.org',
'@type': 'Country',
Expand Down
9 changes: 5 additions & 4 deletions src/stores/PostalAddressStore.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { get, readable } from 'svelte/store'
import { france, chili } from '@stores/CountryStore'
import { paris, valparaiso } from '@stores/CityStore'

import type { Readable } from 'svelte/store'
import type { PostalAddress } from '~/schemas'

import { get, readable } from 'svelte/store'

import { paris, valparaiso } from '~/stores/CityStore'
import { chili, france } from '~/stores/CountryStore'

export const adresseRedtech: Readable<PostalAddress> = readable({
'@context': 'https://schema.org',
'@type': 'PostalAddress',
Expand Down
8 changes: 1 addition & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
"module": "nodenext",
"noEmit": true,
"paths": {
"@fonts/*": ["src/assets/fonts/*"],
"@images/*": ["src/assets/images/*"],
"@styles/*": ["src/assets/styles/*"],
"@components/*": ["src/components/*"],
"@layouts/*": ["src/layouts/*"],
"@pages/*": ["src/pages/*"],
"@stores/*": ["src/stores/*"],
"!/*": ["src/assets/*"],
"~/*": ["src/*"],
"#/*": ["*"]
},
Expand Down
51 changes: 36 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/core@npm:^7.24.9, @babel/core@npm:^7.25.2":
"@babel/core@npm:^7.24.0, @babel/core@npm:^7.24.9, @babel/core@npm:^7.25.2":
version: 7.25.2
resolution: "@babel/core@npm:7.25.2"
dependencies:
Expand All @@ -253,7 +253,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/generator@npm:^7.24.10, @babel/generator@npm:^7.25.0":
"@babel/generator@npm:^7.23.6, @babel/generator@npm:^7.24.10, @babel/generator@npm:^7.25.0":
version: 7.25.0
resolution: "@babel/generator@npm:7.25.0"
dependencies:
Expand Down Expand Up @@ -380,7 +380,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/parser@npm:^7.25.3":
"@babel/parser@npm:^7.24.0, @babel/parser@npm:^7.25.3":
version: 7.25.3
resolution: "@babel/parser@npm:7.25.3"
dependencies:
Expand Down Expand Up @@ -428,37 +428,37 @@ __metadata:
languageName: node
linkType: hard

"@babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.2":
version: 7.25.2
resolution: "@babel/traverse@npm:7.25.2"
"@babel/traverse@npm:^7.24.0, @babel/traverse@npm:^7.25.3":
version: 7.25.3
resolution: "@babel/traverse@npm:7.25.3"
dependencies:
"@babel/code-frame": "npm:^7.24.7"
"@babel/generator": "npm:^7.25.0"
"@babel/parser": "npm:^7.25.0"
"@babel/parser": "npm:^7.25.3"
"@babel/template": "npm:^7.25.0"
"@babel/types": "npm:^7.25.2"
debug: "npm:^4.3.1"
globals: "npm:^11.1.0"
checksum: 10c0/1edcb602801d6ea577584e957a3f6ad48753c4ccb9373fce4c92ebfdee04833f5bd5f1b74758ab7d61fe66d6d83ffdd7c8d482f46199767feeaed6af7df2191e
checksum: 10c0/4c8a1966fa90b53a783a4afd2fcdaa6ab1a912e6621dca9fcc6633e80ccb9491620e88caf73b537da4e16cefd537b548c87d7087868d5b0066414dea375c0e9b
languageName: node
linkType: hard

"@babel/traverse@npm:^7.25.3":
version: 7.25.3
resolution: "@babel/traverse@npm:7.25.3"
"@babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.2":
version: 7.25.2
resolution: "@babel/traverse@npm:7.25.2"
dependencies:
"@babel/code-frame": "npm:^7.24.7"
"@babel/generator": "npm:^7.25.0"
"@babel/parser": "npm:^7.25.3"
"@babel/parser": "npm:^7.25.0"
"@babel/template": "npm:^7.25.0"
"@babel/types": "npm:^7.25.2"
debug: "npm:^4.3.1"
globals: "npm:^11.1.0"
checksum: 10c0/4c8a1966fa90b53a783a4afd2fcdaa6ab1a912e6621dca9fcc6633e80ccb9491620e88caf73b537da4e16cefd537b548c87d7087868d5b0066414dea375c0e9b
checksum: 10c0/1edcb602801d6ea577584e957a3f6ad48753c4ccb9373fce4c92ebfdee04833f5bd5f1b74758ab7d61fe66d6d83ffdd7c8d482f46199767feeaed6af7df2191e
languageName: node
linkType: hard

"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.9, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.8.3":
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.24.9, @babel/types@npm:^7.25.0, @babel/types@npm:^7.25.2, @babel/types@npm:^7.8.3":
version: 7.25.2
resolution: "@babel/types@npm:7.25.2"
dependencies:
Expand Down Expand Up @@ -1097,6 +1097,26 @@ __metadata:
languageName: node
linkType: hard

"@ianvs/prettier-plugin-sort-imports@npm:^4.3.1":
version: 4.3.1
resolution: "@ianvs/prettier-plugin-sort-imports@npm:4.3.1"
dependencies:
"@babel/core": "npm:^7.24.0"
"@babel/generator": "npm:^7.23.6"
"@babel/parser": "npm:^7.24.0"
"@babel/traverse": "npm:^7.24.0"
"@babel/types": "npm:^7.24.0"
semver: "npm:^7.5.2"
peerDependencies:
"@vue/compiler-sfc": 2.7.x || 3.x
prettier: 2 || 3
peerDependenciesMeta:
"@vue/compiler-sfc":
optional: true
checksum: 10c0/2e997fe88da3b6d8288b83aa708afde427e48be55d432dd1657ef8d28a9eb1c329afdf331f46bcfb1f3ce26d3f335598814512902e4644414b4d0ba47b9c416b
languageName: node
linkType: hard

"@img/sharp-darwin-arm64@npm:0.33.4":
version: 0.33.4
resolution: "@img/sharp-darwin-arm64@npm:0.33.4"
Expand Down Expand Up @@ -1478,6 +1498,7 @@ __metadata:
"@astrojs/tailwind": "npm:^5.1.0"
"@commitlint/cli": "npm:^19.3.0"
"@commitlint/config-conventional": "npm:^19.2.2"
"@ianvs/prettier-plugin-sort-imports": "npm:^4.3.1"
"@playform/compress": "npm:^0.1.1"
"@types/node": "npm:^22.1.0"
astro: "npm:^4.13.1"
Expand Down Expand Up @@ -10390,7 +10411,7 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.2, semver@npm:^7.6.3":
"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.2, semver@npm:^7.6.3":
version: 7.6.3
resolution: "semver@npm:7.6.3"
bin:
Expand Down

0 comments on commit 294d5ed

Please sign in to comment.