Skip to content

Commit 3a59d9a

Browse files
committed
fix: linted all assets with updated tooling
1 parent a86ab34 commit 3a59d9a

19 files changed

Lines changed: 7835 additions & 5281 deletions

.eslintrc

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"node": true,
5+
"es2022": true
6+
},
7+
"parserOptions": {
8+
"sourceType": "module"
9+
},
10+
"extends": "eslint:recommended",
11+
"rules": {
12+
"brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
13+
"func-call-spacing": ["warn", "never"],
14+
"indent": ["warn", "tab", { "ignoredNodes": ["TemplateLiteral *"], "SwitchCase": 1 }],
15+
"linebreak-style": ["warn", "unix"],
16+
"no-console": ["warn", { "allow": ["warn", "error"] }],
17+
"quotes": ["warn", "double"],
18+
"semi": ["warn", "always"],
19+
"space-before-blocks": ["warn", "always"]
20+
},
21+
"overrides": [
22+
{
23+
"files": ["*.json"],
24+
"parser": "jsonc-eslint-parser",
25+
"extends": ["plugin:jsonc/recommended-with-jsonc"],
26+
},
27+
{
28+
"files": ["package.json"],
29+
"parser": "jsonc-eslint-parser",
30+
"rules": {
31+
"jsonc/sort-keys": [
32+
"warn",
33+
{
34+
"pathPattern": "^$",
35+
"order": [
36+
"$schema",
37+
"private",
38+
"name",
39+
"version",
40+
"description",
41+
"license",
42+
"author",
43+
"maintainers",
44+
"contributors",
45+
"homepage",
46+
"repository",
47+
"bugs",
48+
"type",
49+
"exports",
50+
"main",
51+
"module",
52+
"browser",
53+
"man",
54+
"preferGlobal",
55+
"bin",
56+
"files",
57+
"directories",
58+
"scripts",
59+
"config",
60+
"sideEffects",
61+
"types",
62+
"typings",
63+
"workspaces",
64+
"resolutions",
65+
"dependencies",
66+
"bundleDependencies",
67+
"bundledDependencies",
68+
"peerDependencies",
69+
"peerDependenciesMeta",
70+
"optionalDependencies",
71+
"devDependencies",
72+
"keywords",
73+
"engines",
74+
"engineStrict",
75+
"os",
76+
"cpu",
77+
"publishConfig"
78+
]
79+
},
80+
{
81+
"pathPattern": "^repository$",
82+
"order": ["type", "url", "directory"]
83+
},
84+
{
85+
"pathPattern": "^spectrum$",
86+
"order": { "type": "asc" }
87+
},
88+
{
89+
"pathPattern": "^exports$",
90+
"order": ["."]
91+
},
92+
{
93+
"pathPattern": ".*",
94+
"order": { "type": "asc" }
95+
}
96+
]
97+
}
98+
}
99+
]
100+
}

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,30 @@ jobs:
2020
persist-credentials: false
2121
- uses: actions/setup-node@v6
2222
with:
23-
node-version: 20
23+
node-version: 22
2424
cache: yarn
2525
registry-url: https://registry.npmjs.org
26-
- run: yarn install --frozen-lockfile
26+
27+
- name: Enable Corepack
28+
run: corepack enable
29+
30+
## --- YARN CACHE --- ##
31+
- name: Check for cached dependencies
32+
continue-on-error: true
33+
id: cache-dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
.cache/yarn
38+
node_modules
39+
key: ubuntu-latest-node22-${{ hashFiles('yarn.lock') }}
40+
41+
## --- INSTALL --- ##
42+
# If statement isn't needed here b/c yarn will leverage the cache if it exists
43+
- name: Install dependencies
44+
shell: bash
45+
run: yarn install --immutable
46+
2747
- name: Semantic release
2848
uses: cycjimmy/semantic-release-action@v5
2949
env:

.github/workflows/testing.yml

Lines changed: 100 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,34 @@ jobs:
1515
uses: actions/setup-node@v6
1616
with:
1717
cache: yarn
18-
node-version: 20
18+
node-version: 22
19+
20+
- name: Enable Corepack
21+
run: corepack enable
1922
- name: Install dependencies
20-
run: yarn install --frozen-lockfile
23+
run: yarn install --immutable
24+
2125
- name: Run test suite
2226
run: yarn test
2327

