Skip to content

Commit 68e01d0

Browse files
authored
[add] TypeDoc table CSS (#36)
1 parent 8d1df6e commit 68e01d0

File tree

15 files changed

+2496
-1204
lines changed

15 files changed

+2496
-1204
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
version: 9
1818
- uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 22
2121
registry-url: https://registry.npmjs.org
2222
cache: pnpm
2323
- name: Install Dependencies

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
version: 9
1919
- uses: actions/setup-node@v4
2020
with:
21-
node-version: 20
21+
node-version: 22
2222
cache: pnpm
2323
- name: Install & Build
2424
run: |

eslint.config.mjs

Lines changed: 0 additions & 69 deletions
This file was deleted.

eslint.config.ts

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import cspellPlugin from '@cspell/eslint-plugin';
2+
import eslint from '@eslint/js';
3+
import stylistic from '@stylistic/eslint-plugin';
4+
import eslintConfigPrettier from 'eslint-config-prettier';
5+
import react from 'eslint-plugin-react';
6+
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
7+
import globals from 'globals';
8+
import tsEslint, { ConfigArray } from 'typescript-eslint';
9+
import { fileURLToPath } from 'url';
10+
11+
/**
12+
* @see{@link https://github.com/typescript-eslint/typescript-eslint/blob/main/eslint.config.mjs}
13+
*/
14+
15+
const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url));
16+
17+
const config: ConfigArray = tsEslint.config(
18+
// register all of the plugins up-front
19+
{
20+
plugins: {
21+
'@typescript-eslint': tsEslint.plugin,
22+
react,
23+
'@stylistic': stylistic,
24+
'simple-import-sort': simpleImportSortPlugin,
25+
'@cspell': cspellPlugin
26+
}
27+
},
28+
{
29+
// config with just ignores is the replacement for `.eslintignore`
30+
ignores: [
31+
'**/node_modules/**',
32+
'dist/**',
33+
'.parcel-cache/**',
34+
'docs/**'
35+
]
36+
},
37+
38+
// extends ...
39+
eslint.configs.recommended,
40+
...tsEslint.configs.recommended,
41+
42+
// base config
43+
{
44+
languageOptions: {
45+
globals: { ...globals.es2020, ...globals.browser, ...globals.node },
46+
parserOptions: {
47+
projectService: true,
48+
tsconfigRootDir,
49+
warnOnUnsupportedTypeScriptVersion: false
50+
}
51+
},
52+
rules: {
53+
'arrow-body-style': ['error', 'as-needed'],
54+
'no-empty-pattern': 'warn',
55+
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
56+
'consistent-return': 'warn',
57+
'prefer-destructuring': ['error', { object: true, array: true }],
58+
59+
// react
60+
'react/no-unescaped-entities': 'off',
61+
'react/self-closing-comp': [
62+
'error',
63+
{ component: true, html: true }
64+
],
65+
'react/jsx-curly-brace-presence': [
66+
'error',
67+
{ props: 'never', children: 'never' }
68+
],
69+
'react/jsx-no-target-blank': 'warn',
70+
'react/jsx-sort-props': [
71+
'error',
72+
{
73+
reservedFirst: true,
74+
callbacksLast: true,
75+
noSortAlphabetically: true
76+
}
77+
],
78+
// typescript
79+
'@typescript-eslint/no-unused-vars': 'warn',
80+
'@typescript-eslint/no-explicit-any': 'warn',
81+
'@typescript-eslint/no-empty-object-type': 'off',
82+
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
83+
84+
// stylistic
85+
'@stylistic/padding-line-between-statements': [
86+
'error',
87+
{ blankLine: 'always', prev: '*', next: 'return' },
88+
{ blankLine: 'always', prev: 'directive', next: '*' },
89+
{ blankLine: 'any', prev: 'directive', next: 'directive' },
90+
{
91+
blankLine: 'always',
92+
prev: '*',
93+
next: ['enum', 'interface', 'type']
94+
}
95+
],
96+
97+
// simple-import-sort
98+
'simple-import-sort/exports': 'error',
99+
'simple-import-sort/imports': 'error',
100+
// spellchecker
101+
'@cspell/spellchecker': [
102+
'warn',
103+
{
104+
cspell: {
105+
language: 'en',
106+
dictionaries: [
107+
'typescript',
108+
'node',
109+
'html',
110+
'css',
111+
'bash',
112+
'npm',
113+
'pnpm'
114+
]
115+
}
116+
}
117+
]
118+
}
119+
},
120+
eslintConfigPrettier
121+
);
122+
123+
export default config;

