Skip to content

Commit a146524

Browse files
authored
Add prettier sort import plugin (#945)
1 parent 867dea0 commit a146524

File tree

8 files changed

+220
-17
lines changed

8 files changed

+220
-17
lines changed

src/Elastic.Markdown/.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"semi": false,
33
"trailingComma": "es5",
44
"singleQuote": true,
5-
"plugins": ["prettier-plugin-tailwindcss"]
5+
"plugins": [
6+
"prettier-plugin-tailwindcss",
7+
"@trivago/prettier-plugin-sort-imports"
8+
]
69
}

src/Elastic.Markdown/Assets/copybutton.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Localization support
2-
32
import * as ClipboardJS from 'clipboard'
43

54
const DOCUMENTATION_OPTIONS = {

src/Elastic.Markdown/Assets/hljs.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mergeHTMLPlugin } from './hljs-merge-html-plugin'
2-
import { $$ } from 'select-dom'
3-
2+
import { LanguageFn } from 'highlight.js'
3+
import hljs from 'highlight.js/lib/core'
44
import asciidoc from 'highlight.js/lib/languages/asciidoc'
55
import bash from 'highlight.js/lib/languages/bash'
66
import c from 'highlight.js/lib/languages/c'
@@ -13,7 +13,6 @@ import go from 'highlight.js/lib/languages/go'
1313
import gradle from 'highlight.js/lib/languages/gradle'
1414
import groovy from 'highlight.js/lib/languages/groovy'
1515
import handlebars from 'highlight.js/lib/languages/handlebars'
16-
import hljs from 'highlight.js/lib/core'
1716
import http from 'highlight.js/lib/languages/http'
1817
import ini from 'highlight.js/lib/languages/ini'
1918
import java from 'highlight.js/lib/languages/java'
@@ -35,7 +34,7 @@ import swift from 'highlight.js/lib/languages/swift'
3534
import typescript from 'highlight.js/lib/languages/typescript'
3635
import xml from 'highlight.js/lib/languages/xml'
3736
import yaml from 'highlight.js/lib/languages/yaml'
38-
import { LanguageFn } from 'highlight.js'
37+
import { $$ } from 'select-dom'
3938

4039
const languages: Array<{
4140
name: string

src/Elastic.Markdown/Assets/main.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import 'htmx.org'
2-
import 'htmx-ext-preload'
3-
import 'htmx-ext-head-support'
4-
5-
import { initTocNav } from './toc-nav'
6-
import { initHighlight } from './hljs'
7-
import { initTabs } from './tabs'
81
import { initCopyButton } from './copybutton'
9-
import { initNav } from './pages-nav'
2+
import { initHighlight } from './hljs'
103
import { openDetailsWithAnchor } from './open-details-with-anchor'
4+
import { initNav } from './pages-nav'
5+
import { initSmoothScroll } from './smooth-scroll'
6+
import { initTabs } from './tabs'
7+
import { initTocNav } from './toc-nav'
8+
import 'htmx-ext-head-support'
9+
import 'htmx-ext-preload'
10+
import 'htmx.org'
1111
import { $, $$ } from 'select-dom'
12-
1312
import { UAParser } from 'ua-parser-js'
14-
import { initSmoothScroll } from './smooth-scroll'
13+
1514
const { getOS } = new UAParser()
1615

1716
document.addEventListener('htmx:load', function () {

src/Elastic.Markdown/Assets/open-details-with-anchor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { UAParser } from 'ua-parser-js'
2+
23
const { getBrowser } = new UAParser()
34

45
// This is a fix for anchors in details elements in non-Chrome browsers.

src/Elastic.Markdown/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import js from '@eslint/js'
12
import { defineConfig, globalIgnores } from 'eslint/config'
23
import globals from 'globals'
3-
import js from '@eslint/js'
44
import tseslint from 'typescript-eslint'
55

66
export default defineConfig([

src/Elastic.Markdown/package-lock.json

Lines changed: 201 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Elastic.Markdown/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"devDependencies": {
3030
"@eslint/js": "9.23.0",
3131
"@tailwindcss/postcss": "4.1.0",
32+
"@trivago/prettier-plugin-sort-imports": "5.2.2",
3233
"eslint": "9.23.0",
3334
"globals": "16.0.0",
3435
"parcel": "2.14.4",

0 commit comments

Comments
 (0)