28+
- name: Run lint
29+
run: yarn lint --fix
30+
31+
# This step will evaluate the repo status and report the change
32+
# If there are changes, capture the changes and upload them as an artifact
33+
- name: Check if there are changes
34+
shell: bash
35+
run: |
36+
if [[ -z $(git status --porcelain) ]]; then
37+
echo "No changes detected"
38+
exit 0
39+
else
40+
echo "Changes detected"
41+
git status
42+
git add .
43+
exit 1
44+
fi
45+
2446
coverage:
2547
permissions:
2648
pull-requests: write
@@ -30,9 +52,14 @@ jobs:
3052
- uses: actions/setup-node@v6
3153
with:
3254
cache: yarn
33-
node-version: 20
55+
node-version: 22
56+
57+
- name: Enable Corepack
58+
run: corepack enable
59+
3460
- name: Install dependencies
35-
run: yarn install --frozen-lockfile
61+
run: yarn install --immutable
62+
3663
- name: Run coverage report
3764
run: yarn coverage
3865
- uses: actions/upload-artifact@v5
@@ -53,3 +80,72 @@ jobs:
5380
path: code-coverage-results.md
5481
- name: Write to job summary
5582
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
83+
84+
# --- Lint pre-compiled assets for consistency --- #
85+
lint:
86+
name: Lint
87+
runs-on: ubuntu-latest
88+
timeout-minutes: 5
89+
steps:
90+
# install but don't build - we're linting pre-compiled assets
91+
- name: Check out code
92+
uses: actions/checkout@v5
93+
with:
94+
fetch-depth: 0
95+
96+
- name: Use Node LTS version
97+
uses: actions/setup-node@v6
98+
with:
99+
node-version: 22
100+
cache: yarn
101+
102+
- name: Enable Corepack
103+
run: corepack enable
104+
105+
## --- YARN CACHE --- ##
106+
- name: Check for cached dependencies
107+
continue-on-error: true
108+
id: cache-dependencies
109+
uses: actions/cache@v4
110+
with:
111+
path: |
112+
.cache/yarn
113+
node_modules
114+
key: ubuntu-latest-node22-${{ hashFiles('yarn.lock') }}
115+
116+
## --- INSTALL --- ##
117+
# If statement isn't needed here b/c yarn will leverage the cache if it exists
118+
- name: Install dependencies
119+
shell: bash
120+
run: yarn install --immutable
121+
122+
123+
- name: Get changed files
124+
id: changed-files
125+
uses: step-security/changed-files@v46
126+
with:
127+
files_yaml: |
128+
eslint:
129+
- '*.js'
130+
mdlint:
131+
- '*.md'
132+
133+
- name: Run eslint
134+
uses: reviewdog/action-eslint@v1.34.0
135+
if: ${{ steps.changed-files.outputs.eslint_added_files != '' || steps.changed-files.outputs.eslint_modified_files != '' }}
136+
with:
137+
fail_level: error
138+
level: error
139+
reporter: github-pr-review
140+
filter_mode: diff_context
141+
# eslint_flags: "components/*/stories/*.js"
142+
eslint_flags: "--config ${{ github.workspace }}/.eslintrc ${{ steps.changed-files.outputs.eslint_added_files }} ${{ steps.changed-files.outputs.eslint_modified_files }}"
143+
144+
- name: Run markdownlint on documentation
145+
uses: reviewdog/action-markdownlint@v0.26.2
146+
if: ${{ steps.changed-files.outputs.mdlint_added_files != '' || steps.changed-files.outputs.mdlint_modified_files != '' }}
147+
with:
148+
reporter: github-pr-review
149+
filter_mode: diff_context
150+
fail_level: error
151+
markdownlint_flags: "--config ${{ github.workspace }}/.markdownlint.json ${{ steps.changed-files.outputs.mdlint_added_files }} ${{ steps.changed-files.outputs.mdlint_modified_files }}"

.gitignore

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,8 @@ lib-cov
2323
coverage
2424
*.lcov
2525

26-
# nyc test coverage
27-
.nyc_output
28-
29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
38-
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
40-
4126
# Dependency directories
4227
node_modules/
43-
jspm_packages/
44-
45-
# Snowpack dependency directory (https://snowpack.dev/)
46-
web_modules/
47-
4828
# TypeScript cache
4929
*.tsbuildinfo
5030

@@ -54,18 +34,6 @@ web_modules/
5434
# Optional eslint cache
5535
.eslintcache
5636

57-
# Optional stylelint cache
58-
.stylelintcache
59-
60-
# Microbundle cache
61-
.rpt2_cache/
62-
.rts2_cache_cjs/
63-
.rts2_cache_es/
64-
.rts2_cache_umd/
65-
66-
# Optional REPL history
67-
.node_repl_history
68-
6937
# Output of 'npm pack'
7038
*.tgz
7139

@@ -79,46 +47,6 @@ web_modules/
7947
.env.production.local
8048
.env.local
8149

82-
# parcel-bundler cache (https://parceljs.org/)
83-
.cache
84-
.parcel-cache
85-
86-
# Next.js build output
87-
.next
88-
out
89-
90-
# Nuxt.js build / generate output
91-
.nuxt
92-
dist
93-
94-
# Gatsby files
95-
.cache/
96-
# Comment in the public line in if your project uses Gatsby and not Next.js
97-
# https://nextjs.org/blog/next-9-1#public-directory-support
98-
# public
99-
100-
# vuepress build output
101-
.vuepress/dist
102-
103-
# vuepress v2.x temp and cache directory
104-
.temp
105-
.cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# TernJS port file
120-
.tern-port
121-
12250
# Stores VSCode versions used for testing VSCode extensions
12351
.vscode-test
12452

0 commit comments

Comments
 (0)