chore: add lint autofix CI job (#9604)

This commit is contained in:
Sébastien Lorber 2023-12-01 20:09:04 +01:00 committed by GitHub
parent 209b035399
commit 7650829e91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 588 additions and 542 deletions

43
.github/workflows/lint-autofix.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Lint AutoFix
on:
pull_request:
branches:
- main
- docusaurus-v**
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint-autofix:
name: Lint AutoFix
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Installation
run: yarn
- name: AutoFix Format
run: yarn format
- name: AutoFix JS
run: yarn lint:js:fix
- name: AutoFix Style
run: yarn lint:style:fix
- name: AutoFix Spelling
run: yarn lint:spelling:fix
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'refactor: apply lint autofix'

View file

@ -1,8 +1,5 @@
{ {
"*.{js,jsx,ts,tsx,mjs}": ["eslint --fix"], "*.{js,jsx,ts,tsx,mjs}": ["eslint --fix"],
"*.css": ["stylelint --allow-empty-input --fix"], "*.css": ["stylelint --allow-empty-input --fix"],
"*": [ "*": ["prettier --ignore-unknown --write"]
"prettier --ignore-unknown --write",
"cspell --no-must-find-files --no-progress"
]
} }

View file

@ -24,5 +24,5 @@ website/versioned_sidebars/*.json
examples/ examples/
website/static/katex/katex.min.css website/static/katex/katex.min.css
website/changelog/_swizzle_theme_tests website/changelog
website/_dogfooding/_swizzle_theme_tests website/_dogfooding/_swizzle_theme_tests

View file

@ -51,8 +51,11 @@
"lint": "yarn lint:js && yarn lint:style && yarn lint:spelling", "lint": "yarn lint:js && yarn lint:style && yarn lint:spelling",
"lint:ci": "yarn lint:js --quiet && yarn lint:style && yarn lint:spelling", "lint:ci": "yarn lint:js --quiet && yarn lint:style && yarn lint:spelling",
"lint:js": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"", "lint:js": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"",
"lint:spelling": "cspell \"**\" --no-progress", "lint:js:fix": "yarn lint:js --fix",
"lint:spelling": "cspell \"**\" --no-progress --show-context --show-suggestions",
"lint:spelling:fix": "yarn rimraf project-words.txt && echo \"# Project Words - DO NOT TOUCH - This is updated through CI\" >> project-words.txt && yarn -s lint:spelling --words-only --unique --no-exit-code --no-summary \"**\" | sort --ignore-case >> project-words.txt",
"lint:style": "stylelint \"**/*.css\"", "lint:style": "stylelint \"**/*.css\"",
"lint:style:fix": "yarn lint:style --fix",
"lerna": "lerna", "lerna": "lerna",
"test": "jest", "test": "jest",
"test:build:website": "./admin/scripts/test-release.sh", "test:build:website": "./admin/scripts/test-release.sh",
@ -80,7 +83,7 @@
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0", "@typescript-eslint/parser": "^5.62.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cspell": "^6.31.2", "cspell": "^8.1.0",
"eslint": "^8.45.0", "eslint": "^8.45.0",
"eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^8.8.0",

View file

@ -6,6 +6,7 @@
*/ */
import React, {useCallback, useMemo, useRef, useState} from 'react'; import React, {useCallback, useMemo, useRef, useState} from 'react';
import {createPortal} from 'react-dom';
import {DocSearchButton, useDocSearchKeyboardEvents} from '@docsearch/react'; import {DocSearchButton, useDocSearchKeyboardEvents} from '@docsearch/react';
import Head from '@docusaurus/Head'; import Head from '@docusaurus/Head';
import Link from '@docusaurus/Link'; import Link from '@docusaurus/Link';
@ -20,7 +21,6 @@ import {
} from '@docusaurus/theme-search-algolia/client'; } from '@docusaurus/theme-search-algolia/client';
import Translate from '@docusaurus/Translate'; import Translate from '@docusaurus/Translate';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {createPortal} from 'react-dom';
import translations from '@theme/SearchTranslations'; import translations from '@theme/SearchTranslations';
import type {AutocompleteState} from '@algolia/autocomplete-core'; import type {AutocompleteState} from '@algolia/autocomplete-core';

View file