guide/table.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#displaying_large_tables_in_small_spaces */
2+
@media (max-width: 768px) {
3+
table {
4+
white-space: nowrap;
5+
}
6+
}
7+
8+
table {
9+
width: 100%;
10+
margin: 0 auto;
11+
display: block;
12+
overflow-x: auto;
13+
border-spacing: 0;
14+
}
15+
16+
th,
17+
td {
18+
border-top-width: 0;
19+
border-left-width: 0;
20+
padding: 0.25rem 0.5rem;
21+
}
22+
23+
th {
24+
vertical-align: bottom;
25+
background: black;
26+
}
27+
28+
th:last-child,
29+
td:last-child {
30+
border-right-width: 0;
31+
}
32+
33+
tr:last-child td {
34+
border-bottom-width: 0;
35+
}
36+
37+
tr td:first-child,
38+
tr th:first-child {
39+
position: sticky;
40+
left: 0;
41+
background: black;
42+
z-index: 1;
43+
}

package.json

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,50 +27,52 @@
2727
"types": "dist/index.d.ts",
2828
"dependencies": {
2929
"@swc/helpers": "^0.5.15",
30-
"dom-renderer": "^2.6.0",
31-
"mobx": ">=6.11",
30+
"dom-renderer": "^2.6.2",
31+
"mobx": ">=6.13.6",
3232
"regenerator-runtime": "^0.14.1",
33-
"web-utility": "^4.4.2"
33+
"web-utility": "^4.4.3"
3434
},
3535
"peerDependencies": {
3636
"@webcomponents/webcomponentsjs": "^2.8",
3737
"core-js": "^3",
3838
"jsdom": ">=23.1"
3939
},
4040
"devDependencies": {
41-
"@eslint/compat": "^1.2.3",
42-
"@eslint/js": "^9.15.0",
43-
"@parcel/config-default": "~2.13.0",
44-
"@parcel/packager-ts": "~2.13.0",
45-
"@parcel/transformer-typescript-tsc": "~2.13.0",
46-
"@parcel/transformer-typescript-types": "~2.13.0",
41+
"@cspell/eslint-plugin": "^8.17.5",
42+
"@eslint/js": "^9.22.0",
43+
"@parcel/config-default": "~2.13.3",
44+
"@parcel/packager-ts": "~2.13.3",
45+
"@parcel/transformer-typescript-tsc": "~2.13.3",
46+
"@parcel/transformer-typescript-types": "~2.13.3",
47+
"@stylistic/eslint-plugin": "^4.2.0",
4748
"@types/eslint-config-prettier": "^6.11.3",
4849
"@types/jest": "^29.5.14",
49-
"@types/node": "^20.17.6",
50-
"core-js": "^3.39.0",
51-
"element-internals-polyfill": "^1.3.12",
52-
"eslint": "^9.15.0",
53-
"eslint-config-prettier": "^9.1.0",
54-
"eslint-plugin-react": "^7.37.2",
50+
"@types/node": "^22.13.10",
51+
"core-js": "^3.41.0",
52+
"element-internals-polyfill": "^1.3.13",
53+
"eslint": "^9.22.0",
54+
"eslint-config-prettier": "^10.1.1",
55+
"eslint-plugin-react": "^7.37.4",
5556
"eslint-plugin-simple-import-sort": "^12.1.1",
56-
"globals": "^15.12.0",
57+
"globals": "^16.0.0",
5758
"husky": "^9.1.7",
5859
"jest": "^29.7.0",
5960
"jest-environment-jsdom": "^29.7.0",
60-
"jsdom": "^25.0.1",
61-
"lint-staged": "^15.2.10",
61+
"jiti": "^2.4.2",
62+
"jsdom": "^26.0.0",
63+
"lint-staged": "^15.5.0",
6264
"open-cli": "^8.0.0",
63-
"parcel": "~2.13.0",
64-
"prettier": "^3.3.3",
65-
"prettier-plugin-sh": "^0.14.0",
65+
"parcel": "~2.13.3",
66+
"prettier": "^3.5.3",
67+
"prettier-plugin-sh": "^0.15.0",
6668
"replace": "^1.2.2",
6769
"rimraf": "^6.0.1",
68-
"ts-jest": "^29.2.5",
70+
"ts-jest": "^29.2.6",
6971
"ts-node": "^10.9.2",
70-
"typedoc": "^0.26.11",
71-
"typedoc-plugin-mdn-links": "^3.3.8",
72-
"typescript": "~5.6.3",
73-
"typescript-eslint": "^8.15.0"
72+
"typedoc": "^0.27.9",
73+
"typedoc-plugin-mdn-links": "^5.0.1",
74+
"typescript": "~5.8.2",
75+
"typescript-eslint": "^8.26.1"
7476
},
7577
"scripts": {
7678
"prepare": "husky",

0 commit comments

Comments
 (0)