Skip to content

Commit 394153d

Browse files
committed
fix: linted all assets with updated tooling
1 parent 7165e69 commit 394153d

18 files changed

Lines changed: 7842 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: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,42 @@ jobs:
1313
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16+
GIT_AUTHOR_NAME: Cassondra Roberts
17+
GIT_AUTHOR_EMAIL: castastrophe@users.noreply.github.com
18+
GIT_COMMITTER_NAME: Cassondra Roberts
19+
GIT_COMMITTER_EMAIL: castastrophe@users.noreply.github.com
1620

1721
steps:
1822
- uses: actions/checkout@v5
1923
with:
2024
persist-credentials: false
25+
26+
- name: Enable Corepack
27+
run: corepack enable
28+
2129
- uses: actions/setup-node@v6
2230
with:
23-
node-version: 20
31+
node-version: 22
2432
cache: yarn
2533
registry-url: https://registry.npmjs.org
26-
- run: yarn install --frozen-lockfile
34+
35+
## --- YARN CACHE --- ##
36+
- name: Check for cached dependencies
37+
continue-on-error: true
38+
id: cache-dependencies
39+
uses: actions/cache@v4
40+
with:
41+
path: |
42+
.cache/yarn
43+
node_modules
44+
key: ubuntu-latest-node22-${{ hashFiles('yarn.lock') }}
45+
46+
## --- INSTALL --- ##
47+
# If statement isn't needed here b/c yarn will leverage the cache if it exists
48+
- name: Install dependencies
49+
shell: bash
50+
run: yarn install --immutable
51+
2752
- name: Semantic release
2853
uses: cycjimmy/semantic-release-action@v5
2954
env:

.github/workflows/testing.yml

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ jobs:
1111
steps:
1212
- name: Check out code
1313
uses: actions/checkout@v5
14+
15+
- name: Enable Corepack
16+
run: corepack enable
17+
1418
- name: Use Node LTS version
1519
uses: actions/setup-node@v6
1620
with:
1721
cache: yarn
18-
node-version: 20
22+
node-version: 22
23+
1924
- name: Install dependencies
20-
run: yarn install --frozen-lockfile
25+
run: yarn install --immutable
26+
2127
- name: Run test suite
2228
run: yarn test
2329

@@ -27,12 +33,18 @@ jobs:
2733
runs-on: ubuntu-latest
2834
steps:
2935
- uses: actions/checkout@v5
36+
37+
- name: Enable Corepack
38+
run: corepack enable
39+
3040
- uses: actions/setup-node@v6
3141
with:
3242
cache: yarn
33-
node-version: 20
43+
node-version: 22
44+
3445
- name: Install dependencies
35-
run: yarn install --frozen-lockfile
46+
run: yarn install --immutable
47+
3648
- name: Run coverage report
3749
run: yarn coverage
3850
- uses: actions/upload-artifact@v5
@@ -53,3 +65,91 @@ jobs:
5365
path: code-coverage-results.md
5466
- name: Write to job summary
5567
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
68+
69+
# --- Lint pre-compiled assets for consistency --- #
70+
lint:
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 5
73+
permissions:
74+
contents: read
75+
steps:
76+
- name: Check out code
77+
uses: actions/checkout@v5
78+
with:
79+
fetch-depth: 0
80+
81+
- name: Enable Corepack
82+
run: corepack enable
83+
84+
- name: Use Node LTS version
85+
uses: actions/setup-node@v6
86+
with:
87+
node-version: 22
88+
cache: yarn
89+
90+
## --- YARN CACHE --- ##
91+
- name: Check for cached dependencies
92+
continue-on-error: true
93+
id: cache-dependencies
94+
uses: actions/cache@v4
95+
with:
96+
path: |
97+
.cache/yarn
98+
node_modules
99+
key: ubuntu-latest-node22-${{ hashFiles('yarn.lock') }}
100+
101+
## --- INSTALL --- ##
102+
# If statement isn't needed here b/c yarn will leverage the cache if it exists
103+
- name: Install dependencies
104+
shell: bash
105+
run: yarn install --immutable
106+
107+
- name: Get changed files
108+
id: changed-files
109+
uses: step-security/changed-files@v46
110+
with:
111+
files_yaml: |
112+
eslint:
113+
- '*.js'
114+
mdlint:
115+
- '*.md'
116+
- '!expected/**'
117+
- '!fixtures/**'
118+
119+
- name: Run eslint
120+
uses: reviewdog/action-eslint@v1.34.0
121+
if: ${{ steps.changed-files.outputs.eslint_added_files != '' || steps.changed-files.outputs.eslint_modified_files != '' }}
122+
with:
123+
fail_level: error
124+
level: error
125+
reporter: github-pr-review
126+
filter_mode: diff_context
127+
# eslint_flags: "components/*/stories/*.js"
128+
eslint_flags: "--config ${{ github.workspace }}/.eslintrc ${{ steps.changed-files.outputs.eslint_added_files }} ${{ steps.changed-files.outputs.eslint_modified_files }}"
129+
130+
- name: Run markdownlint on documentation
131+
uses: reviewdog/action-markdownlint@v0.26.2
132+
if: ${{ steps.changed-files.outputs.mdlint_added_files != '' || steps.changed-files.outputs.mdlint_modified_files != '' }}
133+
with:
134+
reporter: github-pr-review
135+
filter_mode: diff_context
136+
fail_level: error
137+
markdownlint_flags: "--config ${{ github.workspace }}/.markdownlint.json ${{ steps.changed-files.outputs.mdlint_added_files }} ${{ steps.changed-files.outputs.mdlint_modified_files }}"
138+
139+
- name: Run lint
140+
run: yarn lint --fix
141+
142+
# This step will evaluate the repo status and report the change
143+
# If there are changes, capture the changes and upload them as an artifact
144+
- name: Check if there are changes
145+
shell: bash
146+
run: |
147+
if [[ -z $(git status --porcelain) ]]; then
148+
echo "No changes detected"
149+
exit 0
150+
else
151+
echo "Changes detected"
152+
git status
153+
git add .
154+
exit 1
155+
fi

.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)