@ -1,347 +1,323 @@
# Project Words - DO NOT TOUCH - This is updated through CI
abernathyca abernathyca
adriaan Adriaan
agan Agan
alexbdebrie alexbdebrie
alexey Alexey
algoliasearch algoliasearch
anonymized Anshul
anshul anshul
août août
APFS
apfs apfs
apos
appinstalled appinstalled
applanga Applanga
architecting architecting
astro Astro
atrule atrule
autoconverted Autoconverted
Autogen
autogen autogen
autogenerating autogenerating
autohide autohide
autolinks Autolinks
backport Bartosz
backticks
bartosz
beforeinstallprompt beforeinstallprompt
bhatt Bhatt
blocklist Blockquotes
blockquotes blockquotes
Bokmål Bokmål
browserslist
browserstack browserstack
Buble
buble buble
builtins Buble's
bunx bunx
caabernathy caabernathy
cacheable cacheable
callouts callouts
callstack Callstack
camelcase camelcase
candillon Candillon
cdabcdab cdabcdab
cdpath cdpath
Cena
cena cena
Changefreq
changefreq changefreq
Chedeau
chedeau chedeau
cheng Clément
clément
clsx
codegen
codeql
codesandbox codesandbox
codespaces Codespaces
commonmark commonmark
contravariance contravariance
corejs corejs
crawlable
creativecommons creativecommons
csapo Csapo
cssnano Csvg
csvg Customizability
customizability customizability
Dabit
dabit dabit
daishi Daishi
Datagit
datagit datagit
datamap Datagit's
datas
dbaeumer
décembre
dedup dedup
deduplicated
déja
deps
devcontainers
devs
devspace
devto devto
dmitry Dmitry
docgen
docsearch docsearch
docsify Docsify
Docu
docu docu
docusuarus docusuarus
docz Docz
doesn Dogfood
dogfood dogfood
Dogfooding
dogfooding dogfooding
dojocat Dojocat
Dyte
dyte dyte
Déja
easyops easyops
Endi
endi endi
Endi's
Endilie
endilie endilie
endiliey endiliey
entrypoints ERRNAMETOOLONG
errnametoolong
esbenp
esbuild
eslintcache
estree
evaluable evaluable
Execa
execa execa
externalwaiting externalwaiting
failfast failfast
Fargate Fargate
fbid FBID
février Fienny
fienny
flac flac
flightcontrol Flightcontrol
formik Flightcontrol's
fouc Formik
FOUC
froms froms
funboxteam funboxteam
février
gabrielcsapo gabrielcsapo
gantt Gifs
getopts Goss
gifs Goyal
gitgraph Gtag
gitpod
globbing
globby
goss
goyal
gruntfuggly
gtag gtag
hahaha hahaha
hamel Hamel
hardcoding Hasura
hastscript
hasura hasura
heavener Heavener
héctor Hideable
héllô
heuristical
hideable hideable
hola hola
horiz Hostman
hostman
hoverable hoverable
husain Husain
ianad Héctor
héllô
IANAD
idempotency idempotency
Iframes Iframes
immer Immer
Infima
infima infima
Infima's
inlines inlines
intelli Intelli
intellij intellij
interactiveness interactiveness
Interpolatable
interpolatable interpolatable
investec Investec
jakepartusch
jamstack
janvier janvier
javadoc javadoc
jiti jiti
jmarcey jmarcey
jodyheavener jodyheavener
joshcena joshcena
jscodeshift
jssdk jssdk
juillet juillet
kaszubowski Kaszubowski
Katex
katex katex
kato Kato
keyscan Keytar
keytar keytar
kinsta Kinsta
knapen Knapen
koyeb Koyeb
kubernetes Koyeb's
lamana Lamana
Lifecycles
lifecycles lifecycles
lighthouserc Linkify
linkify linkify
localizable Localizable
lockb lockb
longpaths Lorber
lorber Lorber's
lowercased LQIP
lqip lqip
lunrjs lunrjs
mapbox Marcey
marcey Marcey's
Markprompt
markprompt markprompt
marocchino Massoud
massoud
mathjax mathjax
maxlynch maxlynch
maxresdefault maxresdefault
MDAST
mdast mdast
mdwn mdwn
mdxa MDXA
mdxast MDXAST
mdxhast MDXHAST
Mdxjs
mdxjs mdxjs
Meilisearch
meilisearch meilisearch
metadatum metadatum
metastring metastring
metrica metrica
metrika Metrika
Microdata
microdata microdata
microlink Mindmap
middlewares
mindmap mindmap
minifier
mkcert
mkdir
mkdirs
mkdn mkdn
mkdocs mkdocs
mkdown mkdown
Moesif
moesif moesif
msapplication msapplication
nabors Nabors
nakagawa Nakagawa
nand nand
Navigations
navigations navigations
navlink navlink
netrc netrc
nextra Nextra
ngryman ngryman
nisarag Nisarag
noflash noflash
noicon noicon
noindex
nojekyll nojekyll
noninteractive noninteractive
noreply
npmjs npmjs
npmrc
nprogress nprogress
ntfs Nuxt
nuxt
oshannessy
onboarded
openapi
opensearch opensearch
opensearchdescription opensearchdescription
opensource opensource
optimizt optimizt
optind Orta
orta orta
Outerbounds
outerbounds outerbounds
overrideable overrideable
OShannessy
pageview pageview
Palenight
palenight palenight
paletton Paletton
palo Palo
Paraiso
paraiso paraiso
pathinfo pathinfo
pathnames
paularmstrong paularmstrong
pbcopy
pcss
peaceiris peaceiris
philpl philpl
Photoshop
photoshop photoshop
picocolors
picomatch picomatch
Pipeable Pipeable
playbtn playbtn
Pluggable
pluggable pluggable
Plushie
plushie plushie
plushies plushies
pnpm
posthog posthog
preactjs Precache
precache precache
precached precached
precaching precaching
preconfigured preconfigured
preconnect
prefetch
prefetching
preloads
prepended
preprocess
preprocessors
prerendered prerendered
prerendering prerendering
println println
prismjs prismjs
producthunt producthunt
Profilo
profilo profilo
protobuf Protobuf
protobuffet protobuffet
prpl PRPL
pyltsyn Pyltsyn
qjpuv QJPUV
qovery Qovery
quasis quasis
quddus Quddus
quddús Quddús
Quickwit
quickwit quickwit
quotify
rachelnabors rachelnabors
ramón Ramón
reactjs reactjs
rearchitecture rearchitecture
recrawl recrawl
redirections redirections
redoc Redoc
redocusaurus redocusaurus
redwoodjs redwoodjs
refactorings refactorings
regexes Rehype
rehype rehype
renderable renderable
reponame REPONAME
reqs Retrocompatibility
requireindex
retrocompatibility retrocompatibility
Retrocompatible
retrocompatible retrocompatible
rmiz rmiz
roadmap
rocketvalidator
rtcts rtcts
rtlcss rtlcss
saurus saurus
scaleway Scaleway
searchbar searchbar
Sebastien
sebastien sebastien
sébastien
sebastienlorber sebastienlorber
sensical sensical
serializers
setaf setaf
setext setext
Shiki
shiki shiki
shortcodes shortcodes
showinfo showinfo
sida Sida
simen Simen
slorber slorber
sluggified sluggified
sluggifies sluggifies
sluggify sluggify
Solana
solana solana
spâce spâce
stackblitz stackblitz
stackblitzrc stackblitzrc
strikethrough Strikethrough
strikethroughs strikethroughs
styl
stylelint stylelint
stylelintrc stylelintrc
subdir subdir
@ -355,71 +331,67 @@ subsetting
subsubcategory subsubcategory
subsubfolder subsubfolder
subsubsection subsubsection
Subsubsubfolder
subsubsubfolder subsubsubfolder
sucipto Sucipto
sunsetting sunsetting
Supabase
supabase supabase
SVGR
svgr svgr
swizzlable swizzlable
teik Sébastien
Teik
templating templating
thanos Thanos
therox Therox
toolset toolset
toplevel toplevel
transifex Transifex
transpiles transpiles
Treeified
treeified treeified
treeifies treeifies
treeify treeify
treosh Triaging
triaging triaging
tses TSES
twoslash twoslash
typecheck typecheck
typechecks Typesense
typedoc
typesense typesense
unavatar Unavatar
unflat
unist
unlinkable unlinkable
Unlisteds
unlisteds unlisteds
Unlocalized
unlocalized unlocalized
unmatch
unnormalized unnormalized
unoptimized
unprefixed
unswizzle unswizzle
unversioned
upvotes upvotes
urlset urlset
userland Vannicatte
vannicatte Vetter
vercel
verifymethod
vetter vetter
vfile vfile
vicenti Vicenti
vieira Vieira
viet Viet
viewports Vinnik
vinnik
vjeux vjeux
waivable waivable
WCAG
wcag wcag
webfactory webfactory
webp
webpackbar webpackbar
webstorm webstorm
wolcott Wolcott
writeups Xplorer
xclip XSOAR
xplorer Yacop
xsoar Yangshun
yacop
yangshun yangshun
yangshunz yangshunz
zhou Zhou
zoomable zoomable
zpao zpao

709
yarn.lock

File diff suppressed because it is too large Load diff